Sandbox: Difference between revisions
Juha Villman (talk | contribs) No edit summary |
|||
(29 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
<math> | |||
\alpha + 444444 + \beta + \omega | |||
</math> | |||
jepjepjepjep | |||
[[:File:aditro.PNG]] | |||
[[Image:kuvatiedostonmitähäan.jpg]] | |||
<display_map type="terrain"> | |||
62.904602, 27.647781 | |||
62.891918, 27.680013 | |||
</display_map> | |||
{{mfiles}} | |||
<t2b index="Make" unit="kg" desc="Description"> | |||
Lata|100| | |||
Toyota|88|Toijota | |||
</t2b> | |||
{{variable|moderator=Ehac}} | |||
mitä tapahtuu! | |||
<math>\alpha + 8884444</math> | <math>\alpha + 8884444</math> | ||
Line 23: | Line 36: | ||
</math> | </math> | ||
== Live Code Test == | |||
<rcode live=1 graphics=1 name='live_test' variables='name:breaks|description:Breaks|options:10;10;20;20;35;35;50;50|type:selection|default:10'> | |||
hist(faithful$eruptions, | |||
probability = TRUE, | |||
breaks = as.numeric(breaks), | |||
xlab = "Duration (minutes)", | |||
main = "Geyser eruption duration") | |||
</rcode> | |||
== Sotkanet == | |||
<rcode name='sotkanet_test'> | |||
library(OpasnetUtils) | |||
library(OpasnetUtilsExt) | |||
# collect makes a data.frame out of the list object from Sotkanet | |||
# x is the input data | |||
# name is the name for the column | |||
# single is a logical whether there is only a single entry in the x data. | |||
collect <- function(x, name, single = FALSE) { | |||
out <- data.frame() | |||
if(single) {out <- data.frame(temp1 = x$id, temp2 = x$title$fi) | |||
} else { | |||
for(i in 1:length(x)) { | |||
out <- rbind(out, data.frame(temp1 = x[[i]]$id, temp2 = x[[i]]$title$fi)) | |||
} | |||
} | |||
colnames(out) <- c(name, paste(name, "Result", sep="")) | |||
return(out) | |||
} | |||
a <- sotkanet.indicators() | |||
# print(a) | |||
b <- sotkanet.indicators(127) | |||
b <- collect(b, "indicator", TRUE) | |||
# print(xtable(b), type = 'html') | |||
d <- sotkanet.regions() | |||
d <- collect(d, "region") | |||
# print(xtable(d), type = 'html') | |||
e <- sotkanet.data(indicator=127,years=c(2011,2010),genders='female') | |||
e <- merge(b, e) | |||
e <- merge(d, e) | |||
oprint(e) | |||
</rcode> | |||
== Objects save test == | |||
<rcode name='objs_save_test'> | |||
library(OpasnetUtils) | |||
x <- stats::runif(20) | |||
y <- list(a = 1, b = TRUE, c = "Jeah baby jeah!") | |||
objects.store(x, y, verbose=TRUE) | |||
</rcode> | |||
==Giving tables via user interface== | |||
<rcode embed="1" variables="name:test|type:table"> | |||
library(OpasnetUtils) | |||
oprint(test) | |||
</rcode> | |||
== ovariable merge testing == | == ovariable merge testing == | ||
Line 28: | Line 117: | ||
<rcode> | <rcode> | ||
library(OpasnetUtils) | library(OpasnetUtils) | ||
merge( | aa <- new("ovariable", output = data.frame(dummy=NA)) | ||
bb <- new("ovariable", output = data.frame(a=1:4)) | |||
#cc <- new("ovariable", output = data.frame(a=1:4)) | |||
cc <- '' | |||
test <- Ovariable( | |||
name='test', | |||
dependencies = data.frame( | |||
Name = c("aa", "bb", "cc"), | |||
Ident = c(NA, NA, NA) | |||
), | |||
formula = function(dependencies, ...) { | |||
ComputeDependencies(dependencies, ...) | |||
out <- merge(aa, bb) | |||
return(out) | |||
} | |||
) | |||
oprint(test) | |||
</rcode> | </rcode> | ||
Line 43: | Line 152: | ||
library(RColorBrewer) | library(RColorBrewer) | ||
library(classInt) | library(classInt) | ||
library( | library(OpasnetUtils) | ||
library(OpasnetUtilsExt) | |||
shp<-readOGR('PG:host=localhost user=postgres dbname=spatial_db','kuopio_house') | shp<-readOGR('PG:host=localhost user=postgres dbname=spatial_db','kuopio_house') | ||
Line 112: | Line 222: | ||
legend("topleft", legend=names(attr(colcode, "table")),title="Ika", fill=attr(colcode, "palette"), cex=1.0, bty="y",bg="white") | legend("topleft", legend=names(attr(colcode, "table")),title="Ika", fill=attr(colcode, "palette"), cex=1.0, bty="y",bg="white") | ||
</rcode> | </rcode> | ||
== Kuopio buildings on Google maps test == | == Kuopio buildings on Google maps test == | ||
Line 123: | Line 231: | ||
library(RColorBrewer) | library(RColorBrewer) | ||
library(classInt) | library(classInt) | ||
library( | library(OpasnetUtils) | ||
library(OpasnetUtilsExt) | |||
library(RODBC) | library(RODBC) | ||
Line 200: | Line 309: | ||
</rcode> | </rcode> | ||
== GoogleMaps Sorvi MML TEST == | |||
<rcode name='gmapspsqltest3'> | <rcode name='gmapspsqltest3'> | ||
library( | library(OpasnetUtils) | ||
library(OpasnetUtilsExt) | |||
library(sorvi) | library(sorvi) | ||
library(rgdal) | library(rgdal) | ||
Line 232: | Line 341: | ||
</rcode> | </rcode> | ||
== GoogleMaps PostgreSQL test 2 == | |||
<rcode name='gmapspsqltest2'> | <rcode name='gmapspsqltest2'> | ||
Line 240: | Line 349: | ||
library(RColorBrewer) | library(RColorBrewer) | ||
library(classInt) | library(classInt) | ||
library( | library(OpasnetUtils) | ||
library(OpasnetUtilsExt) | |||
shp<-readOGR('PG:host=localhost user=postgres dbname=spatial_db','watson_wkt') | shp<-readOGR('PG:host=localhost user=postgres dbname=spatial_db','watson_wkt') | ||
Line 267: | Line 377: | ||
</rcode> | </rcode> | ||
== GoogleMaps PostgreSQL test == | |||
<rcode name='gmapspsqltest'> | <rcode name='gmapspsqltest'> | ||
library( | library(OpasnetUtils) | ||
cat(" | library(OpasnetUtilsExt) | ||
cat("PostgreSQL Test\n") | |||
google.show_data_on_maps() | google.show_data_on_maps() | ||
Line 279: | Line 390: | ||
</rcode> | </rcode> | ||
== Opasnet.csv test == | |||
<rcode name='opcsvtest'> | <rcode name='opcsvtest'> | ||
library( | library(OpasnetUtils) | ||
csv <- opasnet.csv("2/25/Russian_elections_2011_results.csv") | csv <- opasnet.csv("2/25/Russian_elections_2011_results.csv") | ||
Line 290: | Line 401: | ||
</rcode> | </rcode> | ||
== Opasnet.data and BUGS test == | |||
<rcode name='odabugstest' graphics=1> | <rcode name='odabugstest' graphics=1> | ||
library( | library(OpasnetUtils) | ||
pumps.model <- opasnet.data('c/cc/Test_bugs_model.txt') | pumps.model <- opasnet.data('c/cc/Test_bugs_model.txt') | ||
Line 344: | Line 455: | ||
<br> {{greenbox| | <br> {{greenbox| | ||
==Hello== | |||
* this works | * this works | ||
}} | }} | ||
{{bluebox| | {{bluebox| | ||
==Bluebox== | |||
* works | * works | ||
* ok | * ok | ||
Line 368: | Line 479: | ||
name:divisions2|description:Minkä yhden tekijän halua eritellä kuvaajassa?|type:selection|options:'Katalyytin määrä';Katalyytin määrä;'Ikä';Ikä;'Kastelu';Kastelu;'Käytetty puristin';Käytetty puristin|default:'Kastelu' | name:divisions2|description:Minkä yhden tekijän halua eritellä kuvaajassa?|type:selection|options:'Katalyytin määrä';Katalyytin määrä;'Ikä';Ikä;'Kastelu';Kastelu;'Käytetty puristin';Käytetty puristin|default:'Kastelu' | ||
"> | "> | ||
library( | library(OpasnetUtils) | ||
library(ggplot2) | library(ggplot2) | ||
library(xtable) | library(xtable) | ||
Line 457: | Line 568: | ||
=== MassHEIS test === | === MassHEIS test === | ||
<rcode name=' | |||
:''Moved to [[MassHEIS]]. | |||
=== MassHEIS test multilayer NOT WORKING YET === | |||
<rcode name='MassHEISTestML' graphics='1'> | |||
library(OpasnetUtils) | library(OpasnetUtils) | ||
library(OpasnetUtilsExt) | library(OpasnetUtilsExt) | ||
Line 475: | Line 590: | ||
shp<-spTransform(data,epsg4326String) | shp<-spTransform(data,epsg4326String) | ||
start <- min(shp$anmean) | |||
end <- max(shp$anmean) | |||
rasters = list() | |||
years = c(2000,2001,2002) | |||
# | for(y in 1:length(years)) | ||
{ | |||
#Create blank raster | |||
rast<-raster() | |||
s <- shp[(shp$Year == years[y]),] | |||
#Set raster extent to that of point data | |||
extent(rast)<-extent(s) | |||
#Choose number of columns and rows | |||
ncol(rast) <- 64 | |||
nrow(rast) <- 64 | |||
#Rasterize point data | |||
rasters[[y]] <- rasterize(s, rast, s$anmean, fun=mean) | |||
} | |||
steps <- approx(c(start,end),n=6)$y | steps <- approx(c(start,end),n=6)$y | ||
Line 505: | Line 629: | ||
cat("<span style='font-size: 1.2em;font-weight:bold;'>Massachusetts annual mean PM 2.5 microns</span>\n") | cat("<span style='font-size: 1.2em;font-weight:bold;'>Massachusetts annual mean PM 2.5 microns</span>\n") | ||
colorstrip(colors, steps) | colorstrip(colors, steps) | ||
Line 511: | Line 634: | ||
#Plot data | #Plot data | ||
google.show_raster_on_maps( | s <- stack(rasters) | ||
names(s) <- c('z2000','z2001','z2002') | |||
print(s) | |||
google.show_raster_on_maps(s, col=colors, style="height:500px;") | |||
Line 517: | Line 647: | ||
<!-- __OBI_TS: | |||
<!-- __OBI_TS:1353932360 --> |
Latest revision as of 19:33, 17 May 2014
Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \alpha + 444444 + \beta + \omega }
jepjepjepjep
File:Kuvatiedostonmitähäan.jpg
<display_map type="terrain"> 62.904602, 27.647781 62.891918, 27.680013 </display_map>
<mfanonymousfilelist></mfanonymousfilelist>
Obs | Make | Result | Description |
---|---|---|---|
1 | Lata | 100 | |
2 | Toyota | 88 | Toijota |
Moderator:Ehac (see all) |
|
Upload data
|
mitä tapahtuu!
Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \alpha + 8884444}
Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \textstyle L_{Aeq} = 10 \log \int_{t_0}^{t_1} \frac{p_A^2(t)}{p_0^2} dt }
Live Code Test
Sotkanet
Objects save test
Giving tables via user interface
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 (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \alpha 444 + 9999 / 123}
Hello
- this works
Bluebox
- works
- ok
R-tools code include example
Rectangle area test
MassHEIS test
- Moved to MassHEIS.
MassHEIS test multilayer NOT WORKING YET