In this example, we have created a vector X and later changed all values of vector x>10 = 4.
> x <- c(17, 14, 4, 5, 13, 12, 10)
> x[x>10]
[1] 17 14 13 12
> x
[1] 17 14 4 5 13 12 10
> x[x>10]<-4
> x
[1] 4 4 4 5 4 4 10
Coal Geology and Mining: Consulting Services
Geological Consulting, Data Analysis: hydrogeology, geochemistry and mineral resources, contact:Ankan Basu, PG/CPG, Hyrogeologist/Geochemist
In this example, we have created a vector X and later changed all values of vector x>10 = 4.
> x <- c(17, 14, 4, 5, 13, 12, 10)
> x[x>10]
[1] 17 14 13 12
> x
[1] 17 14 4 5 13 12 10
> x[x>10]<-4
> x
[1] 4 4 4 5 4 4 10