For a data frame df, you can get df.new as:
df.new = df[seq(1, nrow(df), 5), ]
This creates an index from row 1 to nrow (number of rows of the table) every 5 rows. You can play with the starting point and the 5 to extract other sequences.
More Related Contents:
- Count number of rows within each group
- Drop unused factor levels in a subsetted data frame
- Why is it not advisable to use attach() in R, and what should I use instead?
- Create an empty data.frame
- Create a group number for each consecutive sequence
- Subset data frame based on multiple conditions [duplicate]
- R – Concatenate two dataframes?
- Remove columns with zero values from a dataframe
- How to convert dataframe into time series?
- Identifying duplicate columns in a dataframe
- Merge unequal dataframes and replace missing rows with 0
- R pass variable column indices to ggplot2 [duplicate]
- Same function over multiple data frames in R
- Add extra level to factors in dataframe
- Dataframe create new column based on other columns
- What is about the first column in R’s dataset mtcars?
- Last Observation Carried Forward In a data frame? [duplicate]
- Determine the data types of a data frame’s columns
- finding close match from data frame 1 in data fame 2
- Combine several data frames in the global environment by row (rbind)
- Changing Million/Billion abbreviations into actual numbers? ie. 5.12M -> 5,120,000 [duplicate]
- Extract text after “/” in a data frame column
- use multiple columns as variables with sapply
- Deleting specific rows from a data frame
- Reshape a dataframe to long format with multiple sets of measure columns [duplicate]
- Count number of non-NA values for every column in a dataframe [duplicate]
- Undefined columns selected when subsetting data frame
- Difference between `names(df[1])
- How to create a new variable in a data.frame based on a condition?
- Interpolating timeseries