all I am trying to add scaled raw soil data element based on IQR, could you please help, how I can add this new scaled variable to original dataset, could you confirm the below if it is correct?
> ph1 <- read.table("clean.raw.elements.txt", header=T, sep="\t")
> head(ph1)
ID X.x Score.x Match_type.x Mo
1 N10 132 94.23 A 0.96500
2 N12 1014 94.34 A 0.45000
3 N13 1029 95.41 A 0.42750
4 N14 1030 94.72 A 0.67333
5 N16 1599 94.29 A 0.46500
6 N17 1602 93.85 A 0.32500
> data <- ph1[,5]
> head(data)
[1] 0.96500 0.45000 0.42750 0.67333 0.46500 0.32500
> length(data)
[1] 1765
> quartiles <- quantile(data, probs=c(.25, .75), na.rm = FALSE)
> IQR <- IQR(data)
> ph1$MoScaled <- ph1$Mo/IQR
mean_Mo_1200mvariable inph1data frame. If that'sMothenMo/IQR– Grzegorz Sapijaszko Mar 05 '24 at 17:31