Besides the video, you may want to have a look at the related articles of my website. Please find a selection of related articles about topics such as dplyr, numeric values, groups, and missing data below:. In summary: In this tutorial you learned how to return the amount of unique values by category and group in the R programming language. If you have any further questions, let me know in the comments. Your email address will not be published. Post Comment. On this website, I provide statistics tutorials as well as code in Python and R programming.
The article contains these topics: 1 Creation of Example Data. Sample vector. Sample dataframe. Sample matrix. Recommended Articles. Article Contributed By :. Easy Normal Medium Hard Expert. Writing code in comment? Please use ide. Load Comments. I know there are many other answers, but here is another way to do it using the sort and rle functions. The function rle stands for Run Length Encoding. It can be used for counts of runs of numbers see the R man docs on rle , but can also be applied here.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Count number of occurences for each unique value Ask Question. Asked 10 years, 11 months ago. Active 1 year, 1 month ago. Viewed k times. Improve this question. Henrik Add a comment. Active Oldest Votes. Perhaps table is what you are after? Improve this answer. Gregor Thomas k 16 16 gold badges silver badges bronze badges.
Chase Chase Ah, yes, I can use this, with some slight modification: t as. I used to do this awkwardly with hist. I wonder why.
0コメント