Create bar plots for each column in each data frame, showing only non-zero values. Normalize each feature s.t. max is one.

plot_features(data_list, take_abs = TRUE, n_limit = 12)

Arguments

data_list

A list of data frames.

take_abs

boolean

n_limit

Integer, limit features to top n_limit with highest value

Value

A list of ggplot objects.

Examples

if (FALSE) { # \dontrun{
# Simulate data
set.seed(123)
feature_names <- paste("Feature", 1:10)
data_list <- list(
  df1 = data.frame(matrix(ifelse(runif(100) < 0.5, 0, runif(100)), nrow = 10)),
  df2 = data.frame(matrix(ifelse(runif(100) < 0.5, 0, runif(100)), nrow = 10))
)

# Set rownames
rownames(data_list$df1) <- feature_names
rownames(data_list$df2) <- feature_names

# Use the function
plots <- plot_features(data_list)

# Display the plots
for (i in 1:length(plots)) {
  print(plots[[i]])
}
} # }