Download Rdata Files from a URL

I find it difficult to upload a file so that it does not lose its size. So here is where I am:

> 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 on 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 strange material that makes no sense to me.

+6
source share
1 answer

You must 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 
+7
source

Source: https://habr.com/ru/post/976030/


All Articles