package ‘diamonds’ is not available (for R version 3.0.0) [duplicate]

StackOverflow https://stackoverflow.com/questions/20112049

  •  03-08-2022
  •  | 
  •  

문제

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

도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top