?read.table
Using my normal file path and th data as you supplied it.
x <- read.csv("/home/john/rdata/ages.csv", sep = " ", header = TRUE)
Change the file path to whatever yours is.
Example might be
x <- read.csv("C:/mydata/ages.csv", sep = " ", header = TRUE)
in Windows.
Note that you c
type ?read.table in R
-
Yasir Kaheil
--
View this message in context:
http://r.789695.n4.nabble.com/Entering-Data-Files-tp4636943p4636959.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://st
p;M University
College Station, TX 77843-4352
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of Rui Barradas
> Sent: Wednesday, July 18, 2012 4:24 PM
> To: darnold
> Cc: r-help@r-project.org
> Subject: Re: [R] En
For reading data into R you should start with
http://cran.r-project.org/doc/manuals/R-data.html (or the local copy
that was installed with R on your machine).
For the example above the read.table function should be fine. If you
want to change the shape of the resulting data frame then look at the
Hello,
Sorry, I forgot the barplot.
dmelt <- melt(d, id.vars=c("Live", "Age"), measure.vars="Count")
wide <- dcast(Live ~ Age, data = dmelt)
col <- rainbow(4)
barplot(as.matrix(wide[, 2:5]), beside=T, col=col)
legend("topleft", wide[, 1], fill=col)
Hope this helps,
Rui Barradas
Em 18-07-20
Hello,
Install package 'reshape2' and try the following.
#install.packages('reshape2')
library(reshape2)
d <- read.table(text="
LiveAgeCount
ParentsAge19324
AnotherAge1937
OwnPlaceAge19116
GroupAge1958
OtherAge195
ParentsAge20378
Another
6 matches
Mail list logo