Hello Community,
I just update RStudio from version 0.99.896 to 1.1.383 (the latest) working on Ubuntu 16.4.
Before to update, I wrote a script of analysis in which I plot an interpolation of a data set using ggplot2.
this is the script:
require(akima) #this package interpolate values
require(ggplot2)
Space1 <- subset(x = ChlaMD0_3, Depth <= 14 & !(Station %in% c("P10","P11","P12c")))
Space2 <- subset(x = ChlaMD0_3, Depth <= 14 & Station %in% c("P10","P11") & Time == "D")
Space <- rbind(Space1,Space2)
duplicated(Space)
attach(Space)
fld <- with(Space, interp(x = Longitud.E., y = Latitude.S., z = Chla2017_mean,duplicate = "mean"))
gdat <- interp2xyz(fld, data.frame=TRUE)
ggplot(gdat) +
aes(x = x, y = y, z = z, fill = z) +
geom_tile() +
#coord_equal() +
geom_contour(color = "white", alpha = 0.5) +
scale_fill_distiller(palette="Spectral", na.value="white",limits=c(0,0.35)) +
scale_y_reverse()+
theme_bw()+
ggtitle("Chlorophyll-a (class size 0.3-2.7 um)")+
ylab("Latitude S") + xlab("Longitude E")+
labs(fill = "Chl-a (mg/m3)")+
geom_point(data = Space, mapping = aes(Longitud.E.,Latitude.S.),shape=1)
It worked really well, but after the updating I have this error massage:
Error in FUN(X[[i]], ...) : object 'z' not found
How can I solve the problem and plot the interpolation?