drop_row_if | R Documentation |

Conditionally drop rows based on percent missingness

drop_row_if(df, sign = "gt", type = "count", value = 20, as_percent = TRUE)

`df` |
A data.frame object |

`sign` |
Character. One of gteq,lteq,lt,gt or eq which refer to greater than(gt) or equal(eq) or less than(lt) or equal to(eq) respectively. |

`type` |
One of either count or percent. Defaults to count |

`value` |
Value to use for the drop. |

`as_percent` |
Logical. If set to TRUE, percent_na is treated as a percentage. Otherwise, decimals(fractions) are used. |

head(drop_row_if(airquality,sign = "gteq", type = "percent",value=16, as_percent = TRUE)) # should give the same output as above. head(drop_row_if(airquality, sign="gteq", type="percent",value = 0.15, as_percent=FALSE)) # Drop based on NA counts df <- data.frame(A=1:5, B=c(1,NA,NA,2, 3), C= c(1,NA,NA,2,3)) drop_row_if(df, type="count",value=2,sign="eq")

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.