Hi All,
I am making a serious effort to try to learn R, but one hurdle I am facing is
that I need to "see" the data as I walk through the examples in the
packages. For instance, many examples on the web start by a command like
data("wines"). How can I actually view what the dataset looks like
prior to transformations and analysis? I have tried to use edit() , print, and
head.
In short, I know that data() lists all of the available datasets,
data("wines") will load the dataset wines, but how can I look at the
raw data?
I figure this is probably an easy question, but any help you can provide will be
greatly appreciated.
Thanks,
Brock
Hi Brock, Have you tried View() ? Regards. On Fri, Nov 27, 2009 at 7:46 AM, Brock Tibert <btibert3@yahoo.com> wrote:> Hi All, > > I am making a serious effort to try to learn R, but one hurdle I am facing > is that I need to "see" the data as I walk through the examples in the > packages. For instance, many examples on the web start by a command like > data("wines"). How can I actually view what the dataset looks like prior to > transformations and analysis? I have tried to use edit() , print, and head. > > In short, I know that data() lists all of the available datasets, > data("wines") will load the dataset wines, but how can I look at the raw > data? > > I figure this is probably an easy question, but any help you can provide > will be greatly appreciated. > > Thanks, > > Brock > > ______________________________________________ > 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. >-- Ojal John Owino P.O Box 230-80108 Kilifi, Kenya. Mobile:+254 728 095 710 [[alternative HTML version deleted]]
Please check the following pdf file.
http://tw.nextmedia.com/applenews/article/art_id/32119622/IssueID/20091127
1. First install.packages("Flury")
2. library(Flury")
3. data("wines")
'wines? is a data frame with 26 observations, one factor denoting the
country of origin and 15
quantitative variables denoting 15 free monoterpenes and
C[13]-norisoprenoids. It is thought these
in?uence the wine?s aroma.
Country a factor with levels South Africa Germany Italy
Y1 a numeric vector
Y2 a numeric vector
Y3 a numeric vector
Y4 a numeric vector
Y5 a numeric vector
Y6 a numeric vector
Y7 a numeric vector
Y8 a numeric vector
Y9 a numeric vector
Y10 a numeric vector
Y11 a numeric vector
Y12 a numeric vector
Y13 a numeric vector
Y14 a numeric vector
Y15 a numeric vector
If you do not know how to get these value, you can read ``R
introduction''.
I hope this can help you.
Guo-Hao
Huang
--------------------------------------------------
From: "Brock Tibert" <btibert3 at yahoo.com>
Sent: Friday, November 27, 2009 12:46 PM
To: <r-help at r-project.org>
Subject: [R] Learning R - View datasets
Hi All,
I am making a serious effort to try to learn R, but one hurdle I am facing
is that I need to "see" the data as I walk through the examples in the
packages. For instance, many examples on the web start by a command like
data("wines"). How can I actually view what the dataset looks like
prior to
transformations and analysis? I have tried to use edit() , print, and head.
In short, I know that data() lists all of the available datasets,
data("wines") will load the dataset wines, but how can I look at the
raw
data?
I figure this is probably an easy question, but any help you can provide
will be greatly appreciated.
Thanks,
Brock
______________________________________________
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.
There are different ways to inspect the conent of a data frame. For example,>View(CO2)2009/11/27 Brock Tibert <btibert3 at yahoo.com>:> Hi All, > > I am making a serious effort to try to learn R, but one hurdle I am facing is that I need to "see" the data as I walk through the examples in the packages. ?For instance, many examples on the web start by a command like data("wines"). ?How can I actually view what the dataset looks like prior to transformations and analysis? ?I have tried to use edit() , print, and head. > > In short, I know that data() lists all of the available datasets, data("wines") will load the dataset wines, but how can I look at the raw data? > > I figure this is probably an easy question, but any help you can provide will be greatly appreciated. > > Thanks, > > Brock > > ______________________________________________ > 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. >-- Wincent Ronggui HUANG Doctoral Candidate Dept of Public and Social Administration City University of Hong Kong http://asrr.r-forge.r-project.org/rghuang.html
Brock Tibert wrote:> Hi All, > > I am making a serious effort to try to learn R, but one hurdle I am facing is that I need to "see" the data as I walk through the examples in the packages. For instance, many examples on the web start by a command like data("wines"). How can I actually view what the dataset looks like prior to transformations and analysis? I have tried to use edit() , print, and head. > > In short, I know that data() lists all of the available datasets, data("wines") will load the dataset wines, but how can I look at the raw data? > > I figure this is probably an easy question, but any help you can provide will be greatly appreciated. > > Thanks, > > Brock > > ______________________________________________ > 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. >Hi Brock, Take a look at the summary() function and the str() function. Also try and type the name of the dataset or use plot() on it. data(cars) summary(cars) str(cars) cars plot(cars) Have you read the Introduction to R [1]? cheers, Paul [1] http://cran.r-project.org/doc/manuals/R-intro.pdf -- Drs. Paul Hiemstra Department of Physical Geography Faculty of Geosciences University of Utrecht Heidelberglaan 2 P.O. Box 80.115 3508 TC Utrecht Phone: +3130 274 3113 Mon-Tue Phone: +3130 253 5773 Wed-Fri http://intamap.geo.uu.nl/~paul
Hello On Fri, Nov 27, 2009 at 4:46 AM, Brock Tibert <btibert3 at yahoo.com> wrote:> In short, I know that data() lists all of the available datasets, data("wines") will load the dataset wines, but how can I look at the raw data? >See this [1]. [1] http://www.mail-archive.com/r-help at r-project.org/msg66111.html Liviu
Try this: # each of these three show entire data set wines dput(wines) View(wines) # get help ?wines # various info on data set head(wines) tail(wines) summary(wines) str(wines) class(wines) dim(wines) # plotting plot(wines) # for a better plot see the example at the bottom of ?wines On Thu, Nov 26, 2009 at 11:46 PM, Brock Tibert <btibert3 at yahoo.com> wrote:> Hi All, > > I am making a serious effort to try to learn R, but one hurdle I am facing is that I need to "see" the data as I walk through the examples in the packages. ?For instance, many examples on the web start by a command like data("wines"). ?How can I actually view what the dataset looks like prior to transformations and analysis? ?I have tried to use edit() , print, and head. > > In short, I know that data() lists all of the available datasets, data("wines") will load the dataset wines, but how can I look at the raw data? > > I figure this is probably an easy question, but any help you can provide will be greatly appreciated. > > Thanks, > > Brock > > ______________________________________________ > 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. >