English 中文(简体)
• 如何阻止R部分使用latt鱼包进行的平级土地?
原标题:How to block a part of the level plot in R made using lattice package?

我在R中利用latt子包做了一个变数。 这个电网相当于南亚。 我只想看到南亚某些国家这种变数(气溶胶光学深度)的数值。 我有一小米变量,对我感兴趣的国家来说,这个数值为1,其他为0。 难道我可以把这个部分网格黑或任何其他颜色混为一谈吗?

I cannot show the level plot as I am low on reputation with stackoverflow. (The pdf that was attached to the crossposted message to rhelp should now appear:)

我的《区域法典》是:

levelplot(aod ~ longitude + latitude | factor(day), data = aod_Jan, 
    aspect="iso", contour = TRUE, layout=c(1,1))

“entergraph

问题回答

由于你正在使用地理数据,因此,或许可以通过<代码>raster的包裹对你有用。 例如,请显示法国的高度(下载:zip文档或使用raster:getData 功能)。 unzip 档案:

library(raster)
fraAlt <- raster( FRA_alt )
plot(fraAlt) ## Not only France is displayed...

If you want to display only the altitude of France, you need the information of the boundaries: download this RData file (or use the raster::getData function). This RData contains a SpatialPolygonsDataFrame (named gadm) which can be converted to a Raster with:

 mk <- rasterize(gadm, fraAlt)

现在,你可以掩盖边界高度:

 fraAltMask <- mask(fraAlt, x)
 plot(fraAltMask) ##Now only France is displayed

最后,如果你想要使用<条码>。 所用名称不意味着联合国秘书处表示任何意见。 iii

 library(rasterVis)
 levelplot(fraAlt)
 levelplot(fraAltMask)

如今,所有边界和边界都存在:

 s <- stack(fraAlt, fraAltMask)
 layerNames(s) <- c( Alt ,  AltMask )
 boundaries <- as(gadm,  SpatialLines )
 levelplot(s) + layer(sp.lines(boundaries))

利用分门别类的论点进行分级。 也许:

levelplot(aod ~ longitude + latitude | factor(day), data = aod_Jan, subset = dummy==1,
    aspect="iso", contour = TRUE, layout=c(1,1))




相关问题
How to plot fitted model over observed time series

This is a really really simple question to which I seem to be entirely unable to get a solution. I would like to do a scatter plot of an observed time series in R, and over this I want to plot the ...

REvolution for R

since the latest Ubuntu release (karmic koala), I noticed that the internal R package advertises on start-up the REvolution package. It seems to be a library collection for high-performance matrix ...

R - capturing elements of R output into text files

I am trying to run an analysis by invoking R through the command line as follows: R --no-save < SampleProgram.R > SampleProgram.opt For example, consider the simple R program below: mydata =...

R statistical package: wrapping GOFrame objects

I m trying to generate GOFrame objects to generate a gene ontology mapping in R for unsupported organisms (see http://www.bioconductor.org/packages/release/bioc/vignettes/GOstats/inst/doc/...

Changing the order of dodged bars in ggplot2 barplot

I have a dataframe df.all and I m plotting it in a bar plot with ggplot2 using the code below. I d like to make it so that the order of the dodged bars is flipped. That is, so that the bars labeled "...

Strange error when using sparse matrices and glmnet

I m getting a weird error when training a glmnet regression. invalid class "dgCMatrix" object: length(Dimnames[[2]]) must match Dim[2] It only happens occasionally, and perhaps only under larger ...

Generating non-duplicate combination pairs in R

Sorry for the non-descriptive title but I don t know whether there s a word for what I m trying to achieve. Let s assume that I have a list of names of different classes like c( 1 , 2 , 3 , 4 ) ...

Per panel smoothing in ggplot2

I m plotting a group of curves, using facet in ggplot2. I d like to have a smoother applied to plots where there are enough points to smooth, but not on plots with very few points. In particular I d ...

热门标签