Archives for posts with tag: presentation

Today I gave my presentation at useR! 2011. I am not satisfied with how it went – I ran over the time by 2 minutes (which is a lot considering it was supposed to be 17 minutes) and forgot to make a main point, which is showing the XML that goes in and out of the packages! So if you’re interested, be sure to run lines 72 to 75 of the code below.

Nevertheless, Read the rest of this entry »

A new issue of The R Journal was recently published. It contains interesting articles for geostatisticians, for example about the package rworldmap. But it also provides a very useful Help Desk section with the two articles Presenting Your Work and Giving a useR! Talk, which come just in time for me to re-think my presentation of sos4R that I will give at useR! 2011 in Warwick. The draft version of the conference booklet was also published (take a look at page 14!).

But my personal highlight of this R Journal is on page 99 of the complete issue:

sos4R in The R Journal - Screenshot

A paper about sos4R was accepted for presentation and publication on AGILE 2011. This is a great step for the project. The paper is a good way to review the development, analyse what was done and how, and abstract a little bit from the pure coding and just “getting things to work”. And it  hopefully brings publicity and new opportunities. The title and abstract is as follows:

Connecting R to the Sensor Web

Daniel Nüst, Christoph Stasch, Edzer Pebesma

Interoperable data exchange and reproducibility are increasingly important for modern scientific research. This paper shows how three open source projects work together to realize this: (i) the R project, providing the lingua franca for statistical analysis, (ii) the Open Geospatial Consortium’s Sensor Observation Service (SOS), a standardized data warehouse service for storing and retrieving sensor measurements, and (iii) sos4R, a new project that connects the former two. We show how sos4R can bridge the gap between two communities in science: spatial statistical analysis and visualization on one side, and the Sensor Web community on the other. sos4R enables R users to integrate (near real-time) sensor observations directly into R. Finally, we evaluate the functionality of sos4R. The software encapsulates the service’s complexity with typical R function calls in a common analysis workflow, but still gives users full flexibility to handle interoperability issues. We conclude that it is able to close the gap between R and the sensor web.

And with that “highlight” at the end of the year, I wish happy holidays to everybody.

Today was the final presentation of both 52° North Innovation Price winners. It went really well for my, even the live demos worked! Check out the slides and the code below.


################################################################################
# PegelOnlineSOS
pegelsos <- SOS(url = "http://v-sos.uni-muenster.de:8080/PegelOnlineSOSv2/sos")

# what data do I get?
names(sosOfferings(pegelsos))

# let's find interesting data
procs <- sosProcedures(pegelsos)
contain_Bake <- procs %in% grep("*Bake*", procs, value=TRUE)
baken <- subset(procs, contain_Bake)
baken
# Bake_Z, http://www.pegelonline.wsv.de/gast/stammdaten?pegelnr=9510066

# what and when?
wasserstand <- sosObservedProperties(pegelsos)[3]
wasserstand_roh <- sosOfferings(pegelsos)[[2]]
tPeriod <- sosCreateEventTimeList(
time = sosCreateTimePeriod(
sos = pegelsos,
begin = Sys.time() - (3600 * 24 * 30),
end = Sys.time()))
str(tPeriod)
encodeXML(tPeriod[[1]], pegelsos)

# three procedures, but only getting 1 element with one procedure...
pegelObs <- getObservation(sos = pegelsos,
observedProperty = wasserstand,
offering = wasserstand_roh,
procedure = baken[c(7, 9, 11)],
eventTime = tPeriod)

# show parts of the data frame:
pegelObs[[1]]@result[1:2,]
pegelObs[[2]]@result[1:2,]
pegelObs[[3]]@result[1:2,]

# not enough info? got field descriptions as attributes for each column:
attributes(pegelObs[[1]]@result$Time) # TIME
attributes(pegelObs[[1]]@result$Wasserstand) # actual value

# do something with the data!
r1 <- pegelObs[[1]]@result
range(r1$Wasserstand)
r1clean <- subset(r1, Wasserstand > 0)
range(r1clean$Wasserstand)
plot(r1clean$Time, r1clean$Wasserstand, type = "l", ylim=c(200,800))

# Plot a quantile regression line with standard error bounds, using the quantreg package.
library("ggplot2"); library("latticeExtra"); library("quantreg")
r1plot <- xyplot(r1clean$Wasserstand ~ r1clean$Time, r1clean, type = "l", col = "orange")
r1plot + layer(panel.quantile(x, y, tau = c(.95, .5, .05)))

################################################################################
# OOSTethys SOS                                                                #
# http://www.oostethys.org/development/web-services/web-services-summary       #
################################################################################
# Sensor Observation Service (SOS) for Marine Metadata Interoperability
# Initiative (MMI) # Using GET works!

MBARI <- SOS("http://mmisw.org/oostethys/sos", method = "GET")

sosOfferings(MBARI)
paste(sosProcedures(MBARI))
paste(sosObservedProperties(MBARI))

myOff <- sosOfferings(MBARI)[[1]]
myProc <- sosProcedures(MBARI)[3]

mbariObs <- getObservation(sos = MBARI, offering = myOff, procedure = myProc)

# add converter for UOM C (which is not a valid unit)
myConverters <- SosFieldConvertingFunctions(
"C" = sosConvertDouble,
"S/m" = sosConvertDouble,
"http://mmisw.org/ont/cf/parameter/sea_water_salinity" = sosConvertDouble)

# creat SOS connection again and request data
MBARI <- SOS("http://mmisw.org/oostethys/sos", method = "GET",
dataFieldConverters = myConverters)
mbariObs <- getObservation(sos = MBARI, offering = myOff, procedure = myProc)

mbariObs@result[1:3,]
attributes(mbariObs@result$Temperature)
str(mbariObs@result)

# quick plot
plot(mbariObs@result)
plot(mbariObs@result[,c("Temperature", "Salinity", "Conductivity")])

# covariance, ...
cov(mbariObs@result[, 5:7])
# correlation
cor(mbariObs@result[, 5:7])

The project presentation is on next Monday – I hope that explains the lack of entries in the last week(s). I managed to get quite a lot of stuff done, even tested several SOS instances. As a little proof (I know, counting empty lines and comments is cheating): I am up to 9.213 lines of code!

The invitation to the presentation, times et cetera are listed below. I’d sure be happy about a lot of interested guests! Read the rest of this entry »