I am using R and trying to substitute the numbers in the 'owners' columns to its average, and somehow it is keep showing numbers I did not input.
when my code is
name <-
data.frame(orig = c("50000000-100000000", "1000000-2000000", "5000000-10000000", "2000000-5000000",
"500000-1000000", "200000-500000", "100000-200000", "50000-100000", "20000-50000",
"0-20000", "10000000-20000000", "100000000-200000000", "20000000-50000000"),
average = c("75000000", "1500000", "7500000", "3500000", "750000", "350000", "150000",
"75000", "35000", "10000", "15000000", "150000000", "35000000"))
for (i in 1:NROW(name)){steam2$owners <- sub(name[i,1], name[i,2], steam2$owners)}
The "10000000-20000000" is supposed to be "15000000" but it is showing "100000010000000" for some strange unknown reasons. Can someone help me to fix this issue?
I am using this way to show the picture as I cannot embed images yet.