R/load_cls.R

Defines functions load_cls

Documented in load_cls

load_cls <- function(file = NULL)
{
	cls_info <- readLines(file)
	label_list <- unlist(strsplit(cls_info[3], " "))
	uniquelist <- sort(unique(label_list))
	y <- vector(length = length(label_list), mode = "integer")
	for(i in 1:length(label_list)){
		y[i] <- which(uniquelist == label_list[i]) - 1L
	}
	return(list(pheotype = uniquelist, value = y))
}

Try the dslice package in your browser

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

dslice documentation built on Nov. 22, 2023, 9:06 a.m.