Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in UseMethod("rescale") prevents ggplot from creating object #2394

Closed
thomashauner opened this issue Jan 10, 2018 · 5 comments
Closed

Comments

@thomashauner
Copy link

I am having trouble graphing with ggplot2 after updating RStudio to version 1.1.383 from 0.98.053. Previously I used ggplot2 exhaustively without problems.

Each time I receive the following error:

Error in UseMethod("rescale") :
no applicable method for 'rescale' applied to an object of class "c('double', 'numeric')"

This error is produced even with the most simplified example, and even when forcing the scales library to load first. The most recent version of ggplot2 has been installed from CRAN.

Any help is greatly appreciated!

library(scales)
library(ggplot2)

df <- data.frame(x = rnorm(10), y = rnorm(10))
ggplot(df, aes(x = x, y =y)) + geom_point()
@batpigandme
Copy link
Contributor

Hmm, I'm not able to reproduce your error. Could you please make a reprex with the std_out_err argument set to TRUE?

If you've never heard of a reprex before, you might want to start by reading the tidyverse.org help page

You might also consider moving this question over to community.rstudio.com or stackoverflow, until we can determine that it's actually a bug. There are many more eyes over there, and the community can help you figure out if it's an issue that needs to be resolved by the maintainers.

library(scales)
library(ggplot2)

df <- data.frame(x = rnorm(10), y = rnorm(10))
ggplot(df, aes(x = x, y =y)) + geom_point()

Created on 2018-01-10 by the reprex package (v0.1.1.9000).

Thanks,

Mara

@hadley
Copy link
Member

hadley commented Jan 10, 2018

Chances are you've ended up with a borked package install. I'd recommend reinstalling ggplot2.

@thomashauner
Copy link
Author

Thanks for the suggestions. Still no luck. The ggplot error in UseMethod("rescale") remains.

I'm also getting a curl::curl_fetch_memory(url, handle = handle) error when I attempt to render as a reprex (either using the add-in, or using the reprex() wrapper).

I've reinstalled all the packages (ggplot2, reprex, curl, httr) after restarting the machine and R session to no effect.

I've also tried the following (based on the discussion here: swirldev/swirl#475) which did not resolve the curl error:

library(bitops)
library(RCurl)
library(httr)
set_config( config( ssl_verifypeer = 0L ) )

Here's what my curl version indicates (for which reprex() does work):

curl::curl_version() 
#> $version
#> [1] "7.56.1"
#> 
#> $ssl_version
#> [1] "(OpenSSL/1.1.0f) WinSSL"
#> 
#> $libz_version
#> [1] "1.2.8"
#> 
#> $libssh_version
#> [1] "libssh2/1.8.0"
#> 
#> $libidn_version
#> [1] NA
#> 
#> $host
#> [1] "x86_64-w64-mingw32"
#> 
#> $protocols
#>  [1] "dict"   "file"   "ftp"    "ftps"   "gopher" "http"   "https" 
#>  [8] "imap"   "imaps"  "ldap"   "ldaps"  "pop3"   "pop3s"  "rtsp"  
#> [15] "scp"    "sftp"   "smtp"   "smtps"  "telnet" "tftp"  
#> 
#> $ipv6
#> [1] TRUE
#> 
#> $http2
#> [1] FALSE
#> 
#> $idn
#> [1] TRUE

Again, all this began with updating Rstudio to the latest version. Is it advisable to revert to an older version of Rstudio? I am still using R version 3.3.2.

@thomashauner
Copy link
Author

UPDATE: I needed to use a particular options(repos=structure()) to install packages from, which I had not done since updating my Rstudio. This seems to have been the source of the "borked" packages I had installed.

@lock
Copy link

lock bot commented Jul 10, 2018

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Jul 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants