Results are different in Version 3.6 & 4.1.
My R(3.6) code in the ubuntu server(18) is running well but the same code in ubuntu 20 R(4.1) is working very badly. look at this capture Issue with R Version
The purpose of this code is to normalize the column by dividing the sum.
Thank you all in advance.
Please don't post code as an image. It is also advised to post a reproducible example.
In any case, in your example on R 3.6,
all_binsis afactor. However, in your R 4.1 example,all_binsis acharactervector.This is because of the change in R 4.0.0.:
In order to reproduce the server behaviour on your local machine, when you read in bins in your local version of R, you need to add the argument
stringsAsFactors = TRUE, e.g.:This should solve this particular issue. However, you may run into other differences between R 3.6 and R 4.1 on different machines. I would recommend running the same version of R and packages on both machines, perhaps using
renv, if you want to ensure the output is the same.