The problem I am having is that every time I try to plot my points onto a map it seems to remove them.
#getmap
library(ggplot2)
library(ggmap)
testmap <- get_googlemap(c(lon=135,lat=-32) ,zoom=6,
xlim=c(127,142), ylim=c(-23,-34))
save(testmap, file="test.rda")
#Load file
load(file="test.rda")
#plot
plotvar <- c("V37","V39")
plotdata <- WellDownload[plotvar]
#plotting
ggmap(testmap) + geom_point(aes_string(x=plotdata$V37, y=plotdata$V39),
data=plotdata, colour="red", size=3)
Removed 10001 rows containing missing values (geom_point).
is the error I get, my database does have missing values but I don't understand why values are being removed.
What I am aiming to do is to plot points on a map then later do an extrapolation of the data onto the maps based on the coords. I just wanted to find out why I was getting these errors, I have the txt file for the database but am not sure how to upload it.
EDIT hopefully this should work https://www.dropbox.com/s/4rv52deuehyfn9l/WellDownload.txt here is the file
Edit: I just tried a different method of accessing the data and its not removing rows anymore but says "Discrete value supplied to continuous scale"
.
#load file
load(file="e:/CameronFurness/xml_data/test.rda")
#data
mydata <-data.frame(x<-newdata[,"V37"],y<-newdata[,"V39"],#lon= V37, lat=V39,
col = NA_real_)
#plot
ggmap(testmap) + geom_point(aes(x, y), data=mydata, size=3, alpha=0.5, colour="red")
newdata
is a data frame I made with columns V37
and V39
. The coords I am using are in the file, they are decimal_long
and neg_decimal_lat
.