Description Usage Arguments Value Examples

This function extracts a subset data frame based on a given set of rules. Can
subset data based on ranges of: time, oxygen, row number, or proportion. To
subset by 'time' and by 'o2', the function assumes time is in the first
column, and oxygen in the second column. To subset by 'proportion', the
function calculates proportion data from the oxygen column. **This function
can subset any data frame by 'row'.**

1 | ```
subset_data(x, from, to, by = "time")
``` |

`x` |
data frame. The data to subset. |

`from` |
numeric. Defines the lower bound(s) of the data frame to subset.
Subsetting is based on the argument: |

`to` |
numeric. Defines the upper bound(s) of the data frame to subset.
Subsetting is based on the argument: |

`by` |
string. "time", "row", "o2" or "proportion". |

A `data.table`

object.

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
# Subset by time:
x <- subset_data(squid.rd, from = 2000, to = 4000, by = "time")
plot(x)
subset_data(flowthrough.rd, from = 50, to = 600, by = "time")
# Subset by O_2:
subset_data(sardine.rd, from = 94, to = 91, by = "o2")
# Subset by proportion:
subset_data(sardine.rd, from = 0.8, to = 0.4, by = "proportion")
# Subset by row:
subset_data(flowthrough.rd, from = 10, to = 750, by = "row")
``` |

januarharianto/respR documentation built on Nov. 19, 2018, 8:17 p.m.

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.