Re: [R] variable (column) in a data frame

2012-07-17 Thread Bert Gunter
ar notation to issue an error when referring to a non-existent > variable inside the data frame? > > Thank you very much. > > Paulo Barata > > - > > > ------ Original Message --- > From: "Frans Marcelissen" > To: &qu

Re: [R] variable (column) in a data frame

2012-07-17 Thread Sarah Goslee
Hi, On Tue, Jul 17, 2012 at 10:40 AM, Paulo Barata wrote: > > Dear Frans and Peter, > > Yes, the notation df[,'var'] is able to catch a non-existent > variable var inside a data frame df. But the notation df$var > isn't. > > So we have this situation, where two different notations, which > (as fa

Re: [R] variable (column) in a data frame

2012-07-17 Thread Paulo Barata
--- -- Original Message --- From: "Frans Marcelissen" To: "'Paulo Barata'" , Sent: Mon, 16 Jul 2012 14:25:21 +0200 Subject: RE: [R] variable (column) in a data frame > Hoi Pauli, > There is a difference between two ways of accessing co

Re: [R] variable (column) in a data frame

2012-07-16 Thread Frans Marcelissen
-- Frans -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens Paulo Barata Verzonden: zondag 15 juli 2012 16:31 Aan: r-help@r-project.org Onderwerp: [R] variable (column) in a data frame To the R help list, When using a data fram

Re: [R] variable (column) in a data frame

2012-07-15 Thread Peter Ehlers
iginal Message --- From: Peter Ehlers To: Paulo Barata Cc: "r-help@r-project.org", peter dalgaard Sent: Sun, 15 Jul 2012 09:29:11 -0700 Subject: Re: [R] variable (column) in a data frame On 2012-07-15 08:41, Paulo Barata wrote: Dr. Dalgaard, Thank you. But pre-checking with

Re: [R] variable (column) in a data frame

2012-07-15 Thread arun
,!df$a==4) [1] FALSE A.K. - Original Message - From: Paulo Barata To: r-help@r-project.org Cc: Sent: Sunday, July 15, 2012 10:30 AM Subject: [R] variable (column) in a data frame To the R help list, When using a data frame, there is no warning or error message when I refer to a

Re: [R] variable (column) in a data frame

2012-07-15 Thread Berend Hasselman
Paulo Barata-3 wrote > > Dr. Dalgaard, > > Thank you. You are right, with() is able to catch > spelling errors in the name of variables inside a data frame. > > But couldn't some error or warning be included in R when referring > to a non-existent variable inside a data frame with the df$var >

Re: [R] variable (column) in a data frame

2012-07-15 Thread Paulo Barata
nt: Sun, 15 Jul 2012 18:14:22 +0200 Subject: Re: [R] variable (column) in a data frame > On Jul 15, 2012, at 17:41 , Paulo Barata wrote: > > > > > Dr. Dalgaard, > > > > Thank you. But pre-checking with is.null() or using with() > > doesn't solve the pr

Re: [R] variable (column) in a data frame

2012-07-15 Thread Peter Ehlers
ank you once again. Paulo Barata - -- Original Message --- From: peter dalgaard To: "Paulo Barata" Sent: Sun, 15 Jul 2012 16:47:35 +0200 Subject: Re: [R] variable (column) in a data frame On Jul 15, 2012, at 16:30 , Paulo Barata wrote: To the R help

Re: [R] variable (column) in a data frame

2012-07-15 Thread peter dalgaard
On Jul 15, 2012, at 17:41 , Paulo Barata wrote: > > Dr. Dalgaard, > > Thank you. But pre-checking with is.null() or using with() > doesn't solve the problem of catching spelling mistakes > in the name of a variable inside a data frame, when using > the df$var notation often in a program. > >

Re: [R] variable (column) in a data frame

2012-07-15 Thread Paulo Barata
o Barata - -- Original Message --- From: peter dalgaard To: "Paulo Barata" Sent: Sun, 15 Jul 2012 16:47:35 +0200 Subject: Re: [R] variable (column) in a data frame > On Jul 15, 2012, at 16:30 , Paulo Barata wrote: > > > > > To the R help li

Re: [R] variable (column) in a data frame

2012-07-15 Thread John Kane
From: paulo.bar...@ensp.fiocruz.br > Sent: Sun, 15 Jul 2012 11:30:37 -0300 > To: r-help@r-project.org > Subject: [R] variable (column) in a data frame > > > To the R help list, > > When using a data frame, there is no warning or error message > when I refer to a non-existent va

[R] variable (column) in a data frame

2012-07-15 Thread Paulo Barata
To the R help list, When using a data frame, there is no warning or error message when I refer to a non-existent variable inside the data frame. Example: ##-- a <- c(1,2,3) b <- c(11,22,33) df <- data.frame(a,b) df ## correct: there is a column in