I have created an empty data frame called "New_dataframe" and I want to fill the empty values from my other dataframe where all the values are in 1 single column.
The new data frame that is empty have 10 columns and a length of 1:n. I want to fill 10 and 10 values one in each column horizontally from the old data in the singel column. How can I do that? See the code I have done below
This is the old data frame where I have the reaction data column which I want to transfer to the new data column with a for loop.
Orginal data frame used in the for loop
This is the shape of the new data frame I created which I want to use the for loop to fill the X variabels:
The data frame I want to fill format
n <- length(sort(unique(data$Subject)
for(i in (1:n)) {
for(j in (0:9)) {
New_dataframe[i,j+2] <- **ANYTHING I CAN WRITE HERE TO GET THIS TO WORK?**
}
}