Skip to contents

Uses fwrite to fastly write a CSV file within a current date subfolder of a provided specific directory.

Usage

saveCSV(df,
        dir = "results",
        filename = "output",
        verbose = TRUE,
        append = FALSE,
        save = TRUE,
        foldername = NULL)

Arguments

df

Any input list of same length vectors (e.g. data.frame and data.table).

dir

Pathway to the computer's directory, where the file will be saved provided that the argument save is set up in TRUE. The default is to create a directory named results and the input data.frame will be saved within a subfolder named after the current date.

filename

Name of the output file to be saved. The default is to create a file entitled output.

verbose

Logical, if FALSE, a message showing the saving process will not be printed in the console in full.

append

Logical, if TRUE, the file is opened in append mode and column names (header row) are not written.

save

Logical, if FALSE, the input data.frame will be not be saved on disk.

foldername

A parameter only for internal use with expowo's main functions. You must keep this always as NULL.

Author

Debora Zuanny & Domingos Cardoso

Examples

# \donttest{
library(expowo)

res <- powoGenera(family = "Lecythidaceae",
                  verbose = TRUE,
                  save = FALSE)
#> Searching... Lecythidaceae 1/1
#> Searching distribution and sp number of... Allantoma Lecythidaceae 1/24
#> Searching distribution and sp number of... Asteranthos Lecythidaceae 2/24
#> Searching distribution and sp number of... Barringtonia Lecythidaceae 3/24
#> Searching distribution and sp number of... Bertholletia Lecythidaceae 4/24
#> Searching distribution and sp number of... Brazzeia Lecythidaceae 5/24
#> Searching distribution and sp number of... Careya Lecythidaceae 6/24
#> Searching distribution and sp number of... Cariniana Lecythidaceae 7/24
#> Searching distribution and sp number of... Chydenanthus Lecythidaceae 8/24
#> Searching distribution and sp number of... Corythophora Lecythidaceae 9/24
#> Searching distribution and sp number of... Couratari Lecythidaceae 10/24
#> Searching distribution and sp number of... Couroupita Lecythidaceae 11/24
#> Searching distribution and sp number of... Crateranthus Lecythidaceae 12/24
#> Searching distribution and sp number of... Eschweilera Lecythidaceae 13/24
#> Searching distribution and sp number of... Foetidia Lecythidaceae 14/24
#> Searching distribution and sp number of... Grias Lecythidaceae 15/24
#> Searching distribution and sp number of... Gustavia Lecythidaceae 16/24
#> Searching distribution and sp number of... Lecythis Lecythidaceae 17/24
#> Searching distribution and sp number of... Napoleonaea Lecythidaceae 18/24
#> Searching distribution and sp number of... Oubanguia Lecythidaceae 19/24
#> Searching distribution and sp number of... Petersianthus Lecythidaceae 20/24
#> Searching distribution and sp number of... Pierrina Lecythidaceae 21/24
#> Searching distribution and sp number of... Planchonia Lecythidaceae 22/24
#> Searching distribution and sp number of... Rhaptopetalum Lecythidaceae 23/24
#> Searching distribution and sp number of... Scytopetalum Lecythidaceae 24/24

saveCSV(res,
        dir = "results_powoGenera",
        filename = "Lecythidaceae_search",
        append = FALSE)
#> Writing spreadsheet 'Lecythidaceae_search.csv' within 'results_powoGenera/23ago2024' on disk.
# }