Simple subsetting will do it –
MyData[which(MyData[,2]>40),]
as @DavidArenburg points out, this works fine:
MyData[(MyData[,2]>40),]
More Related Contents:
- Repeat each row of data.frame the number of times specified in a column
- How to sort a character vector where elements contain letters and numbers in R?
- Filter rows which contain a certain string
- Apply function conditionally
- Gantt charts with R
- How to calculate cumulative sum? [duplicate]
- Create integer sequences defined by ‘from’ and ‘to’ vectors
- How to set multiple legends / scales for the same aesthetic in ggplot2?
- Extract the first 2 Characters in a string
- How to round up to the nearest 10 (or 100 or X)?
- Is set.seed consistent over different versions of R (and Ubuntu)?
- duplicates in multiple columns
- Select values from different columns based on a variable containing column names [duplicate]
- Filling area under curve based on value
- R self reference
- Count number of rows matching a criteria
- Splitting a data.frame by a variable [duplicate]
- Using row-wise column indices in a vector to extract values from data frame [duplicate]
- Creating regular 15-minute time-series from irregular time-series
- How can a non-imported method in a not-attached package be found by calls to functions not having it in their namespace?
- Efficiently computing a linear combination of data.table columns
- Rounding numbers in R to specified number of digits
- Unlist a data frame by rows, not columns
- How to add table of contents in Rmarkdown?
- How to hold figure position with figure caption in pdf output of knitr?
- How do you delete a column by name in data.table?
- Applying a function to two lists?
- Merging two sets of data by data.table roll=’nearest’ function
- Sum object in a column between an interval defined by another column
- R shiny sliderInput with restricted range