【问题标题】:I have a saved a excel file to RDS file but unable to view the same since it shows no data我有一个将 Excel 文件保存到 RDS 文件,但无法查看,因为它没有显示数据
【发布时间】:2019-04-12 09:45:07
【问题描述】:

我有一个保存为 #saveRDS 格式的 excel 文件,但现在当我尝试查看该文件时,我得到“表中没有可用数据”

countries_all2 <- saveRDS(countries_map, "as_countries_map_2019.RDS")
summary(countries_all2)

Length  Class   Mode 
     0   NULL   NULL 

readRDS(countries_all2)

readRDS(countries_all2) 中的错误:错误的“文件”参数

readRDS(countries_all2.RDS)

readRDS(countries_all2.RDS) 中的错误: 找不到对象“countries_all2.RDS”

readRDS(as_countries_map_2019.RDS)

readRDS(as_countries_map_2019.RDS) 中的错误: 找不到对象“as_countries_map_2019.RDS”

summary(countries_all2)
Length  Class   Mode 
     0   NULL   NULL

【问题讨论】:

    标签: r


    【解决方案1】:

    您不应将saveRDS 的结果分配给变量countries_all2

    saveRDS(countries_map, "as_countries_map_2019.RDS")
    

    然后你需要引用readRDS中的文件名。假设你要读入对象countries_all2

    countries_all2 <- readRDS("as_countries_map_2019.RDS")
    

    【讨论】:

    • 如果它解决了您的问题,请接受并投票给答案。
    猜你喜欢
    • 1970-01-01
    • 2022-11-19
    • 2011-10-11
    • 2018-12-25
    • 2020-07-28
    • 2016-07-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多