On May 3, 2016, at 4:13 PM, Yasir Suhail <yasir.suhail at gmail.com> wrote:
Dear R developers and users,
Consider the object :
a <- data.frame(a=c(1,2), b=c(2,3), c=c("a,b","c,d"), stringsAsFactors
a$c <- strsplit(a$c, ",")
You are the one who should "consider the object". Look at what
strsplit(a$c, ",") returns and then perhaps re-consider trying to assign it
to a single column.
Re-assignment works fine for columns 1 and 2, but fails for column 3. If
is a valid object, the assignment should work.
a[,1] <- a[,1]
a[,2] <- a[,2]
a[,3] <- a[,3]
Warning message:
In `[<-.data.frame`(`*tmp*`, , 3, value = list(c("a", "b"), c("c", :
provided 2 variables to replace 1 variables
[[alternative HTML version deleted]]
And please reconsider also the format of your postings.