Skip to content
Prev 9693 / 398498 Next

Setting elements in data frame

Hello,

what about converting the data.frame to a matrix?

x <- data.matrix(x)
x[x==6] <- 6000
x <- as.data.frame(x)
x
  S1   N1   N2
1  2    2 6000
2  3    4   NA
3  4 6000    0
4  1    9 6000

best,

jan
On Thu, 22 Feb 2001, Christian Hoffmann wrote:

            

  
    
Message-ID: <20010222144653.A1694@diw14093.diw.de>
In-Reply-To: <3.0.6.32.20010222121111.00942100@mail.wsl.ch>; from christian.hoffmann@wsl.ch on Thu, Feb 22, 2001 at 12:11:11 +0100