createDataframe: Dataframe creation

View source: R/createDataframe.R

createDataframeR Documentation

Dataframe creation

Description

createDataframe saves the calculated resistance, perseverance and sensitivity estimates

Usage

createDataframe(
  projectName,
  clearHalo,
  diskDiam = 6,
  maxDist = 25,
  standardLoc = 2.5,
  removeClear = FALSE,
  nameVector = TRUE,
  typeVector = TRUE,
  typePlace = 2,
  typeName = "type",
  standType = "one",
  typical = TRUE
)

Arguments

projectName

the short name in use for the project.

clearHalo

numeric value that indicates which picture should be used to represent a clear halo (i.e., the clear space beside the disk).

diskDiam

the diameter of the diffusion disk in mm, defaults to 6.

maxDist

a numeric value indicating the maximum distance away from the disk to be considered. Defaults to 25mm.

standardLoc

is a numberic value that indicates the location (on the disk) to use to standardize white intensity across photographs. The position of standardLoc is a position that should theoretically have the same intensity in all photographs, i.e., the white of the disk. The default value (2.5mm) was chosen after testing of 6mm disks that contain some writing. If smaller disks are used standardLoc should be scaled appropriately. You can see where standardLoc falls in each photograph in plotRaw (the red dashed line when 'plotStandardLoc = TRUE'). To suppress this standardization use 'standardLoc = FALSE'

removeClear

a logical value that indicates whether to remove the clear halo picture from the dataset (i.e., is this picture an experimental picture, or one solely included to use as a clear halo). Defaults to FALSE.

nameVector

either a logical value or a character vector. Supported values are nameVector = "TRUE" to assign the photograph name to the 'name' column, nameVector = "FALSE" to assign the photograph number to the 'name' column, or nameVector = a vector the same length as the number of photographs indicating the desired names.

typeVector

a logical value. typeVector = "TRUE" will add a 'type' vector to the dataframe using values found in the typePlace position of the photograph names (see IJMacro for more details) while typeVector = "FALSE" will not add a type column.

typePlace

a number that indicates the position of the photograph name to be stored as the 'type' vector'. Defaults to 2. For more details see IJMacro

typeName

a character string that indicates what to name the typeVector. Defaults to "type".

standType

either "one" or "indiv" to determine whether to use one standard for all photos or individually standardize each photo.

typical

if TRUE, a logistic curve will be calculated for each photo. If FALSE, the function will determine whether logistic, confounding, or paradoxical is the best fit and then calculate the curve.

Details

If typical = TRUE, creates a dataframe with 9 columns: name: determined by nameVector, either photograph names, photograph numbers, or a user-supplied list of names; line: the first components of the namesVector, everything that comes before the first "_" in the photograph name; type: the location within the name of the photograph type is supplied by typePlace. Use addType if more than one type column are desired; RAD20, RAD50, RAD80: resistance parameters, corresponding to the distance in mm of 80%, 50% and 20% reduction in growth; FoG80, FoG50, FoG20: perseverance parameters, corresponding to the fraction of growth achieved above the 80%, 50% and 20% reduction in growth points

If typical = FALSE, then up to three dataframes will be created, depending on the categorizations of the pictures in maxLik. The pictures will be split into standard, confounding, and paradoxical growth and each category that has photos will create a dataframe. All the dataframes will have the same first three columns as typical = TRUE, as well as a column indicating the photo index so that photos can be identified. The parameters of interest vary between the drug responses. The standard dataframes will have the same parameters of interest as typical = TRUE. The confounding dataframes will have DRAD80, DRAD50, and DRAD20, corresponding to the distance in mm of 80%, 50%, and 20% disinhibition. The paradoxical dataframes will have two points of maximum inhibition. One is the calculated maxInhib (based on the minimum point from the fit curve) and the other is the observed maxInhib (based on the minimum observed data point)

Value

If typical = TRUE, a dataframe "projectName.df" is saved to the global environment and a .csv file "projectName_df.csv" is exported to the "parameter_files" directory. If typical = FALSE, up to three dataframes are saved to the global environment and up to three .csv files are exported to the "parameter_files" directory.

Examples

## Not run: 
createDataframe("myProject", clearHalo=1)
createDataframe("myProject", clearHalo=1, removeClear = TRUE, typeName = "drugAmt")

## End(Not run)

acgerstein/diskImageR documentation built on May 18, 2024, 4:15 a.m.