Hema,

This may work:
aggregate(hema[1],hema[2],function(x)length(unique(x))) to calculate how
many different websites each id visited. hema[1] is the website column,
hema[2] is user_id. You can always add more index columns like days to
aggregate().

Jun

On Thu, Apr 2, 2009 at 11:06 PM, Hemavathi Ramulu <hema.ram...@gmail.com>wrote:

> hi,
> Previously my email very simple and less information. Let say I have raw
> data as below:-
>
> user_id  website          time
> 20        google            0930
> 21        yahoo            0935
> 20        facebook        1000
> 25        facebook        1015
> 61        google            0940
> 60        yahoo            1050
> 40        friendster        1115
> 61        google            1200
> 40        friendster        1215
> 25        google            1030
> 28        youtube          0830
> 30        facebook        0945
>
> This data described about particular website viewed by particular ID  in
> one
> day.
>
> My problem is how to sort the data? So that, I can get information about
> one
> user_id viewed how many website perday?
>
> secondly, I want to plotted above data where x-axis (user_id) and
> y-axis(website).
>
> Actually, im new to R-project and still in learning process. So, I really
> want you all help.
> Thank you and I really appreciate everyone feedback.
>
> regards,
> Hema.
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>



-- 
Jun Shen PhD
PK/PD Scientist
BioPharma Services
Millipore Corporation
15 Research Park Dr.
St Charles, MO 63304
Direct: 636-720-1589

        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to