简体   繁体   中英

data() not working in R . (version 3.0.2)

I got a very trivial but a very frustrating problem. The problem is, I want to load data from the packages I have already installed in R . This is what I am doing :

  1. Open R
  2. then I would type data() to see what data sets are available.
  3. Let's see I want to load CO2 data set from the package "datasets"
  4. But when I type data(CO2) in the console, nothing happens.

Even co2 <- data(CO2) doesn't seems to be working. I also tried loading datasets using library(datasets) but nothing seems to be working. Please Help !

data() loads the dataset into the global environment if not already loaded. Just type:

CO2

to access the dataset. For CO2, you do not even have to use data(CO2).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM