paste command creates alphanumeric data. How can I then use it?

Without a a reprex. See the FAQ, I have to guess.

df3 <- mtcars[1:11]
df3[1,1] <- 10000
colnames(df3) <- paste0("x",1:11)
normalizeZ <- function(x) (x - min(x))/(max(x)-min(x))

for(i in 1:11){
   v = paste0("x",i,sep="")
   newdata = subset(df3, abs(normalizeZ(df3[[v]])) >= 1)
   cat("There are", nrow(newdata),"potential", v,"outliers >= |1| in df3" ,"\n")
}
#> There are 1 potential x1 outliers >= |1| in df3 
#> There are 14 potential x2 outliers >= |1| in df3 
#> There are 1 potential x3 outliers >= |1| in df3 
#> There are 1 potential x4 outliers >= |1| in df3 
#> There are 1 potential x5 outliers >= |1| in df3 
#> There are 1 potential x6 outliers >= |1| in df3 
#> There are 1 potential x7 outliers >= |1| in df3 
#> There are 14 potential x8 outliers >= |1| in df3 
#> There are 13 potential x9 outliers >= |1| in df3 
#> There are 5 potential x10 outliers >= |1| in df3 
#> There are 1 potential x11 outliers >= |1| in df3

Created on 2023-03-10 with reprex v2.0.2

1 Like