So I am going crazy about this issue because I already tried several different options to append the column to a dataframe. After doing so, the values change most of the times (but not all the times). The good thing is, that the data is downloaded from the web, so you can try yourself:
chain = "polkadot"
current_session = 117
first_session = 126
difference = current_session - first_session
x = c(current_session:(current_session - difference))
for(i in 1:length(x)) {
validators <- read.csv(url(paste("https://storage.googleapis.com/watcher-csv-exporter/", chain , "_validators_era_", x[i], ".csv", sep=(""))))
validators$era_points = ifelse(validators$era_points == "undefined",0,validators$era_points)
validators$era_points = as.numeric(validators$era_points)
if (i==1){
validators_overall = as.data.frame(validators$era_points)
colnames(validators_overall)[ncol(validators_overall)] <- paste0("new", i)
}
if (i>1){
new <- validators$era_points
validators_overall[ , ncol(validators_overall) + 1] <- new
colnames(validators_overall)[ncol(validators_overall)] <- paste0("new", i)
}
}
The individual values of the different data sets of validators$era_points are somewhere in 100x. But after the loop, they are completely different values. But some columns are correct. What is going on?
Thanks!