5

what is the easy way to have diamonds package/dataset in my R environment. I am newbie using RStudio (3.0)

> install.packages("diamonds")
Warning in install.packages :
package ‘diamonds’ is not available (for R version 3.0.0)
Warning in install.packages :
package ‘diamonds’ is not available (for R version 3.0.0)

I donot want to download and rebuild R as discussed in the following thread Cannot install R-forge package using install.packages

Community
  • 1
  • 1
kashili kashili
  • 955
  • 4
  • 15
  • 31
  • If you get this error message, it is a good idea to check if the package really exists on CRAN. You can do this by visiting the website. http://cran.r-project.org/web/packages/available_packages_by_name.html – Richie Cotton Nov 21 '13 at 10:31

1 Answers1

18

The diamonds data set is actually part of the excellent ggplot2 package (incidentally, you can find this out with ??diamonds). The following should get you started:

install.packages('ggplot2')
library('ggplot2')
diamonds
colcarroll
  • 3,632
  • 17
  • 25