sits_to_xlsx {sits}R Documentation

Save accuracy assessments as Excel files

Description

Saves confusion matrices as Excel spreadsheets. This function takes the a list of accuracy assessments generated by sits_accuracy and saves them in an Excel spreadsheet.

Usage

sits_to_xlsx(acc_lst, file)

Arguments

acc_lst

A list of accuracy statistics

file

The file where the XLSX data is to be saved.

Author(s)

Gilberto Camara, gilberto.camara@inpe.br

Examples

## Not run: 
# read a tibble with 400 samples of Cerrado and 346 samples of Pasture
data(cerrado_2classes)
# perform a 2 fold validation of this sample file
accuracy <- sits_kfold_validate(cerrado_2classes,
    folds = 2,
    ml_method = sits_rfor(num_trees = 300)
)
# create a list to store the results
results <- list()
# give a name to the accuracy assessment
accuracy$name <- "cerrado_2classes"
# add the confusion matrix to the results
results[[length(results) + 1]] <- accuracy
# save the results to an XLSX file
xlsx_file <- paste0(tempdir(), "accuracy.xlsx")
sits_to_xlsx(results, file = xlsx_file)

## End(Not run)


[Package sits version 0.16.2 Index]