Tag: rcharts

用自定义地图/ shp制作地图

在R,我想帮助试图在这里复制我自己的自定义SHP(Shapefile)文件或地图的教程是一个交互式的等值线地图… 地图是北爱尔兰的小地区。 这可以在这里find。 以下是我迄今采取的步骤… 我认为问题是geographyConfig数据的设置… 任何帮助将非常感激…. # Download and unzip the data system('wget http://www.nisra.gov.uk/archive/geography/digital_products/SA2011_Esri_Shapefile.zip') system('unzip SA2011_Esri_Shapefile.zip') # Load libraries library(rgdal) library(rgeos) library(rMaps) shp.file <- 'SA2011.shp' # Convert projection system(paste0('ogr2ogr tmp.shp ', shp.file, ' -t_srs "+proj=longlat +ellps=WGS84 +no_defs +towgs84=0,0,0"')) # Read in the data xx <- readOGR(dsn=getwd(),layer='tmp') mm <- xx@data head(mm) n <- nrow(mm) dat.val <- […]

rCharts nvd3 lineWithFocusChart自定义

我在rCharts上使用nvd3,并想知道是否有一种方法来自定义lineWithFocusChart上较低视图查找器graphics的坐标轴。 我在下面提供了一个可重现的例子,其中我自定义x和y轴以逗号分隔千位,但格式不显示在较低的取景器图表上。 这怎么解决? 谢谢! library(rCharts) temp <- data.frame(x = 1:2000, y = 1:2000, z = c(rep(1,1000), rep(0,1000))) g <- nPlot(y ~ x, group = "z", data = temp, type = "lineWithFocusChart") g$templates$script <- "http://timelyportfolio.github.io/rCharts_nvd3_templates/chartWithTitle_styled.html" g$set(title = "Example") g$chart(transitionDuration = -1, tooltipContent = "#! function(key, x, y) { return 'z: ' + key + '<br/>' + […]