我有以下代码:
library(ggmap)
ggmap(get_map(location=c(lon = 5.218922, lat = 52.342366), zoom =14))
Run Code Online (Sandbox Code Playgroud)
哪个由我的帐户应该工作正常,但我只得到一个标准的ggplot2图像(灰色背景等),正确的轴,但没有显示地图:
当我查看我的工作目录时,我找到一个名为"ggmapTemp"的文件,其中包含正确的地图.但是ggplot2没有显示地图.
我与RStudio合作,对我的工作电脑拥有有限的权利.这可能是地图显示不正确的原因吗?我的RStudio版本是0.96.316,R是R-2.15.1.
> sessionInfo()
R version 2.15.1 (2012-06-22)
Platform: x86_64-pc-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=Dutch_Netherlands.1252 LC_CTYPE=Dutch_Netherlands.1252
[3] LC_MONETARY=Dutch_Netherlands.1252 LC_NUMERIC=C
[5] LC_TIME=Dutch_Netherlands.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggmap_2.1 ggplot2_0.9.1
loaded via a namespace (and not attached):
[1] colorspace_1.1-1 dichromat_1.2-4 digest_0.5.2 grid_2.15.1
[5] labeling_0.1 MASS_7.3-18 memoise_0.1 munsell_0.3
[9] plyr_1.7.1 png_0.1-4 proto_0.3-9.2 RColorBrewer_1.0-5
[13] reshape2_1.2.1 RgoogleMaps_1.2.0 rjson_0.2.9 scales_0.2.1
[17] stringr_0.6 tools_2.15.1
Run Code Online (Sandbox Code Playgroud)
更新: 我的sessionInfo()回答1后: …
我正在制作一个用Shiny分析时间序列数据的应用程序.我使用的数据如下:
V1 V2
1 2013-02-04 18:15:00 -4.746
2 2013-02-04 18:20:00 -4.745
3 2013-02-04 18:25:00 -4.746
4 2013-02-04 18:30:00 -4.747
5 2013-02-04 18:35:00 -4.747
6 2013-02-04 18:40:00 -4.747
Run Code Online (Sandbox Code Playgroud)
我想在表格中绘制数据:
output$view <- renderTable({
head(datasubset(),
n=nrow(datasubset()))
})
Run Code Online (Sandbox Code Playgroud)
这样做我在运行Shiny时出错:
Error in Math.POSIXt(x + ifelse(x == 0, 1, 0)) :
'abs' not defined for "POSIXt" objects
Run Code Online (Sandbox Code Playgroud)
有没有人有这个错误的解决方案?
更新:该错误是由xtable造成的:renderTable使用xtable()生成的输出,它看起来像xtable不与一般的日期打出好成绩.
Winston Chang在此提出了一个问题:https: //github.com/rstudio/shiny/issues/129
解决方法可在以下位置获得:R:xtable和日期