Here are some simple scripts to get anyone started mining Japanese texts using R.
To install RMeCab in R, load the "StartingWithRMeCab.r" file into RStudio and execute it. Before it will work, however, you will have to install MeCab on your computer. For instructions on how to do all of that on a Mac, see https://sleepingmountains.com/2022/06/29/installing-mecab-and-rmecab-on-a-mac/ and let me know how it goes!