将数据加载到 Rstudio

Loading Data into Rstudio

我做错了什么?

library(readr)
source.data= (file.path("C", "User","Administrator", "Documents","Classes","Fall_2018","Econ380"))
"weather <- read_rds'(file.path(source.data, VirginiaWeather2017.rds))

Error: unexpected string constant in

Error: Incomplete expression: weather <- read_rds'(file.path(source.data,CollegeParkWeather2017.rds))

欢迎使用 Stack Overflow 和 R。readr::read_rds 中有一个错字——多余的撇号。此外,您需要将 rds 对象用双引号引起来,并在 C 之后放置一个冒号。

以下是如何工作的?

library(readr)
source.data <- 
  file.path("C:", "User", "Administrator", "Documents", "Classes", "Fall_2018", "Econ380")
weather <- read_rds(file.path(source.data, "VirginiaWeather2017.rds"))

如果没有解决问题,请告诉我。