Nothing
Use case:
Setup script:
unlink("fxtract_files", recursive = TRUE)
library(fxtract) xtractor = Xtractor$new("xtractor") xtractor$add_data(iris, group_by = "Species")
Let's write functions, which fail on different datasets:
fun1 = function(data) { if ("versicolor" %in% data$Species) stop("fun1 not compatible on versicolor") c(mean_sepal_length = mean(data$Sepal.Length), sd_sepal_length = sd(data$Sepal.Length)) } fun2 = function(data) { if ("virginica" %in% data$Species) stop("fun2 not compatible on virginica") c(mean_petal_length = mean(data$Petal.Length), sd_petal_length = sd(data$Petal.Length)) } xtractor$add_feature(fun1) xtractor$add_feature(fun2) xtractor$calc_features()
We can still get the resulting dataframe with missing values for failed calculations:
xtractor$results
xtractor$error_messages
You can get the feature function and the dataset of the ID like this:
fun = xtractor$get_feature("fun1") df = xtractor$get_data("versicolor")
Now you can debug the function on the dataset on which the function failed.
fun1_fixed = function(data) { c(mean_sepal_length = mean(data$Sepal.Length), sd_sepal_length = sd(data$Sepal.Length)) } fun2_fixed = function(data) { c(mean_petal_length = mean(data$Petal.Length), sd_petal_length = sd(data$Petal.Length)) } xtractor$remove_feature(fun1) xtractor$remove_feature(fun2) xtractor$add_feature(fun1_fixed) xtractor$add_feature(fun2_fixed)
xtractor$calc_features() xtractor$results
unlink("fxtract_files", recursive = TRUE)
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.