我有一堆代码,我试图在R Markdown中编译。
library(jsonlite)
library(rvest)
library(RJSONIO)
library(ggplot2)
library(dplyr)
library(data.table)
#Create a function that will download movie info
rottenrate <- function(movie){
require(RJSONIO)
link <- paste("http://www.omdbapi.com/?t=", movie, "&y=&plot=short&r=json&tomatoes=true", sep = "")
jsonData <- fromJSON(link)
return(jsonData)
}
vrottenrate <- Vectorize(rottenrate, "movie", SIMPLIFY = F)
当我运行时,我遇到了
Error in file(con, "r") : cannot open the connection
Calls: <Anonymous> ... <Anonymous> -> fromJSON -> fromJSON -> I -> structure -> unique