Hi, I'm really new to R so I aoplogise if this is a stupid question. I'm trying to import data from a .txt file into R using the read.table command, the headers for the data columns are already in the text file so I add Header = True after the file location. The problem is I keep getting the error message *unused argument(s) (Header = True)*, does anyone know why? The format of the text file is like this (I've also tried spaces rather than tab to seperate the columns): TRAP SHANNON_INDEX 1 3.347 2 3.096 3 3.521 4 2.871 5 2.678 The commond looks like this: Trap1_data<-read.table("C:/Documents and Settings/Samuel/Desktop/Biology/Independent study/Stats/Diversity indices/shannon index results trap 1.txt", Header = True) I would reall appreciate some help, Yours, Sam -- View this message in context: http://r.789695.n4.nabble.com/unused-argument-s-Header-True-help-tp3765651p3765651.html Sent from the R help mailing list archive at Nabble.com.
The proper command is "header = TRUE" capitalization is important for both *h*eader and T*RUE* Hope this helps, Michael Weylandt On Wed, Aug 24, 2011 at 11:10 AM, shardman <samuelhardman@hotmail.com>wrote:> Hi, > > I'm really new to R so I aoplogise if this is a stupid question. > > I'm trying to import data from a .txt file into R using the read.table > command, the headers for the data columns are already in the text file so I > add Header = True after the file location. The problem is I keep getting > the > error message *unused argument(s) (Header = True)*, does anyone know why? > > The format of the text file is like this (I've also tried spaces rather > than > tab to seperate the columns): > > TRAP SHANNON_INDEX > 1 3.347 > 2 3.096 > 3 3.521 > 4 2.871 > 5 2.678 > > The commond looks like this: > > Trap1_data<-read.table("C:/Documents and > Settings/Samuel/Desktop/Biology/Independent study/Stats/Diversity > indices/shannon index results trap 1.txt", Header = True) > > I would reall appreciate some help, > Yours, > Sam > > > -- > View this message in context: > http://r.789695.n4.nabble.com/unused-argument-s-Header-True-help-tp3765651p3765651.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
Hi Sam, It is "header", not "Header". See ?read.table. HTH, Jorge On Wed, Aug 24, 2011 at 11:10 AM, shardman < wrote:> Hi, > > I'm really new to R so I aoplogise if this is a stupid question. > > I'm trying to import data from a .txt file into R using the read.table > command, the headers for the data columns are already in the text file so I > add Header = True after the file location. The problem is I keep getting > the > error message *unused argument(s) (Header = True)*, does anyone know why? > > The format of the text file is like this (I've also tried spaces rather > than > tab to seperate the columns): > > TRAP SHANNON_INDEX > 1 3.347 > 2 3.096 > 3 3.521 > 4 2.871 > 5 2.678 > > The commond looks like this: > > Trap1_data<-read.table("C:/Documents and > Settings/Samuel/Desktop/Biology/Independent study/Stats/Diversity > indices/shannon index results trap 1.txt", Header = True) > > I would reall appreciate some help, > Yours, > Sam > > > -- > View this message in context: > http://r.789695.n4.nabble.com/unused-argument-s-Header-True-help-tp3765651p3765651.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] > On Behalf Of shardman > Sent: Wednesday, August 24, 2011 8:10 AM > To: r-help at r-project.org > Subject: [R] unused argument(s) (Header = True) help! > > Hi, > > I'm really new to R so I aoplogise if this is a stupid question. > > I'm trying to import data from a .txt file into R using the read.table > command, the headers for the data columns are already in the text file so > I > add Header = True after the file location. The problem is I keep getting > the > error message *unused argument(s) (Header = True)*, does anyone know why? > > The format of the text file is like this (I've also tried spaces rather > than > tab to seperate the columns): > > TRAP SHANNON_INDEX > 1 3.347 > 2 3.096 > 3 3.521 > 4 2.871 > 5 2.678 > > The commond looks like this: > > Trap1_data<-read.table("C:/Documents and > Settings/Samuel/Desktop/Biology/Independent study/Stats/Diversity > indices/shannon index results trap 1.txt", Header = True) >Sam, the unused parameter, Header = True, is the problem. The parameter name is header not Header (no caps). And, the value for true should be TRUE (ALL caps). Hope this is helpful, Dan Daniel Nordlund Bothell, WA USA
Thanks everyone, that's really helpful, Cheers, Sam -- View this message in context: http://r.789695.n4.nabble.com/unused-argument-s-Header-True-help-tp3765651p3767482.html Sent from the R help mailing list archive at Nabble.com.