Difference between revisions of "Sandbox"
Juha Villman (talk | contribs) |
m (→Rectangle area test) |
||
Line 455: | Line 455: | ||
width * height | width * height | ||
</rcode> | </rcode> | ||
+ | |||
+ | === MassHEIS test === | ||
+ | <rcode name='MassHEISTest' graphics='1'> | ||
+ | library(OpasnetUtils) | ||
+ | library(OpasnetUtilsExt) | ||
+ | library(ggplot2) | ||
+ | library(rgdal) | ||
+ | library(maptools) | ||
+ | library(RColorBrewer) | ||
+ | library(classInt) | ||
+ | library(raster) | ||
+ | |||
+ | data <- MassHEIS.data() | ||
+ | |||
+ | # Plot the data | ||
+ | coordinates(data)=c("longitude","latitude") | ||
+ | proj4string(data)<-("+init=epsg:4326") | ||
+ | epsg4326String <- CRS("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs") | ||
+ | shp<-spTransform(data,epsg4326String) | ||
+ | |||
+ | #Create blank raster | ||
+ | rast<-raster() | ||
+ | |||
+ | #Set raster extent to that of point data | ||
+ | extent(rast)<-extent(shp) | ||
+ | |||
+ | #Choose number of columns and rows | ||
+ | ncol(rast) <- 64 | ||
+ | nrow(rast) <- 64 | ||
+ | |||
+ | #Rasterize point data | ||
+ | rast2<-rasterize(shp, rast, shp$anmean, fun=mean) | ||
+ | |||
+ | start <- min(shp$anmean) | ||
+ | end <- max(shp$anmean) | ||
+ | |||
+ | steps <- approx(c(start,end),n=6)$y | ||
+ | colors <- rev(rainbow(length(steps), start=0, end=0.50)) | ||
+ | |||
+ | par(mfrow=c(6,1), mar=c(3,1,0,1), cex=1.5) | ||
+ | |||
+ | colorstrip <- function(colors, labels) | ||
+ | { | ||
+ | count <- length(colors) | ||
+ | m <- matrix(1:count, count, 1) | ||
+ | image(m, col=colors, ylab="", axes=FALSE) | ||
+ | axis(1,approx(c(0, 1), n=length(labels))$y, labels) | ||
+ | } | ||
+ | |||
+ | cat("<span style='font-size: 1.2em;font-weight:bold;'>Massachusetts annual mean PM 2.5 microns</span>\n") | ||
+ | |||
+ | |||
+ | colorstrip(colors, steps) | ||
+ | |||
+ | #Plot data | ||
+ | |||
+ | google.show_raster_on_maps(rast2, col=colors, style="height:500px;") | ||
+ | |||
+ | |||
+ | </rcode> | ||
+ | |||
<!-- __OBI_TS:1332833567 --> | <!-- __OBI_TS:1332833567 --> |
Revision as of 13:04, 31 October 2012
This page is a variable.
The page identifier is Op_en1390 |
---|
Moderator:Ehac (see all) |
Give your opinion to the peer rating of the content of this page. |
Upload data
|
jepjep
Wikitab
http://ytoswww/yhteiset/YMAL/Projects/
Edited by ehacfff math ei jekkase Failed to parse (Missing <code>texvc</code> executable. Please see math/README to configure.): L_{Aeq} = 10 \log \int_{t_0}^{t_1} \frac{p_A^2(t)}{p_0^2} dt
Failed to parse (Missing <code>texvc</code> executable. Please see math/README to configure.): \alpha + 8884444
Failed to parse (Missing <code>texvc</code> executable. Please see math/README to configure.): \textstyle L_{Aeq} = 10 \log \int_{t_0}^{t_1} \frac{p_A^2(t)}{p_0^2} dt
Contents
ovariable merge testing
Static GoogleMaps test
Kuopio buildings on Google maps test
GoogleMaps Sorvi MML TEST
GoogleMaps PostgreSQL test 2
GoogleMaps PostgreSQL test
Opasnet.csv test
Opasnet.data and BUGS test
Failed to parse (Missing <code>texvc</code> executable. Please see math/README to configure.): \alpha 444 + 9999 / 123
Hello
- this works
Bluebox
- works
- ok
R-tools code include example
Rectangle area test
MassHEIS test