Description Usage Arguments Value Examples
Select a random subset of time series from a dataset by using unique ID subset. Optionally, a minimum number of observation for the individual IDs can be provided.
1 2 | select_random_subset(in.file, ntraj, col.uniqID, col.time,
min.obs = NULL, col.whatokeep = NULL, out.file = NULL)
|
in.file |
A character or a variable for the current environment. If a character, a path to a .csv file is expected. |
ntraj |
Numeric. How many unique IDs to extract? |
col.uniqID |
Character. Name of the column with unique IDs. |
col.time |
Character. Name of the column with time. |
min.obs |
Optional numeric. Minimum number of observations of an ID. |
col.whatokeep |
Optional character. Name of the columns to be returned in the output. If NULL returns all columns. Columns with uniqID and time are always returned. |
out.file |
Optional character. If provided the output is saved as a .csv file to the path indicated by out.file. Otherwise, the new dataset is returned. |
A data.table with the columns indicated in col.whatokeep.
1 2 3 4 5 6 7 8 | # Simulate 10 phase-shifted sinusoids with 3 different level of noises
# ("experimental conditions", first grouping).
x <- multi_sims(type = "ps", noises = c(0.2,0.4), n = 10)
plot_sim(x)
# Read/export 5 random TS from/in environment
x[, uniqID := paste(noise, variable, sep ="_")]
x_subset <- select_random_subset(in.file=x, ntraj=5, col.uniqID="uniqID", col.time="Time")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.