# Creating an empty dataframe
result_df <- data.frame()
# Iterating over the numbers 1 to 3
for (i in 1:3) {
# Create a new column and populate it with values of i
result_df[, paste0("Column", i)] <- i
}
我希望有以下填充的数据帧:
Column1 Column2 Column3
1 1 2 3