ssc | R Documentation |
Create includes or excludes from the dataset by selecting from any variable in any logical combination, using the available logical operators like e.g. '|' and '&'.
ssc(dataset, criteria, include = TRUE, keepEC = FALSE)
dataset |
An object of class 'aquap_data' |
criteria |
The selection criteria in the format
|
include |
Logical. If the observations matching the criteria should be included or excluded from the dataset. |
keepEC |
If *all* the environmental control observations should be kept in the dataset. Only evaluated if 'include' is TRUE. |
The column names are provided as is, i.e. without quotes, while for characters the values have to be enclosed in quotation marks - see examples.
The standard dataset as described in getFullData
Other Data pre-treatment functions:
[,aquap_data-method
,
do_addNoise()
,
do_avg()
,
do_blowup()
,
do_detrend()
,
do_emsc()
,
do_gapDer()
,
do_msc()
,
do_resampleNIR()
,
do_sgolay()
,
dpt_modules
,
selectWls()
## Not run:
ds <- ssc(dataset, C_Group=="Control")
# keeps all the controls
ds <- ssc(dataset, C_Group!="Control", include=FALSE)
# the same as above
ds <- ssc(dataset, C_Group=="Control" & C_Repl=="R1")
# keeps only the first replicate of the controls
ds <- ssc(dataset, C_Group=="Control" | C_Repl=="R1")
# keeps all the first replicate and all the controls
ds <- ssc(dataset, C_Group=="Control" & C_Repl=="R1", keepEC=TRUE)
# keeps the first replicate of the controls and all the environmental controls
ds <- ssc(dataset, C_Group=="Control" & C_Repl=="R1", include=FALSE)
# keeps everything except the first replicate of the controls
ds <- ssc(dataset, (C_Group=="Control" | C_Group=="Treatment") & Y_conSNr==1)
# keeps the first consec. scan of the controls and the treatment group.
ds <- ssc(dataset, (C_Group=="Control" | C_Group=="MQ") & C_conSNr=="1")
# keeps the first consec. scan of the controls and the environmental controls
ds <- ssc(dataset, Y_Temp==22.5)
ds <- ssc(dataset, Y_Temp==22.5 & Y_conSNr==1)
ds <- ssc(dataset, Y_conSNr==1)
# keeps only the first consecutive scan
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.