Converting vectors to numeric in mixed-type dataframe

Coercing variables of character and numeric type into a single dataframe yields all vectors to be defined as factors

all <- data.frame(cbind(site, year, model, x, y, z))

The following converts selected variables from “factor” back to “numeric”
all$x <- as.numeric(x)
all$y <- as.numeric(y)
all$z <- as.numeric(z)

More fun with sed

So I have this strange date and time string, which I would like to convert to a “useable” date, i.e., something that a spreadsheet programme or R can work with. It looks like this (MON has 3 chars):


The string is the second field in a csv file, preceded and followed by a comma.

My strategy was to terminate the string before the first colon and delete everything thereafter to be left with the following string (with one occurrence in each of the about 6000 lines of the file):

sed does this in a single line (looks kinda ugly, but does the trick):
sed 's/:[0-9][0-9]:[0-9][0-9]:[0-9][0-9]//g' myfile.csv >myfile2.csv

Data interpretation & comparison

Still busy comparing and interpreting my measurement data with 3rd party measurements – very interesting, but tedious as well. I have obtained ground ozone data from Alert that was recorded during my own measurement campaign and the data confirm the trend that I already observed with column ozone data:

There is a correlation between the depletion event that I observed for the measured VOC species in air and snow and sharply increasing ozone concentrations near ground: Another indicator that VOC in near surface snow contribute to atmospheric processes.

Data, data, data!

Now that all measurements are done – at least those that I will need for my conference presentation – I am busy with data analysis. So far things have been going well and I have set up quite good calibration curves for snow and air data.

I focus on canister data obtained with the cryo-system and SPME data, both of which were used in connection with a GC-FID. So I am still concentrating on my 20 compounds that I have originally chosen for analysis before I went on the field trip to Alert.

But, when I am done I will have snow surface data, snow depth profile data and air data for 20 common VOC from Alert, which will make a nice package to present at this year’s AGU Fall Meeting in San Francisco.