R/readModel.R

Defines functions readModel

Documented in readModel

readModel <- function(File){
	# # read concentration-response data from txt file
	getExtension <- function(File){ 
		ex <- strsplit(basename(File), split="\\.")[[1]]
		return(ex[-1])
		}

	extension = getExtension(File)

	if(extension == 'txt') sept <- "" else sept <- ","

    ds <- read.table(File, fill = T, sep = sept, row.names = NULL, header = TRUE, comment.char = "", quote = "")

    model <- as.vector(ds[, 2])
    param <- as.matrix(ds[, c(3 : 5)])
    rownames(param) <- ds[, 1]

    list(model = model, param = param)
}

Try the mixtox package in your browser

Any scripts or data that you put into this service are public.

mixtox documentation built on June 20, 2022, 5:05 p.m.