【发布时间】:2015-11-09 05:39:34
【问题描述】:
首先,我很抱歉。
我知道有很多关于这个错误的帖子,但是我尝试了很多解决方案,但我没有设法解决我的问题。
我尝试将我的数据转换为多种形式,但仍然出现相同的错误,或者 ggplot2 不支持该数据格式。
这是我的代码:
library(ggmap)
library(ggplot2)
library(data.table)
setwd("~/Projects/reformat")
map <- get_map(location = c(-4,54.5), zoom = 6)
data <- read.csv('lonlatprice.csv')
colnames(data) <- c('Longitude','Latitude','Price')
ggmap(map, extent = "device") + geom_point(aes(x = data$Longitude, y = data$Latitude), colour = "red",
alpha = 0.1, size = 2)
数据格式是这样的:
> head(data)
Longitude Latitude Price
1 53.778274 -2.48129 147500
2 52.833819 -0.936527 182000
3 50.792457 0.046043 193000
4 51.476984 -0.612126 580000
5 51.460139 -0.01867 905000
6 52.235942 1.519404 641500
在此先感谢您的帮助,在无数天没有成功后,我只是作为最后的手段才提出的。
【问题讨论】:
-
嗨,您可以链接到您查看过的问题,或者您尝试过但没有帮助的解决方案吗?这样我们就可以避免建议您已经浏览过的内容。