Re: [R] Parsing Complex Text in Single Cell

2014-01-30 Thread arun
Another way would be: library(qdap) library(stringr) x <- scan(what="character",)  x1 <- c(x,x) x1 <- paste(x1,collapse=" ")  x2 <- gsub('"',"",bracketXtract(x1,"curly"))  res2 <- as.data.frame(str_trim(do.call(rbind,genXtract(paste0(x2,","),":",","))),stringsAsFactors=FALSE) res2[,1:3] <-

Re: [R] Parsing Complex Text in Single Cell

2014-01-30 Thread Rui Barradas
Hello, Maybe something like the following. x <- scan(what = "character", text = ' {"trial":1,"corr":1,"resp_dur":799,"stim":"â†*�*â†*�*â†*�*â†*�*â†*�*","cond ":"congruent"},{"trial":2,"corr":1,"resp_dur":0,"stim":"xx→xx","cond":" nogo"},{"trial":3,"corr":0,"resp_dur

[R] Parsing Complex Text in Single Cell

2014-01-29 Thread Patzelt, Edward
R Experts - We have a complex problem whereby Qualtrics exported our data into a single cell as seen below. We attempted to parse it using scan() without much success. Hoping to get a little nudge here. I've posted the full data set here: https://www.dropbox.com/s/e246uiui6jrux6c/CoopandSelfContr