normfluodbf_utils: A function to append a unique identifier attribute to any...

unique_identifierR Documentation

A function to append a unique identifier attribute to any data frame within the normfluodbf package.

Description

The function in the context of normfluodbf creates an attribute called Cycle_Number and appends this attribute to the cleaned or wrangled data frame derived from the dirty DBF file.

A function that creates an attribute of seq(numrows) with a step size of 1, where the user provides the attribute name.

Applies a function over a list of attributes.

A function to help the researcher reproduce the time attribute.

A function that facilitates a users' workflow by helping extract the actual columns used in the assay.

Usage

unique_identifier(df)

generic_identifier(numrows, col_name)

norm_applier(df, norm_scale = c("one", "hundred", "z-score", "raw", "decimal"))

time_attribute(
  interval = NULL,
  first_end = NULL,
  pause_duration = NULL,
  end_time = NULL,
  cycles = NULL
)

actual_cols_used(dat)

Arguments

df

A data frame.

numrows

The number of rows the user intends to have in the created data frame.

col_name

The desired attribute name.

norm_scale

This parameter takes sub-parameters: 'raw’ , hundred’ , 'one’ , 'z-score' , or 'decimal’ , which denotes the normalization type or scale.

interval

The time interval chosen for the assay often in seconds.

first_end

The end time of the initial run, often the pause for the introduction of a new substance. This can be the cycle number chosen for the initial stop.

pause_duration

The time between the first end (pause) and resumption of the assay.

end_time

The final end time of the assay.

cycles

The number of cycles in the assay as selected by the user or researcher.

dat

A string ("dat_1.dat") if the file is found within the present working directory (pwd) OR a path pointing directly to a ".dat" file.

Value

A data frame with the Cycle_Number attribute appended to the end of the data frame.

A user-named single attribute data frame with nrow = numrows.

A data frame with attribute values obtained from the applied function using lapply.

The time attribute.

Returns a numeric vector denoting the columns used in the assay.

Note

The function operates in a closed system, meaning it is primarily designed to work with this package ONLY. Other use cases are simply a coincidence.

The original function had an option for minutes which was for less time conscious people but the final version for this package has no such option. Users MUST provide numbers in seconds.

Author(s)

Tingwei Adeck

See Also

normfluodat()

Examples

## Not run: 
test_df <- as.data.frame(c(seq(40)))
colnames(test_df) <- "test"
unique_identifier(test_df)
## End(Not run)
## Not run: 
generic_identifier(40, col_name="Cycle_No")
## End(Not run)
## Not run: 
test_df <- as.data.frame(c(seq(40)))
colnames(test_df) <- "test"
test_df_norm <- norm_applier(test_df,norm_scale = 'one')
## End(Not run)
## Not run: 
time_test = time_attribute(30,8,136,1276,40)
time_test = time_attribute(60,8,136,2460,40)
## End(Not run)
## Not run: 
fpath <- system.file("extdata", "dat_1.dat", package = "normfluodbf", mustWork = TRUE)
acutest <- actual_cols_used(fpath)
## End(Not run)

normfluodbf documentation built on Sept. 28, 2024, 1:06 a.m.