lovekesh
lovekesh

Reputation: 59

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 !

Upvotes: 0

Views: 2623

Answers (1)

Karl Forner
Karl Forner

Reputation: 4414

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).

Upvotes: 1

Related Questions