How to select rows in a range from dataframe?

0 votes
How to select rows in a range from dataframe?
Aug 29, 2019 in Data Analytics by ratna
34 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, 2019 by anonymous
• 32,420 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 Sahiti
• 6,290 points
650 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,720 points
146 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,720 points
211 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,720 points
96 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,720 points
125 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, 2019 in Data Analytics by anonymous
• 32,420 points
6,744 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, 2019 in Data Analytics by anonymous
• 32,420 points
11,309 views