发挥您的RCurl/XML的力量。最短的代码获胜。解析为R:http://pastebin.com/CDzYXNbG
数据应为:
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")
祝你好运!
注意:此问题所提供的伪数据:Adding space between bars in ggplot2
最佳答案
与kohske的想法相同,但我认为它更短,更清晰
library(XML)
eval(parse(text=gsub('\r\n','\n',xpathApply(htmlTreeParse('http://pastebin.com/CDzYXNbG',useInternal=T),'//textarea',xmlValue))))
关于r - RCurl或XML挑战: Read Pastebin into R,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6086535/