The following should work:
new_index <- 740:1027
for (i in 1:76) {
temp <- get(paste0('dataset_id_',i))
rownames(temp) <- new_index
assign(paste0('dataset_id_',i),temp)
}
You can get the name of each dataset through paste0('data_set_id_',i)
, and then the get
command allows you to access the actual dataframe from character name of the dataset. This object has its rownames modified, then the assign
command re-assigns this new object to the original name.
However, there may be a more natural way to carry out the operation you want at the stage where you create each of these dataframes from the larger one.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…