ivanc010
2013-Sep-19 22:59 UTC
[R] Need help to find out the name of my columns and rows in a data file
I've been assigned homework to analyze a file. The R package is "car". The specific data file is "Florida." So, I did the usual stuff: library(car) data(Florida) summary(Florida) My specific assignment is to run a t-test between GORE and BUSH. (This file has information on the 2000 election.) To run my t-test, my code must be something analogues to: t.test(case0102$Salary[case0102$Sex=="Female"],case0102$Salary[case0102$Sex=="Male"]) Unfortunately, for my Florida data I can't find the analogues titles of the rows and columns (i.e. Sex and Salary). Please help. -- View this message in context: http://r.789695.n4.nabble.com/Need-help-to-find-out-the-name-of-my-columns-and-rows-in-a-data-file-tp4676534.html Sent from the R help mailing list archive at Nabble.com.
David Winsemius
2013-Sep-20 04:38 UTC
[R] Need help to find out the name of my columns and rows in a data file
On Sep 19, 2013, at 3:59 PM, ivanc010 wrote:> I've been assigned homework to analyze a file. The R package is "car". The > specific data file is "Florida." > > So, I did the usual stuff: > library(car) > data(Florida) > summary(Florida) > > My specific assignment is to run a t-test between GORE and BUSH. (This file > has information on the 2000 election.) > > To run my t-test, my code must be something analogues to: > > t.test(case0102$Salary[case0102$Sex=="Female"],case0102$Salary[case0102$Sex=="Male"]) > > Unfortunately, for my Florida data I can't find the analogues titles of the > rows and columns (i.e. Sex and Salary).Please read the Posting Guide. Many of the participants in R-Help are academics and they are asking _their_ students not to post howmework questions here. The Posting Guide lays out the reasoning. Please read it, ... and don't expect replies.> -- > View this message in context: http://r.789695.n4.nabble.com/Need-help-to-find-out-the-name-of-my-columns-and-rows-in-a-data-file-tp4676534.html > Sent from the R help mailing list archive at Nabble.com. >Nabble is NOT the archive for R-help. -- David Winsemius Alameda, CA, USA
Clint Bowman
2013-Sep-20 14:24 UTC
[R] Need help to find out the name of my columns and rows in a data file
You are close--think "names", not "titles", as in rownames
or colnames (no
reason to completely spell out column). Summary already gave you the
column names, so type "?rownames" to learn more.
Clint Bowman INTERNET: clint at ecy.wa.gov
Air Quality Modeler INTERNET: clint at math.utah.edu
Department of Ecology VOICE: (360) 407-6815
PO Box 47600 FAX: (360) 407-7534
Olympia, WA 98504-7600
USPS: PO Box 47600, Olympia, WA 98504-7600
Parcels: 300 Desmond Drive, Lacey, WA 98503-1274
On Thu, 19 Sep 2013, ivanc010 wrote:
> I've been assigned homework to analyze a file. The R package is
"car". The
> specific data file is "Florida."
>
> So, I did the usual stuff:
> library(car)
> data(Florida)
> summary(Florida)
>
> My specific assignment is to run a t-test between GORE and BUSH. (This file
> has information on the 2000 election.)
>
> To run my t-test, my code must be something analogues to:
>
>
t.test(case0102$Salary[case0102$Sex=="Female"],case0102$Salary[case0102$Sex=="Male"])
>
> Unfortunately, for my Florida data I can't find the analogues titles of
the
> rows and columns (i.e. Sex and Salary).
>
> Please help.
>
>
>
> --
> View this message in context:
http://r.789695.n4.nabble.com/Need-help-to-find-out-the-name-of-my-columns-and-rows-in-a-data-file-tp4676534.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at 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.
>