Skip to content

Instantly share code, notes, and snippets.

@krlmlr
Created August 28, 2013 06:36
Show Gist options
  • Save krlmlr/6362771 to your computer and use it in GitHub Desktop.
Save krlmlr/6362771 to your computer and use it in GitHub Desktop.
read.table(text="599 449
149 99
249 189
349 259
199 99
299 NA
399 199
549 329
129 79
599 359
70 40
90 69
369 NA") -> ..
subset(.., !is.na(V2)) -> ..
plyr::rename(.., c(V1="CHF", V2="EUR")) -> ..
..$CHF.net <- ..$CHF / 1.08
..$EUR.net <- ..$EUR / 1.19
lm(CHF~EUR, ..) -> m
lm(CHF.net~EUR.net, ..) -> m.net
m.net$coefficients["EUR.net"] / 1.23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment