Why nrow function doesn t seem to work within summarise function

0 votes
See the code below:

library(dslabs)

data(gapminder)

differenceminder percent > percent

filter(year% in% c(2010, 2015) &!is.na(population))%%%%%%%%%%%%%%%%%%%%%%%%%%%%

percent > group by(year) percent

weight = nrow(population) in the summary

I keep getting the message, "Column weight is of unsupported type NULL," why?

Population is a vector inside the summarise() function, and nrow() accepts a vector as a parameter. I therefore wonder why it doesn't.

Note: I am not searching for workable substitutes for nrow() because I am aware of its alternatives in this situation. My query is philosophical and is focused on the word "Why."
Jul 5, 2022 in Data Analytics by avinash
• 1,840 points

edited Mar 4 19 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP