Sandbox: Difference between revisions

From Opasnet
Jump to navigation Jump to search
No edit summary
 
(29 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{variable|moderator=Ehac}}
<math>
\alpha + 444444 + \beta + \omega
</math>
 
jepjepjepjep
 
 
 
[[:File:aditro.PNG]]
 
[[Image:kuvatiedostonmitähäan.jpg]]


&#9;jepjep
<display_map type="terrain">
62.904602, 27.647781
62.891918, 27.680013
</display_map>


Wikitab
{{mfiles}}


http://ytoswww/yhteiset/YMAL/Projects/  
<t2b index="Make" unit="kg" desc="Description">
Lata|100|
Toyota|88|Toijota
</t2b>


Edited by ehacfff
{{variable|moderator=Ehac}}
math ei jekkase
mitä tapahtuu!
<math>


L_{Aeq} = 10 \log \int_{t_0}^{t_1} \frac{p_A^2(t)}{p_0^2} dt


</math>


<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)
a <- new("ovariable", output = data.frame(dummy=NA))
b <- new("ovariable", output = data.frame(a=1:4))


merge(a,b)
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(OpasnetBaseUtils)
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(OpasnetBaseUtils)
library(OpasnetUtils)
library(OpasnetUtilsExt)
library(RODBC)
library(RODBC)


Line 200: Line 309:
</rcode>
</rcode>


 
== GoogleMaps Sorvi MML TEST ==
=== GoogleMaps Sorvi MML TEST ===


<rcode name='gmapspsqltest3'>
<rcode name='gmapspsqltest3'>


library(OpasnetBaseUtils)
library(OpasnetUtils)
library(OpasnetUtilsExt)
library(sorvi)
library(sorvi)
library(rgdal)
library(rgdal)
Line 232: Line 341:
</rcode>
</rcode>


=== GoogleMaps PostgreSQL test 2 ===
== GoogleMaps PostgreSQL test 2 ==


<rcode name='gmapspsqltest2'>
<rcode name='gmapspsqltest2'>
Line 240: Line 349:
library(RColorBrewer)
library(RColorBrewer)
library(classInt)
library(classInt)
library(OpasnetBaseUtils)
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 ===
== GoogleMaps PostgreSQL test ==


<rcode name='gmapspsqltest'>
<rcode name='gmapspsqltest'>
library('OpasnetBaseUtils')
library(OpasnetUtils)
cat("<span style='font-size: 1.2em;font-weight:bold;'>PostgreSQL Test</span>\n")
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 ===
== Opasnet.csv test ==


<rcode name='opcsvtest'>
<rcode name='opcsvtest'>
library(OpasnetBaseUtils)
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 ===
== Opasnet.data and BUGS test ==


<rcode name='odabugstest' graphics=1>
<rcode name='odabugstest' graphics=1>
library(OpasnetBaseUtils)
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===
==Hello==
* this works
* this works
}}  
}}  


{{bluebox|
{{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(OpasnetBaseUtils)
library(OpasnetUtils)
library(ggplot2)
library(ggplot2)
library(xtable)
library(xtable)
Line 457: Line 568:


=== MassHEIS test ===
=== MassHEIS test ===
<rcode name='MassHEISTest' graphics='1'>
 
:''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)


#Create blank raster
rast<-raster()


#Set raster extent to that of point data
start <- min(shp$anmean)
extent(rast)<-extent(shp)
end <- max(shp$anmean)


#Choose number of columns and rows
rasters = list()
ncol(rast) <- 64
years = c(2000,2001,2002)
nrow(rast) <- 64


#Rasterize point data
for(y in 1:length(years))
rast2<-rasterize(shp, rast, shp$anmean, fun=mean)
{
#Create blank raster
rast<-raster()


start <- min(shp$anmean)
s <- shp[(shp$Year == years[y]),]
end <- max(shp$anmean)
 
#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(rast2, col=colors, style="height:500px;")
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:




&nbsp;<!-- __OBI_TS:1332833567 -->
 
&nbsp;<!-- __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:aditro.PNG

File:Kuvatiedostonmitähäan.jpg

<display_map type="terrain"> 62.904602, 27.647781 62.891918, 27.680013 </display_map>


<mfanonymousfilelist></mfanonymousfilelist>


Sandbox: Difference between revisions(kg)
ObsMakeResultDescription
1Lata100
2Toyota88Toijota



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

Breaks:

+ Show code


Sotkanet

+ Show code

Objects save test

+ Show code

Giving tables via user interface

test:

Cancel

+ Show code

ovariable merge testing

+ Show code

Static GoogleMaps test

+ Show code

Kuopio buildings on Google maps test

Building minimum age:

+ Show code

GoogleMaps Sorvi MML TEST

+ Show code

GoogleMaps PostgreSQL test 2

+ Show code

GoogleMaps PostgreSQL test

+ Show code

Opasnet.csv test

+ Show code

Opasnet.data and BUGS test

+ Show code

+ Show code

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

+ Show code

Jatropan viljelyala (ha):

n:

Mitkä tekijät halua eritellä tuloksessa?:
Katalyytin määrä
Ikä
Kastelu
Käytetty puristin

Minkä yhden tekijän halua eritellä kuvaajassa?:

+ Show code

+ Show code

Rectangle area test

width:

Rect height:

+ Show code

MassHEIS test

Moved to MassHEIS.

MassHEIS test multilayer NOT WORKING YET

+ Show code