s
Petr
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Alaios
> via R-help
> Sent: Wednesday, October 21, 2015 3:35 PM
> To: R-help Mailing List
> Subject: [R] threshold and replace values in a matrix
>
> Dear all I have a tabl
aios
> via R-help
> Sent: Wednesday, October 21, 2015 3:35 PM
> To: R-help Mailing List
> Subject: [R] threshold and replace values in a matrix
>
> Dear all I have a table as that.
> test<-matrix(data=rnorm(100),ncol=10)
> and I want to find the values that are below my thres
Dear all I have a table as that.
test<-matrix(data=rnorm(100),ncol=10)
and I want to find the values that are below my thresholdthreshold<- -0.5and
replace them with a -1 instead.
I can of course write a double nested for loop to check one by one elementif
(test[i,j]<= threshold) test[i,j]<- -
3 matches
Mail list logo