Re: [R] about change columns for specific rows

2016-01-30 Thread ruipbarradas
Sorry, there's a mistake, there's a missing comma, it should be df[df$date >= '2012-01-01'& df$date <= '2013-12-31', ]$A Rui Barradas   Citando ruipbarra...@sapo.pt: > Hello, > > Try > > df[df$date >= '2012-01-01'& df$date <= '2013-12-31']$A = etc > > Hope this helps, > > Rui Barradas >   > > C

Re: [R] about change columns for specific rows

2016-01-30 Thread David Winsemius
> On Jan 29, 2016, at 10:30 PM, lily li wrote: > > Hi R users, > > I have a data frame, and I generate a date column like this: > df$date = seq(as.Date('2012-01-01'), as.Date('2014-12-31')) > > df > A B C > 1 2 1 > 2 2 3 > 3 2 4 > > So the data frame has 4 columns now. But when I w

Re: [R] about change columns for specific rows

2016-01-30 Thread ruipbarradas
Hello, Try df[df$date >= '2012-01-01'& df$date <= '2013-12-31']$A = etc Hope this helps, Rui Barradas   Citando lily li : > Hi R users, > > I have a data frame, and I generate a date column like this: > df$date = seq(as.Date('2012-01-01'), as.Date('2014-12-31')) > > df > A  B  C > 1  2   1 >

[R] about change columns for specific rows

2016-01-30 Thread lily li
Hi R users, I have a data frame, and I generate a date column like this: df$date = seq(as.Date('2012-01-01'), as.Date('2014-12-31')) df A B C 1 2 1 2 2 3 3 2 4 So the data frame has 4 columns now. But when I want to change the values of column A for specific dates, such as 2012-01-01