How to open the .json file in R?



I am currently trying to read a .json file in R for reading it I have install the package the jsonlite.But after installation when I have tried to read the .json file ,I am getting error.

train <- fromJSON(“train.json”, flatten = TRUE)
Error in open.connection(con, “rb”) : cannot open the connection
In addition: Warning message:
In open.connection(con, “rb”) :
cannot open file ‘train.json’: Permission denied



You can use package “rjson” to read JSON data file in R. To know more about this package, I would recommend you to read documentation file here.

Follow below steps to read JSON file in R:-

json_file <- “train.json”