从网址加载Rdata文件 [英] Loading Rdata files from url
本文介绍了从网址加载Rdata文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在加载文件时遇到困难,因此它不会丢失尺寸.所以这是我的位置:
I'm having difficulty loading a file so that it doesn't lose its dimensions. So here is where I'm at:
> mood_data <- read.table("http://www.psychology.mcmaster.ca/bennett/psy710/datasets/mood_data.Rdata")
如果我执行此操作,那么它只会给我所有信息,这些信息在一行中被组织了.我也尝试过:
If I do this it just gives me all the information disorganized in one line. I also tried:
> mood_data <- url("http://www.psychology.mcmaster.ca/bennett/psy710/datasets/mood_data.Rdata")
> load(mood_data)
如果我这样做,我会得到这个奇怪的东西,对我来说没有任何意义.
If I do this I get this weird stuff that doesn't make any sense to me.
推荐答案
对于.RData
文件,应使用load
.这对我有用.
You should use load
for .RData
files. This works for me.
> load(url("http://www.psychology.mcmaster.ca/bennett/psy710/datasets/mood_data.Rdata"))
> ls()
[1] "mood.data"
> head(mood.data)
group mood
1 pleasant 6
2 pleasant 5
3 pleasant 4
4 pleasant 7
5 pleasant 7
6 pleasant 5
这篇关于从网址加载Rdata文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文