I wrote a script in R that should fuse two data.frames containing both string (stored as factors with levels) and integer columns into one data.frame and write it to a new row in a previously defined data.frame (after different for if statements)
new_frame <- data.frame(matrix(ncol=(ncol(X)+ncol(y)),nrow=0))
colnames(new_frame) <- c(colnames(X), colnames(Y))
new_frame[nrow(new_frame)+1,] <- data.frame(c(data.frame(X[j,]),data.frame(Y[i,])
Unfortunately the newly copied data do only show integer values, even for the string columns (I guess the factors are directly converted into integers), but I need the levels for the string columns.
Weirdly the script worked perfectly fine last week, and without changing anything to script or the data files but now directly converts everything to integer.
Any help would be highly appreciated! Thanks very much! best k
y
on the first line, and a missing parenthesis on your last line – Moody_Mudskipper