Summarize with a condition

0 votes
My requiremnt is to summarize fields that will pass a condition. How to summarize with if condition?
Aug 6 in Data Analytics by riya
8 views

1 answer to this question.

0 votes

You can provide condition to summarize using summarize_if() function.

Syntax of summarizze_if function is as below.

summarize_if(condition, function)

ex: 

summarise_if(is.numeric, sum, na.rm=TRUE)
answered Aug 7 by anonymous
• 19,550 points

Related Questions In Data Analytics

+1 vote
2 answers

Custom Function to replace missing values in a vector with the mean of values

Try this. lapply(a,function(x){ifelse(is.na(x),mean(a,na.rm = TRUE) ...READ MORE

answered 5 days ago in Data Analytics by anonymous
63 views
0 votes
1 answer

With the help of tidyverse: how to rename a column to a variable name

With the help of Dplyr: rename function ...READ MORE

answered Apr 3, 2018 in Data Analytics by DeepCoder786
• 1,700 points

edited Apr 3, 2018 by DeepCoder786 35 views
0 votes
1 answer

How to convert a list of vectors with various length into a Data.Frame?

We can easily use this command as.data.frame(lapply(d1, "length< ...READ MORE

answered Apr 4, 2018 in Data Analytics by DeepCoder786
• 1,700 points
59 views
0 votes
1 answer

Selecting a sublist with purrr

Yes, purrr does provide a package called ...READ MORE

answered Apr 4, 2018 in Data Analytics by Bharani
• 4,550 points
28 views
0 votes
1 answer

By using dpylr package sum of multiple columns

Basically here we are making an equation ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,700 points
79 views
0 votes
1 answer

How to convert a text mining termDocumentMatrix into excel or csv in R?

By assuming that all the values are ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,700 points
95 views
0 votes
1 answer

In a dpylr pipline how to use sample and seq?

For avoiding rowwise(), I prefer to use ...READ MORE

answered Apr 6, 2018 in Data Analytics by DeepCoder786
• 1,700 points
71 views
0 votes
1 answer

How to create a list of Data frames?

Basically all we have to do is ...READ MORE

answered Apr 9, 2018 in Data Analytics by DeepCoder786
• 1,700 points
53 views
0 votes
1 answer

How to filter only those rows with a condition in R?

Write R code as below temp = data ...READ MORE

answered Jul 15 in Data Analytics by anonymous
• 19,550 points
17 views
0 votes
1 answer

How to add create a box plot with categorical columns?

One way is to convert to factor ...READ MORE

answered Jul 4 in Data Analytics by anonymous
• 19,550 points
30 views