Hi all,
I want to create dataset in R so that i load into R session as follows
data(mydatasetname)
I tried following
values<- read.table("mydatasetname.txt") save(values,file="value.rda")
but wen i type following command to load data
data(values)
Warning message: In data(values) : data set ‘values’ not found
Can anybody help
Nitin
Sukhdeep has the right answer,
I want to create dataset in R so that i load into R session as follows
data(mydatasetname)
I tried following
values<- read.table("mydatasetname.txt") save(values,file="value.rda")
but wen i type following command to load data
data(values)
Warning message: In data(values) : data set ‘values’ not found
Can anybody help
Nitin
data()
is really for
getting datasets from packages or the standard library in R. Just so you
know, if you do create a package then plain text tables are one of of
the formats that you can use in the /data
directory (as per the documentation) - i.e. there is no reason to save your data in the binary format
You read a table in a variable named values
This will load the image you saved capturing the table you read. To confirm, type
HTH
Cheers
values<- read.table("mydatasetname.txt")
you saved a image as an .rda (Rdata) filesave(values,file="value.rda")
To load it , use the load
command as
load('value.rda')
This will load the image you saved capturing the table you read. To confirm, type
ls()
which will list the values
variable and typing it will output the values stored in it.
Also, the data
command is to load the data provided by default with the packages, so if you write data()
, it will give you a list existing datasets.HTH
Cheers
No comments:
Post a Comment