Watts-College / cpp-527-fall-2021

A course shell for CPP 527 Foundations of Data Science II
https://watts-college.github.io/cpp-527-fall-2021/
2 stars 6 forks source link

Final Project: Step 3 - Counting Number of names #70

Open aawoods97 opened 2 years ago

aawoods97 commented 2 years ago

Hello! I am looking to create a table that shows the unique first names (similar to the one created in Lab 3 to find the top 25 most common words). I am able to output the column with all the first names. However, when I attempt to use a similar code to lab 3, I am receiving an entirely different output, pictured below. Is there a step I am missing?

Code for unique first names d$first.name %>% sort() %>% head( 25 ) %>% pander()

Screen Shot 2021-10-05 at 5 39 43 PM
lecy commented 2 years ago

It might be correct, you just have a lot of Aarons in the dataset.

Try:

d$first.name %>% head( 25 ) %>% pander()
d$first.name %>% unique() %>% head( 25 )
table( d$first.name ) %>% sort() 
aawoods97 commented 2 years ago

It worked! Thank you for your help!