I have been using the following code to convert decimals into binaries, however I cannot seem to convert a decimal greater than 1069 into binary.
run_id = 1:1600
run_ids = as.data.frame(run_id)
run_ids$bin = 0
for (i in 1:length(x)){
run_ids[i,2] = as.numeric(paste(rev(as.numeric(intToBits(as.numeric(run_ids[i,1])))), collapse=""))
}
Unfortunately the range of numbers that I want to convert goes up to 1,600. I have tried to use as.double, as.numeric to fix the issue however these do not work.
What am I missing?
Thanks in advance for any help you can give me.