ggplot2 - Getting an error in R - [Error: could not find function "qplot"] -


orginal r version

r version 3.2.2 (2015-08-14) -- "fire safety" copyright (c) 2015 r foundation statistical computing platform: x86_64-w64-mingw32/x64 (64-bit)  > library(ggplot2) error in library.dynam(lib, package, package.lib) :    dll ‘colorspace’ not found: maybe not installed architecture? in addition: warning message: package ‘ggplot2’ built under r version 3.2.3  error: package or namespace load failed ‘ggplot2’ > qplot(weights, prices, color = types) error: not find function "qplot" 

.... hi got issues running ggplot2, i'm trying through basic online tutorial issue, trying run qplot in 1 of exercises got errors listed above, i've read around bit on previous lookups, went through motions of:

  • install.packages("proto")
  • install.packages('ggplot2', dep = true),
  • rebooting r - still getting error. other "answer"?

@mlavoie, mike wise

> install.packages('ggplot2', dependencies = true) installing package ‘c:/users/sony/documents/r/win-library/3.2’ (as ‘lib’ unspecified) trying url 'https://cran.rstudio.com/bin/windows/contrib/3.2/ggplot2_2.0.0.zip' content type 'application/zip' length 1977368 bytes (1.9 mb) downloaded 1.9 mb  package ‘ggplot2’ unpacked , md5 sums checked  downloaded binary packages in     c:\users\sony\appdata\local\temp\rtmpy97ttr\downloaded_packages > library("ggplot2", lib.loc="~/r/win-library/3.2") error in get(info[i, 1], envir = env) :    cannot open file 'c:/users/sony/documents/r/win-library/3.2/scales/r/scales.rdb': no such file or directory error: package or namespace load failed ‘ggplot2’ 

session info:

> sessioninfo() r version 3.2.3 (2015-12-10) platform: x86_64-w64-mingw32/x64 (64-bit) running under: windows 7 x64 (build 7601) service pack 1  locale: [1] lc_collate=english_united states.1252  lc_ctype=english_united states.1252    lc_monetary=english_united states.1252 [4] lc_numeric=c                           lc_time=english_united states.1252      attached base packages: [1] stats     graphics  grdevices utils     datasets  methods   base       other attached packages: [1] ggplot2movies_0.0.1  loaded via namespace (and not attached): [1] colorspace_1.2-6 plyr_1.8.3       tools_3.2.3      gtable_0.1.2     rcpp_0.12.3      grid_3.2.3       munsell_0.4.2    

i had same error after installing ggplot2. 2 ways around this:

1) need load "library(ggplot2)" before call qplot()

library(ggplot2) qplot(factor(class), volume, data = abalone, geom = "boxplot") 

2) discovered randomly adding "ggplot2::" in front of code makes work, without calling library.

ggplot2::qplot(factor(class), volume, data = abalone, geom = "boxplot") 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -