I am having trouble converting a large text string to a dataframe. I\'ve been unable to figure this simple task out yet. Hoping for your help.
x <- \"1 ap
Try this:
r <- unlist(strsplit(x, " ")) data.frame(id=as.numeric(r[c(TRUE,FALSE)]), name=r[c(FALSE,TRUE)]) # id name #1 1 apple #2 200 blueberry #3 3000 pear #4 4400 raspberry