[R] Loading .RData from Internet

Ivan Calandra ivan.calandra at uni-hamburg.de
Mon Dec 6 09:52:15 CET 2010


Try with load() instead of read.table()
read.table() is for csv, txt... files.
load() is for R files

Ivan

Le 12/6/2010 09:35, zhiji19 a écrit :
> Dear All,
>
> Can you please suggest me a correct way to load the following R data frame
> from the internet and save it to the hard drive?
>
> The following is what I tried:
>> raceprofiling<-
>> read.table("http://rss.acs.unt.edu/Rdoc/library/twang/data/raceprofiling.RData")
>> save(raceprofiling, file = 'raceprofiling.RData')
> However, when I used dim() to check the dataset, I got:
>> dim(raceprofiling)
> [1] 11085  1
>
> The correct dimension should be 5000 and 10.
>
> Many Thanks.

-- 
Ivan CALANDRA
PhD Student
University of Hamburg
Biozentrum Grindel und Zoologisches Museum
Abt. Säugetiere
Martin-Luther-King-Platz 3
D-20146 Hamburg, GERMANY
+49(0)40 42838 6231
ivan.calandra at uni-hamburg.de

**********
http://www.for771.uni-bonn.de
http://webapp5.rrz.uni-hamburg.de/mammals/eng/1525_8_1.php



More information about the R-help mailing list