R plotROC package failing related to ggproto
Googling around suggests that install the dev versions might help:
devtools::install_github("hadley/ggplot2")
devtools::install_github("sachsmc/plotROC")
See this related SO answer.
Error: ScalesList was built with an incompatible version of ggproto
This is very strange; now things are back to normal.
I did what @baptiste suggested, and the R source code just worked ok.
After that, I knitted the Rmarkdown again and the error had disappeared!
ggplot not plotting ggmap object
This is probably the version error because your code runs perfectly on my machine (R 3.3.2).devtools::install_github("dkahle/ggmap")
devtools::install_github("hadley/ggplot2")
You can download packages "devtools" and install ggmap and ggplot2 from github again.
R shiny. Error pops up while using ggmap
This works fine:
require("ggmap") # apparently needs rjson
coordinates <- data.frame(place=c("w", "x", "y", "z"),
latitude=c(28.844692, 28.750925, 28.702134, 28.716547),
longitude=c(77.103305, 77.1963099, 77.2202666, 77.1704),
stringsAsFactors=FALSE)
a <- coordinates[coordinates$place=="y",c("place","latitude","longitude")]
get_constituency <- get_map(c(a$longitude, a$latitude))
ggmap(get_constituency) +
geom_point(aes(x = a$longitude,
y = a$latitude, size=10),
alpha = .5, col="red") +
scale_size(range=c(3,5))
p=ggmap(get_constituency) +
geom_point(aes(x = a$longitude,
y = a$latitude, size=10),
alpha = .5, col="red") +
scale_size(range=c(3,5))
print(p, newpage = FALSE)
EDIT
OP was looking for something like this:
require(ggplot2)
require(grid)
require(gridBase)
require(ggmap)
z=data.frame(x=1:10, y=11:20)
coordinates <- data.frame(place=c("w", "x", "y", "z"),
latitude=c(28.844692, 28.750925, 28.702134, 28.716547),
longitude=c(77.103305, 77.1963099, 77.2202666, 77.1704),
stringsAsFactors=FALSE)
a <- coordinates[coordinates$place=="y",c("place","latitude","longitude")]
get_constituency <- get_map(c(a$longitude, a$latitude))
# setup everything
plot.new()
gl <- grid.layout(2,2)
vp.1 <- viewport(layout.pos.col = 1, layout.pos.row = 1)
vp.2 <- viewport(layout.pos.col = 2, layout.pos.row = 1)
vp.3 <- viewport(layout.pos.col = 1, layout.pos.row = 2)
vp.4 <- viewport(layout.pos.col = 2, layout.pos.row = 2)
pushViewport(viewport(layout=gl))
# First plot
pushViewport(vp.1)
par(new = TRUE, fig = gridFIG(), mar=c(0,0,0,0))
pie(z$x,z$y)
popViewport()
# Second plot
pushViewport(vp.2)
par(new = TRUE, fig = gridFIG(), mar=c(0,0,0,0))
pie(z$x,z$y)
popViewport()
# Your map
pushViewport(vp.3)
op <-ggmap(get_constituency) +
geom_point(aes(x = a$longitude,
y = a$latitude, size=10),
alpha = .5, col="red") +
scale_size(range=c(3,5))
print(op, newpage = FALSE)
np=ggmap(get_constituency) +
geom_point(aes(x = a$longitude,
y = a$latitude, size=10),
alpha = .5, col="red") +
scale_size(range=c(3,5))
print(np, newpage = FALSE)
popViewport()
# Your map
pushViewport(vp.4)
op <-ggmap(get_constituency) +
geom_point(aes(x = a$longitude,
y = a$latitude, size=10),
alpha = .5, col="red") +
scale_size(range=c(3,5))
print(op, newpage = FALSE)
np=ggmap(get_constituency) +
geom_point(aes(x = a$longitude,
y = a$latitude, size=10),
alpha = .5, col="red") +
scale_size(range=c(3,5))
print(np, newpage = FALSE)
popViewport()
ggmap qmplot() object '.all_aesthetics' not found
I found the solution. The issue I was experiencing was a result of a not-up-to-date version of ggmap
package. As recommended by camille I decided to update the ggmap
package. It turns out that it can't be done with devtools::install_github("dkahle/ggmap")
while ggplot2
has been installed from GitHub. As pointed out in this thread I went for downgrading ggplot2
to the version available at CRAN (3.0.0) and had no problems installing ggmap
from GitHub.
Coefplot fatal plotting error ggproto [R]
Figured it out:
devtools::install_github("jaredlander/coefplot")
It seems like jaredlander recently updated coefplot, which was causing the error.
Related Topics
Generate Paired Stacked Bar Charts in Ggplot (Using Position_Dodge Only on Some Variables)
Set Certain Values to Na with Dplyr
Formatting Reactive Data.Frames in Shiny
Databricks Configure Using Cmd and R
Global Variables in Packages in R
Add Line Break to Axis Labels and Ticks in Ggplot
Add (Subtract) Months Without Exceeding the Last Day of the New Month
How to Reorder a Legend in Ggplot2
Display Weighted Mean by Group in the Data.Frame
Select Columns Based on String Match - Dplyr::Select
Unique() for More Than One Variable
Deleting Columns from a Data.Frame Where Na Is More Than 15% of the Column Length
Setting Document Title in Rmarkdown from Parameters