[R] Data Manipulation

Joshua Wiley jwiley.psych at gmail.com
Fri Sep 10 18:04:37 CEST 2010


Hi,

Look at the table() function.  Here is an example with your data:


dat <- read.table(textConnection("
Study
A
A
B
B
B
A
C
C
D"), header = TRUE)
closeAllConnections()

table(dat)


Hope that helps,

Josh

On Fri, Sep 10, 2010 at 8:53 AM, dfong <dfong at medicine.umaryland.edu> wrote:
>
> Hi,
>
> I just started using R and need some guidance.
>
> I need to create a time series chart in R, but the problem is the data is
> not numeric.
> The data is in the following format
>
> Study
> A
> A
> B
> B
> B
> A
> C
> C
> D
>
> Then there is also another column with dates. How can I manipulate this in
> order to have something that will count the number of unique entries and
> group them.
> Say A = 3 B= 3 C=2 D=1
>
> Thanks
> --
> View this message in context: http://r.789695.n4.nabble.com/Data-Manipulation-tp2534662p2534662.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.
>



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/



More information about the R-help mailing list