[R] Dataframe with unequal rows

David Winsemius dwinsemius at comcast.net
Thu Jan 8 14:59:32 CET 2009


I doubt that you have a dataframe with those features, since R would  
not allow such an event; more likely you have data in a file. If your  
goal is to determine the number of items, then you should definitely  
look at:

?count.fields

count.fields(filename, sep=",")  # would give you 1 + the number  
commas in each line of the file

-- 
David Winsemius

On Jan 8, 2009, at 4:38 AM, <Rahul-A.Agarwal at ubs.com> <Rahul-A.Agarwal at ubs.com 
 > wrote:

> I have a data frame with unequal rows length separated by comma.....I
> have to read the data first and then calculate number of comma in each
> row...how can I do that
>
> Regards Rahul
>
> ______________________________________________
> 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.




More information about the R-help mailing list