Flex your RCurl/XML muscle. Shortest code wins. Parse into R: http://pastebin.com/CDzYXNbG
Data should be:
structure(list(Treatment = structure(c(2L, 2L, 1L, 1L), .Label = c("C",
"T"), class = "factor"), Gender = c("M", "F", "M", "F"), Response = c(56L,
58L, 6L, 63L)), .Names = c("Treatment", "Gender", "Response"), row.names = c(NA,
-4L), class = "data.frame")
Good luck!
Note: dummy data kindly provided by this question: Adding space between bars in ggplot2
You guys are making this way too hard:
eval(parse(file("http://pastebin.com/raw.php?i=CDzYXNbG")))
OK, so I cheated. But starting from the same URL you could get the same end:
eval(parse(file(paste("http://pastebin.com/raw.php?i=", strsplit("http://pastebin.com/CDzYXNbG", "/")[[1]][4], sep=""))))
Which still puts me in the lead :)
Same idea as kohske but slightly shorter and more clear I think
library(XML)
eval(parse(text=gsub('\r\n','\n',xpathApply(htmlTreeParse('http://pastebin.com/CDzYXNbG',useInternal=T),'//textarea',xmlValue))))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With