How to select rows in a range from dataframe?

0 votes
How to select rows in a range from dataframe?
Aug 29 in Data Analytics by ratna
12 views

1 answer to this question.

0 votes

Hi,

There are different functions to select or extract rows from the data frame using dplyr functions.

1. Filter( )

filter(condition1, . . .)

2. Sample_frac( ) - returns fraction part from the dataframe.

sample_frac(table,fraction,replace = TRUE)

3. sample_n( ) - returns n rows from dataframe.

sample_n(table,n,replace = TRUE)

4. slice( ) - select range of rows using position.

slicer(tbl,m:n)

5. top_n( ) -  returns top n rows.

top_n(tbl,n)
answered Aug 30 by anonymous
• 26,020 points

Related Questions In Data Analytics

0 votes
7 answers
0 votes
1 answer

How to sample n random rows per group in a dataframe?

You can assign a random ID to ...READ MORE

answered Jul 2, 2018 in Data Analytics by darklord
• 6,140 points
195 views
0 votes
2 answers
0 votes
1 answer
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
98 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
118 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
76 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
70 views
0 votes
2 answers

How to remove rows with missing values (NAs) in a data frame?

Hi, The below code returns rows without ...READ MORE

answered Aug 20 in Data Analytics by anonymous
• 26,020 points
4,547 views
0 votes
4 answers

How to remove NA values from a Vector in R?

You can try na.omit() or na.exclude() too. ...READ MORE

answered Jul 31 in Data Analytics by anonymous
• 26,020 points
6,262 views