Nothing
# need to make this to avoid possible memory leak in data.table melt
melt_aorsf <-
function(data,
id.vars,
measure.vars,
variable.name = "variable",
value.name = "value") {
if (!is.data.frame(data)) {
stop("Input 'data' must be a data frame.")
}
if (!is.character(id.vars)) {
stop("Input 'id.vars' must be a character vector.")
}
if (!is.character(measure.vars)) {
stop("Input 'measure.vars' must be a character vector.")
}
# Select id variables and measure variables
id_data <- data[id.vars]
measure_data <- data[measure.vars]
# Create a sequence variable to represent the variable names
variable_data <- rep(names(measure_data), each = nrow(data))
# Reshape the data
long_data <- data.frame(id_data,
variable = variable_data,
value = unlist(measure_data, use.names = FALSE))
names(long_data)[names(long_data) == 'variable'] <- variable.name
names(long_data)[names(long_data) == 'value'] <- value.name
return(long_data)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.