Extracting the last n characters from a string in R

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

Related Questions In Data Analytics

0 votes
0 answers

Extracting the last n characters from a string in R

The final n characters of a string ...READ MORE

Jun 27, 2022 in Data Analytics by avinash
• 1,840 points
569 views
0 votes
1 answer

How to access the last value from a vector in R?

Hi@akhtar, You can use the tail function in ...READ MORE

answered Oct 30, 2020 in Data Analytics by MD
• 95,460 points
1,488 views
0 votes
1 answer

substring of last N characters in R

Use below code -  If the elements within ...READ MORE

answered Jul 4, 2019 in Data Analytics by anonymous
• 33,030 points
688 views
0 votes
0 answers

Split a string and store it in multiple columns from a field in R

How to Split a string and store ...READ MORE

Jun 29, 2019 in Data Analytics by Anand
889 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Big Data transformations with R

Dear Koushik, Hope you are doing great. You can ...READ MORE

answered Dec 18, 2017 in Data Analytics by Sudhir
• 1,570 points
1,049 views
0 votes
2 answers

Transforming a key/value string into distinct rows in R

We would start off by loading the ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,660 points
1,227 views
0 votes
1 answer

Finding frequency of observations in R

You can use the "dplyr" package to ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,660 points
5,912 views
0 votes
1 answer

Left Join and Right Join using "dplyr"

The below is the code to perform ...READ MORE

answered Mar 27, 2018 in Data Analytics by Bharani
• 4,660 points
1,158 views
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