| Title: | Save and Load R Objects |
|---|---|
| Description: | Facilitates saving and loading R objects, data frames, tables, plots, text blocks and numbers to subfolders. |
| Authors: | Joe Thorley [aut, cre] (ORCID: <https://orcid.org/0000-0002-7683-4592>), Ayla Pearson [ctb] (ORCID: <https://orcid.org/0000-0001-7388-1222>), Evan Amies-Galonski [ctb] (ORCID: <https://orcid.org/0000-0003-1096-2089>), Nadine Hussein [ctb] (ORCID: <https://orcid.org/0000-0003-4470-8361>), Duncan Kennedy [ctb] (ORCID: <https://orcid.org/0009-0001-4880-5751>), Alan Constant [ctb] (ORCID: <https://orcid.org/0000-0002-1652-4031>), Stefano Mezzini [ctb] (ORCID: <https://orcid.org/0000-0001-8551-7436>), Poisson Consulting [cph, fnd] |
| Maintainer: | Joe Thorley <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.1.9030 |
| Built: | 2026-11-05 11:21:12 UTC |
| Source: | https://github.com/poissonconsulting/subfoldr2 |
Add named empty blob column to database
sbf_add_blob_column_to_db( column_name, table_name, db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main() )sbf_add_blob_column_to_db( column_name, table_name, db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main() )
column_name |
A string of the name of the BLOB column. |
table_name |
A string of the name of the existing table. |
db_name |
A string of the database name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
Invisible TRUE.
Other flob:
sbf_save_flobs_from_db(),
sbf_upload_flobs_to_db()
Other database functions:
sbf_close_db(),
sbf_copy_db(),
sbf_create_db(),
sbf_execute_db(),
sbf_open_db(),
sbf_query_db(),
sbf_upload_flobs_to_db()
Add to existing sub folder.
sbf_add_sub(..., rm = FALSE, ask = getOption("sbf.ask", TRUE))sbf_add_sub(..., rm = FALSE, ask = getOption("sbf.ask", TRUE))
... |
One or more character vectors which are combined together. |
rm |
A flag specifying whether to remove the folder and all its contents if it already exists. |
ask |
A flag specifying whether to ask before removing the existing folder. |
An invisible string specifying the new sub folder.
Other directory functions:
sbf_get_archive(),
sbf_get_db_name(),
sbf_get_main(),
sbf_get_sub(),
sbf_get_workbook_name(),
sbf_reset(),
sbf_reset_db_name(),
sbf_reset_main(),
sbf_reset_sub(),
sbf_set_db_name(),
sbf_set_main(),
sbf_set_sub(),
sbf_up_sub()
sbf_set_sub("nameofsub") sbf_add_sub("anothername") sbf_get_sub() sbf_reset_sub()sbf_set_sub("nameofsub") sbf_add_sub("anothername") sbf_get_sub() sbf_reset_sub()
Archives main folder by copy to a director of the same name with the current date and time appended.
sbf_archive_main( main = sbf_get_main(), ask = getOption("sbf.ask", TRUE), tz = dtt_default_tz() )sbf_archive_main( main = sbf_get_main(), ask = getOption("sbf.ask", TRUE), tz = dtt_default_tz() )
main |
A string specifying the path to the main folder (by default the current main folder) |
ask |
A flag specifying whether to ask before removing the existing folder. |
tz |
A string specifying the time zone for the current date and time. |
An invisible string of the path to the archived folder.
Other archive:
sbf_get_archive(),
sbf_unarchive_main()
Other housekeeping functions:
sbf_convert_meta(),
sbf_rm_flobs(),
sbf_rm_main(),
sbf_unarchive_main()
Converts a data frame to the lines of a markdown table in the same format
as the .md file saved by sbf_save_table() and sbf_save_plot().
sbf_as_md( x, round = FALSE, proportion = FALSE, format_column = list(), round_as_estimate = character(0), no_big_mark = character(0) )sbf_as_md( x, round = FALSE, proportion = FALSE, format_column = list(), round_as_estimate = character(0), no_big_mark = character(0) )
x |
A data frame. |
round |
A flag specifying whether to round the numeric columns as in
the |
proportion |
A flag specifying whether the columns |
format_column |
A list of two-sided formulas of the form
|
round_as_estimate |
A character vector of numeric columns, other than
|
no_big_mark |
A character vector of numeric columns (e.g. |
Numeric columns are right-aligned with their decimal points aligned using
spaces and commas as thousands separators for numbers of 1000 or more
except in the columns named by no_big_mark.
Other columns, including numbers stored as character, are left-aligned.
List columns and the geometry column of sf objects are dropped.
A character vector of the lines of the table in markdown format.
x <- data.frame( term = c("bIntercept", "bYear"), estimate = c(0.53124, 12.3456), lower = c(0.21234, 9.8765), upper = c(0.87012, 15.4321) ) writeLines(sbf_as_md(x)) writeLines(sbf_as_md(x, round = TRUE)) writeLines(sbf_as_md(data.frame(year = 2025L, count = 1500L))) writeLines(sbf_as_md(data.frame(year = 2025L), no_big_mark = "year"))x <- data.frame( term = c("bIntercept", "bYear"), estimate = c(0.53124, 12.3456), lower = c(0.21234, 9.8765), upper = c(0.87012, 15.4321) ) writeLines(sbf_as_md(x)) writeLines(sbf_as_md(x, round = TRUE)) writeLines(sbf_as_md(data.frame(year = 2025L, count = 1500L))) writeLines(sbf_as_md(data.frame(year = 2025L), no_big_mark = "year"))
sbf_backup_pg() was moved to subfoldr2ext::sbfx_backup_pg().
Save a copy of your database in a plain text format. This saves all the SQL code to recreate the structure and data.
sbf_backup_pg( db_dump_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main(), config_path = getOption("psql.config_path", NULL), config_value = getOption("psql.config_value", "default") )sbf_backup_pg( db_dump_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main(), config_path = getOption("psql.config_path", NULL), config_value = getOption("psql.config_value", "default") )
db_dump_name |
A string of the name for the database backup file |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
config_path |
A string of a file path to the yaml configuration file.
The default value grabs the file path from the psql.config_path option
and uses |
config_value |
A string of the name of value. The default value grabs
the value from the psql.config_value option and uses |
Wrapper on psql::psql_backup()
TRUE (or errors)
Other postgresql functions:
sbf_close_pg(),
sbf_create_pg(),
sbf_execute_pg(),
sbf_get_config_file(),
sbf_get_config_value(),
sbf_get_schema(),
sbf_list_tables_pg(),
sbf_load_data_from_pg(),
sbf_load_datas_from_pg(),
sbf_open_pg(),
sbf_reset_config_file(),
sbf_reset_config_value(),
sbf_reset_schema(),
sbf_save_data_to_pg(),
sbf_set_config_file(),
sbf_set_config_value(),
sbf_set_schema()
## Not run: sbf_backup_pg() sbf_backup_pg("database-22") ## End(Not run)## Not run: sbf_backup_pg() sbf_backup_pg("database-22") ## End(Not run)
Just a wrapper on basename() and
tools::file_path_sans_ext().
sbf_basename_sans_ext(x)sbf_basename_sans_ext(x)
x |
A character vector of file paths. |
A character vector of extension-less base file names.
Other save functions:
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_window(),
sbf_save_workbook()
sbf_basename_sans_ext("path/file.ext")sbf_basename_sans_ext("path/file.ext")
this function is now deprecated as of version 0.0.0.9045
sbf_block_exists(x_name, sub = sbf_get_sub(), main = sbf_get_main())sbf_block_exists(x_name, sub = sbf_get_sub(), main = sbf_get_main())
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
A flag specifying whether the block exists.
Other exists functions:
sbf_data_exists(),
sbf_number_exists(),
sbf_object_exists(),
sbf_plot_exists(),
sbf_string_exists(),
sbf_table_exists()
Closes the database connection.
sbf_close_db(conn)sbf_close_db(conn)
conn |
A DBI::DBIConnection object,
as returned by |
The function is just a wrapper on [dbDisconnect][DBI::dbDisconnect](conn).
Other database functions:
sbf_add_blob_column_to_db(),
sbf_copy_db(),
sbf_create_db(),
sbf_execute_db(),
sbf_open_db(),
sbf_query_db(),
sbf_upload_flobs_to_db()
Closes the current graphics device.
sbf_close_pdf()sbf_close_pdf()
The function is just a wrapper on grDevices::dev.off().
Other graphic functions:
sbf_close_window(),
sbf_close_windows(),
sbf_open_pdf(),
sbf_open_window()
sbf_close_pg() was moved to subfoldr2ext::sbfx_close_pg().
Close the PostgreSQL connection when you are done using a database.
sbf_close_pg(conn)sbf_close_pg(conn)
conn |
A DBI::DBIConnection object,
as returned by |
Wrapper on DBI::dbDisconnect(). It is important to remember to
close connections or your database performance can decrease over time.
TRUE (or errors).
Other postgresql functions:
sbf_backup_pg(),
sbf_create_pg(),
sbf_execute_pg(),
sbf_get_config_file(),
sbf_get_config_value(),
sbf_get_schema(),
sbf_list_tables_pg(),
sbf_load_data_from_pg(),
sbf_load_datas_from_pg(),
sbf_open_pg(),
sbf_reset_config_file(),
sbf_reset_config_value(),
sbf_reset_schema(),
sbf_save_data_to_pg(),
sbf_set_config_file(),
sbf_set_config_value(),
sbf_set_schema()
## Not run: conn <- sbf_open_pg() sbf_close_pg(conn) ## End(Not run)## Not run: conn <- sbf_open_pg() sbf_close_pg(conn) ## End(Not run)
Closes the current graphics device.
sbf_close_window()sbf_close_window()
The function is just a wrapper on grDevices::dev.off().
Other graphic functions:
sbf_close_pdf(),
sbf_close_windows(),
sbf_open_pdf(),
sbf_open_window()
Closes all current graphics device.
sbf_close_windows()sbf_close_windows()
The function is just a wrapper on grDevices::graphics.off().
Other graphic functions:
sbf_close_pdf(),
sbf_close_window(),
sbf_open_pdf(),
sbf_open_window()
Compares data using waldo::compare.
sbf_compare_data( x, x_name = substitute(x), sub = sbf_get_sub(), main = sbf_get_main(), tolerance = sqrt(.Machine$double.eps), ignore_attr = FALSE )sbf_compare_data( x, x_name = substitute(x), sub = sbf_get_sub(), main = sbf_get_main(), tolerance = sqrt(.Machine$double.eps), ignore_attr = FALSE )
x |
The object to save. |
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
tolerance |
numeric |
ignore_attr |
Ignore differences in specified attributes?
Supply a character vector to ignore differences in named attributes.
By default the For backward compatibility with |
A character vector with class "waldo_compare".
Other compare functions:
sbf_compare_data_archive(),
sbf_diff_data(),
sbf_diff_data_archive(),
sbf_diff_table(),
sbf_is_equal_data(),
sbf_is_equal_data_archive()
Compares existing data to archived data using using waldo::compare.
sbf_compare_data_archive( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), archive = 1L, recursive = FALSE, include_root = TRUE, tolerance = sqrt(.Machine$double.eps), ignore_attr = FALSE )sbf_compare_data_archive( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), archive = 1L, recursive = FALSE, include_root = TRUE, tolerance = sqrt(.Machine$double.eps), ignore_attr = FALSE )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
archive |
A positive whole number specifying the folder archived folder where 1L (the default) indicates the most recently archived folder or a character string of the path to the archived folder. |
recursive |
A flag specifying whether to recurse into subfolders. |
include_root |
A flag indicating whether to include objects in the top sub folder. |
tolerance |
numeric |
ignore_attr |
Ignore differences in specified attributes?
Supply a character vector to ignore differences in named attributes.
By default the For backward compatibility with |
A named list of character vectors.
Other compare functions:
sbf_compare_data(),
sbf_diff_data(),
sbf_diff_data_archive(),
sbf_diff_table(),
sbf_is_equal_data(),
sbf_is_equal_data_archive()
Converts legacy metadata files (saved with the .rda extension as RDS files)
to the human- and machine-readable .yaml files now used by the package.
Each .rda file in the main folder is read, written to a .yaml file of the
same name and then deleted.
sbf_convert_meta(main = sbf_get_main(), ask = getOption("sbf.ask", TRUE))sbf_convert_meta(main = sbf_get_main(), ask = getOption("sbf.ask", TRUE))
main |
A string specifying the path to the main folder (by default the current main folder) |
ask |
A flag specifying whether to ask before converting the files. |
An invisible character vector of the paths to the .yaml files
created.
Other housekeeping functions:
sbf_archive_main(),
sbf_rm_flobs(),
sbf_rm_main(),
sbf_unarchive_main()
Copies an existing SQLite database to the subfolder.
sbf_copy_db( path, db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main(), exists = FALSE, ask = getOption("sbf.ask", TRUE) )sbf_copy_db( path, db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main(), exists = FALSE, ask = getOption("sbf.ask", TRUE) )
path |
A string of the path to the database to copy (with the extension). |
db_name |
A string of the name for the new database (without the extension). |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
exists |
A logical scalar specifying whether the new database must already exist. |
ask |
A flag specifying whether to ask before deleting an existing database (if exists = FALSE). |
A flag indicating whether successfully copied.
Other database functions:
sbf_add_blob_column_to_db(),
sbf_close_db(),
sbf_create_db(),
sbf_execute_db(),
sbf_open_db(),
sbf_query_db(),
sbf_upload_flobs_to_db()
Create SQLite Database
sbf_create_db( db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main(), ask = getOption("sbf.ask", TRUE) )sbf_create_db( db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main(), ask = getOption("sbf.ask", TRUE) )
db_name |
A string of the database name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
ask |
A flag specifying whether to ask before deleting an existing database. |
Other database functions:
sbf_add_blob_column_to_db(),
sbf_close_db(),
sbf_copy_db(),
sbf_execute_db(),
sbf_open_db(),
sbf_query_db(),
sbf_upload_flobs_to_db()
sbf_create_pg() was moved to subfoldr2ext::sbfx_create_pg().
Create a new PostgreSQL database.
sbf_create_pg( dbname, config_path = getOption("psql.config_path", NULL), config_value = getOption("psql.config_value", "default") )sbf_create_pg( dbname, config_path = getOption("psql.config_path", NULL), config_value = getOption("psql.config_value", "default") )
dbname |
A string of the name of the new database to create. |
config_path |
A string of a file path to the yaml configuration file.
The default value grabs the file path from the psql.config_path option
and uses |
config_value |
A string of the name of value. The default value grabs
the value from the psql.config_value option and uses |
Wrapper on psql::psql_create_db()
TRUE (or errors).
Other postgresql functions:
sbf_backup_pg(),
sbf_close_pg(),
sbf_execute_pg(),
sbf_get_config_file(),
sbf_get_config_value(),
sbf_get_schema(),
sbf_list_tables_pg(),
sbf_load_data_from_pg(),
sbf_load_datas_from_pg(),
sbf_open_pg(),
sbf_reset_config_file(),
sbf_reset_config_value(),
sbf_reset_schema(),
sbf_save_data_to_pg(),
sbf_set_config_file(),
sbf_set_config_value(),
sbf_set_schema()
## Not run: sbf_create_pg("new_database") sbf_create_pg("new_database", config_path = "keys/config.yml") ## End(Not run)## Not run: sbf_create_pg("new_database") sbf_create_pg("new_database", config_path = "keys/config.yml") ## End(Not run)
this function is now deprecated as of version 0.0.0.9045
sbf_data_exists(x_name, sub = sbf_get_sub(), main = sbf_get_main())sbf_data_exists(x_name, sub = sbf_get_sub(), main = sbf_get_main())
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
A flag specifying whether the data exists.
Other exists functions:
sbf_block_exists(),
sbf_number_exists(),
sbf_object_exists(),
sbf_plot_exists(),
sbf_string_exists(),
sbf_table_exists()
Find differences with existing data. If doesn't exist, x is compared to itself.
sbf_diff_data( x, x_name = substitute(x), sub = sbf_get_sub(), main = sbf_get_main() )sbf_diff_data( x, x_name = substitute(x), sub = sbf_get_sub(), main = sbf_get_main() )
x |
The object to save. |
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
A daff difference object.
Other compare functions:
sbf_compare_data(),
sbf_compare_data_archive(),
sbf_diff_data_archive(),
sbf_diff_table(),
sbf_is_equal_data(),
sbf_is_equal_data_archive()
Find differences with existing data and archived data. If doesn't exist (exists = NA) x is compared to itself.
sbf_diff_data_archive( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), archive = 1L, recursive = FALSE, include_root = TRUE, exists = NA )sbf_diff_data_archive( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), archive = 1L, recursive = FALSE, include_root = TRUE, exists = NA )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
archive |
A positive whole number specifying the folder archived folder where 1L (the default) indicates the most recently archived folder or a character string of the path to the archived folder. |
recursive |
A flag specifying whether to recurse into subfolders. |
include_root |
A flag indicating whether to include objects in the top sub folder. |
exists |
A logical scalar specifying whether the file should exist. |
A named list of character vectors.
Other compare functions:
sbf_compare_data(),
sbf_compare_data_archive(),
sbf_diff_data(),
sbf_diff_table(),
sbf_is_equal_data(),
sbf_is_equal_data_archive()
Find differences with existing table data. If doesn't exist (exists = NA) x is compared to itself.
sbf_diff_table( x, x_name = substitute(x), sub = sbf_get_sub(), main = sbf_get_main(), exists = NA )sbf_diff_table( x, x_name = substitute(x), sub = sbf_get_sub(), main = sbf_get_main(), exists = NA )
x |
The object to save. |
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
exists |
A logical scalar specifying whether the file should exist. |
A daff difference object.
Other compare functions:
sbf_compare_data(),
sbf_compare_data_archive(),
sbf_diff_data(),
sbf_diff_data_archive(),
sbf_is_equal_data(),
sbf_is_equal_data_archive()
Really just a wrapper on DBI::dbExecute().
sbf_execute_db( sql, db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main() )sbf_execute_db( sql, db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main() )
sql |
A string of the SQL statement to execute. |
db_name |
A string of the database name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
A scalar numeric of the number of rows affected by the statement.
Other database functions:
sbf_add_blob_column_to_db(),
sbf_close_db(),
sbf_copy_db(),
sbf_create_db(),
sbf_open_db(),
sbf_query_db(),
sbf_upload_flobs_to_db()
sbf_execute_pg() was moved to subfoldr2ext::sbfx_execute_pg().
Execute PostgreSQL statements.
sbf_execute_pg( sql, config_path = getOption("psql.config_path", NULL), config_value = getOption("psql.config_value", "default") )sbf_execute_pg( sql, config_path = getOption("psql.config_path", NULL), config_value = getOption("psql.config_value", "default") )
sql |
A string of the SQL statement to execute. |
config_path |
A string of a file path to the yaml configuration file.
The default value grabs the file path from the psql.config_path option
and uses |
config_value |
A string of the name of value. The default value grabs
the value from the psql.config_value option and uses |
Wrapper on psql::psql_execute_db()
A scalar numeric of the number of rows affected by the statement.
Other postgresql functions:
sbf_backup_pg(),
sbf_close_pg(),
sbf_create_pg(),
sbf_get_config_file(),
sbf_get_config_value(),
sbf_get_schema(),
sbf_list_tables_pg(),
sbf_load_data_from_pg(),
sbf_load_datas_from_pg(),
sbf_open_pg(),
sbf_reset_config_file(),
sbf_reset_config_value(),
sbf_reset_schema(),
sbf_save_data_to_pg(),
sbf_set_config_file(),
sbf_set_config_value(),
sbf_set_schema()
## Not run: sbf_execute_pg( "CREATE SCHEMA boat_count" ) sbf_execute_pg( "CREATE TABLE boat_count.input ( file_name TEXT NOT NULL, comment TEXT)" ) ## End(Not run)## Not run: sbf_execute_pg( "CREATE SCHEMA boat_count" ) sbf_execute_pg( "CREATE TABLE boat_count.input ( file_name TEXT NOT NULL, comment TEXT)" ) ## End(Not run)
Get Archive Directory
sbf_get_archive(main = sbf_get_main(), archive = 1L)sbf_get_archive(main = sbf_get_main(), archive = 1L)
main |
A string specifying the path to the main folder (by default the current main folder) |
archive |
A positive whole number specifying the folder archived folder where 1L (the default) indicates the most recently archived folder or a character string of the path to the archived folder. |
A string of the path to the archived directory.
Other archive:
sbf_archive_main(),
sbf_unarchive_main()
Other directory functions:
sbf_add_sub(),
sbf_get_db_name(),
sbf_get_main(),
sbf_get_sub(),
sbf_get_workbook_name(),
sbf_reset(),
sbf_reset_db_name(),
sbf_reset_main(),
sbf_reset_sub(),
sbf_set_db_name(),
sbf_set_main(),
sbf_set_sub(),
sbf_up_sub()
sbf_get_config_file() was moved to subfoldr2ext::sbfx_get_config_file().
Get the option set for psql.config_path
sbf_get_config_file()sbf_get_config_file()
A string of the config file path.
Other postgresql functions:
sbf_backup_pg(),
sbf_close_pg(),
sbf_create_pg(),
sbf_execute_pg(),
sbf_get_config_value(),
sbf_get_schema(),
sbf_list_tables_pg(),
sbf_load_data_from_pg(),
sbf_load_datas_from_pg(),
sbf_open_pg(),
sbf_reset_config_file(),
sbf_reset_config_value(),
sbf_reset_schema(),
sbf_save_data_to_pg(),
sbf_set_config_file(),
sbf_set_config_value(),
sbf_set_schema()
## Not run: sbf_get_config_file() ## End(Not run)## Not run: sbf_get_config_file() ## End(Not run)
sbf_get_config_value() was moved to subfoldr2ext::sbfx_get_config_value().
Get the value set for the psql.config_value options parameter.
sbf_get_config_value()sbf_get_config_value()
A string of the config file value
Other postgresql functions:
sbf_backup_pg(),
sbf_close_pg(),
sbf_create_pg(),
sbf_execute_pg(),
sbf_get_config_file(),
sbf_get_schema(),
sbf_list_tables_pg(),
sbf_load_data_from_pg(),
sbf_load_datas_from_pg(),
sbf_open_pg(),
sbf_reset_config_file(),
sbf_reset_config_value(),
sbf_reset_schema(),
sbf_save_data_to_pg(),
sbf_set_config_file(),
sbf_set_config_value(),
sbf_set_schema()
## Not run: sbf_get_config_value() ## End(Not run)## Not run: sbf_get_config_value() ## End(Not run)
Gets database name (without the extension or path). By default (ie if not set) 'database'.
sbf_get_db_name()sbf_get_db_name()
A string specifying the current database name (without the extension or path).
Other db_name:
sbf_set_db_name()
Other directory functions:
sbf_add_sub(),
sbf_get_archive(),
sbf_get_main(),
sbf_get_sub(),
sbf_get_workbook_name(),
sbf_reset(),
sbf_reset_db_name(),
sbf_reset_main(),
sbf_reset_sub(),
sbf_set_db_name(),
sbf_set_main(),
sbf_set_sub(),
sbf_up_sub()
sbf_get_db_name()sbf_get_db_name()
Get Main
sbf_get_main()sbf_get_main()
A string specifying the main directory.
Other directory functions:
sbf_add_sub(),
sbf_get_archive(),
sbf_get_db_name(),
sbf_get_sub(),
sbf_get_workbook_name(),
sbf_reset(),
sbf_reset_db_name(),
sbf_reset_main(),
sbf_reset_sub(),
sbf_set_db_name(),
sbf_set_main(),
sbf_set_sub(),
sbf_up_sub()
sbf_get_main()sbf_get_main()
sbf_get_schema() was moved to subfoldr2ext::sbfx_get_schema().
sbf_get_schema()sbf_get_schema()
A string of the schema name.
Other postgresql functions:
sbf_backup_pg(),
sbf_close_pg(),
sbf_create_pg(),
sbf_execute_pg(),
sbf_get_config_file(),
sbf_get_config_value(),
sbf_list_tables_pg(),
sbf_load_data_from_pg(),
sbf_load_datas_from_pg(),
sbf_open_pg(),
sbf_reset_config_file(),
sbf_reset_config_value(),
sbf_reset_schema(),
sbf_save_data_to_pg(),
sbf_set_config_file(),
sbf_set_config_value(),
sbf_set_schema()
## Not run: sbf_get_schema() ## End(Not run)## Not run: sbf_get_schema() ## End(Not run)
Get Sub Folder
sbf_get_sub()sbf_get_sub()
A string specifying the current sub folder.
Other directory functions:
sbf_add_sub(),
sbf_get_archive(),
sbf_get_db_name(),
sbf_get_main(),
sbf_get_workbook_name(),
sbf_reset(),
sbf_reset_db_name(),
sbf_reset_main(),
sbf_reset_sub(),
sbf_set_db_name(),
sbf_set_main(),
sbf_set_sub(),
sbf_up_sub()
sbf_set_sub("nameofsub") sbf_get_sub() sbf_reset_sub()sbf_set_sub("nameofsub") sbf_get_sub() sbf_reset_sub()
Gets the basename of the current working directory
sbf_get_workbook_name()sbf_get_workbook_name()
A string specifying the name of the current working directory
Other excel:
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_workbook()
Other directory functions:
sbf_add_sub(),
sbf_get_archive(),
sbf_get_db_name(),
sbf_get_main(),
sbf_get_sub(),
sbf_reset(),
sbf_reset_db_name(),
sbf_reset_main(),
sbf_reset_sub(),
sbf_set_db_name(),
sbf_set_main(),
sbf_set_sub(),
sbf_up_sub()
sbf_get_workbook_name()sbf_get_workbook_name()
Test if data is equal using all.equal().
If doesn't exist returns FALSE, unless exists = FALSE in which case returns
TRUE or exists = NA in which case returns NA.
sbf_is_equal_data( x, x_name = substitute(x), sub = sbf_get_sub(), main = sbf_get_main(), exists = TRUE, tolerance = sqrt(.Machine$double.eps), check.attributes = TRUE )sbf_is_equal_data( x, x_name = substitute(x), sub = sbf_get_sub(), main = sbf_get_main(), exists = TRUE, tolerance = sqrt(.Machine$double.eps), check.attributes = TRUE )
x |
The object to save. |
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
exists |
A logical scalar specifying whether the file should exist. |
tolerance |
numeric |
check.attributes |
logical indicating if the
|
A named flag.
Other compare functions:
sbf_compare_data(),
sbf_compare_data_archive(),
sbf_diff_data(),
sbf_diff_data_archive(),
sbf_diff_table(),
sbf_is_equal_data_archive()
Test if existing data are equal to archived data using all.equal().
If doesn't exist in both returns FALSE, unless exists = FALSE in which case
returns TRUE or exists = NA in which case returns NA.
sbf_is_equal_data_archive( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), archive = 1L, recursive = FALSE, include_root = TRUE, exists = TRUE, tolerance = sqrt(.Machine$double.eps), check.attributes = TRUE )sbf_is_equal_data_archive( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), archive = 1L, recursive = FALSE, include_root = TRUE, exists = TRUE, tolerance = sqrt(.Machine$double.eps), check.attributes = TRUE )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
archive |
A positive whole number specifying the folder archived folder where 1L (the default) indicates the most recently archived folder or a character string of the path to the archived folder. |
recursive |
A flag specifying whether to recurse into subfolders. |
include_root |
A flag indicating whether to include objects in the top sub folder. |
exists |
A logical scalar specifying whether the file should exist. |
tolerance |
numeric |
check.attributes |
logical indicating if the
|
A named logical vector.
Other compare functions:
sbf_compare_data(),
sbf_compare_data_archive(),
sbf_diff_data(),
sbf_diff_data_archive(),
sbf_diff_table(),
sbf_is_equal_data()
Returns file paths for all block files matching regular expression x_name.
sbf_list_blocks( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), recursive = FALSE, include_root = TRUE, ext = "rds" )sbf_list_blocks( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), recursive = FALSE, include_root = TRUE, ext = "rds" )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
recursive |
A flag specifying whether to recurse into subfolders. |
include_root |
A flag indicating whether to include objects in the top sub folder. |
ext |
A string of the file extension. |
Other list functions:
sbf_list_datas(),
sbf_list_dbs(),
sbf_list_numbers(),
sbf_list_objects(),
sbf_list_plots(),
sbf_list_strings(),
sbf_list_tables(),
sbf_list_windows()
Returns file paths for all data files matching regular expression x_name.
sbf_list_datas( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), recursive = FALSE, include_root = TRUE, ext = "rds" )sbf_list_datas( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), recursive = FALSE, include_root = TRUE, ext = "rds" )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
recursive |
A flag specifying whether to recurse into subfolders. |
include_root |
A flag indicating whether to include objects in the top sub folder. |
ext |
A string of the file extension. |
Other list functions:
sbf_list_blocks(),
sbf_list_dbs(),
sbf_list_numbers(),
sbf_list_objects(),
sbf_list_plots(),
sbf_list_strings(),
sbf_list_tables(),
sbf_list_windows()
Returns file paths for all database files matching regular expression x_name.
sbf_list_dbs( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), recursive = FALSE, include_root = TRUE, ext = "sqlite" )sbf_list_dbs( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), recursive = FALSE, include_root = TRUE, ext = "sqlite" )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
recursive |
A flag specifying whether to recurse into subfolders. |
include_root |
A flag indicating whether to include objects in the top sub folder. |
ext |
A string of the file extension. |
Other list functions:
sbf_list_blocks(),
sbf_list_datas(),
sbf_list_numbers(),
sbf_list_objects(),
sbf_list_plots(),
sbf_list_strings(),
sbf_list_tables(),
sbf_list_windows()
Returns file paths for all number .rds files matching regular expression x_name.
sbf_list_numbers( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), recursive = FALSE, include_root = TRUE, ext = "rds" )sbf_list_numbers( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), recursive = FALSE, include_root = TRUE, ext = "rds" )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
recursive |
A flag specifying whether to recurse into subfolders. |
include_root |
A flag indicating whether to include objects in the top sub folder. |
ext |
A string of the file extension. |
Other list functions:
sbf_list_blocks(),
sbf_list_datas(),
sbf_list_dbs(),
sbf_list_objects(),
sbf_list_plots(),
sbf_list_strings(),
sbf_list_tables(),
sbf_list_windows()
Returns file paths for all object files matching regular expression x_name.
sbf_list_objects( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), recursive = FALSE, include_root = TRUE, ext = "rds" )sbf_list_objects( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), recursive = FALSE, include_root = TRUE, ext = "rds" )
x_name |
A Perl-compatible regular expression of the object names to match. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
recursive |
A flag specifying whether to recurse into subfolders. |
include_root |
A flag indicating whether to include objects in the top sub folder. |
ext |
A string of the file extension. |
Other list functions:
sbf_list_blocks(),
sbf_list_datas(),
sbf_list_dbs(),
sbf_list_numbers(),
sbf_list_plots(),
sbf_list_strings(),
sbf_list_tables(),
sbf_list_windows()
Returns file paths for all plot files matching regular expression x_name.
sbf_list_plots( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), recursive = FALSE, include_root = TRUE, ext = "rds" )sbf_list_plots( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), recursive = FALSE, include_root = TRUE, ext = "rds" )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
recursive |
A flag specifying whether to recurse into subfolders. |
include_root |
A flag indicating whether to include objects in the top sub folder. |
ext |
A string of the file extension. |
Other list functions:
sbf_list_blocks(),
sbf_list_datas(),
sbf_list_dbs(),
sbf_list_numbers(),
sbf_list_objects(),
sbf_list_strings(),
sbf_list_tables(),
sbf_list_windows()
Returns file paths for all string .rds files matching regular expression x_name.
sbf_list_strings( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), recursive = FALSE, include_root = TRUE, ext = "rds" )sbf_list_strings( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), recursive = FALSE, include_root = TRUE, ext = "rds" )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
recursive |
A flag specifying whether to recurse into subfolders. |
include_root |
A flag indicating whether to include objects in the top sub folder. |
ext |
A string of the file extension. |
Other list functions:
sbf_list_blocks(),
sbf_list_datas(),
sbf_list_dbs(),
sbf_list_numbers(),
sbf_list_objects(),
sbf_list_plots(),
sbf_list_tables(),
sbf_list_windows()
Returns file paths for table files matching regular expression x_name.
sbf_list_tables( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), recursive = FALSE, include_root = TRUE, ext = "rds" )sbf_list_tables( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), recursive = FALSE, include_root = TRUE, ext = "rds" )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
recursive |
A flag specifying whether to recurse into subfolders. |
include_root |
A flag indicating whether to include objects in the top sub folder. |
ext |
A string of the file extension. |
Other list functions:
sbf_list_blocks(),
sbf_list_datas(),
sbf_list_dbs(),
sbf_list_numbers(),
sbf_list_objects(),
sbf_list_plots(),
sbf_list_strings(),
sbf_list_windows()
sbf_list_tables_pg() was moved to subfoldr2ext::sbfx_list_tables_pg().
This function lists all the tables in a schema.
sbf_list_tables_pg( schema = getOption("psql.schema", "public"), config_path = getOption("psql.config_path", NULL), config_value = getOption("psql.config_value", "default") )sbf_list_tables_pg( schema = getOption("psql.schema", "public"), config_path = getOption("psql.config_path", NULL), config_value = getOption("psql.config_value", "default") )
schema |
A string of the schema name. Default value is |
config_path |
A string of a file path to the yaml configuration file.
The default value grabs the file path from the psql.config_path option
and uses |
config_value |
A string of the name of value. The default value grabs
the value from the psql.config_value option and uses |
Wrapper on psql::psql_list_tables()
A vector of table names
Other postgresql functions:
sbf_backup_pg(),
sbf_close_pg(),
sbf_create_pg(),
sbf_execute_pg(),
sbf_get_config_file(),
sbf_get_config_value(),
sbf_get_schema(),
sbf_load_data_from_pg(),
sbf_load_datas_from_pg(),
sbf_open_pg(),
sbf_reset_config_file(),
sbf_reset_config_value(),
sbf_reset_schema(),
sbf_save_data_to_pg(),
sbf_set_config_file(),
sbf_set_config_value(),
sbf_set_schema()
## Not run: sbf_list_tables_pg( "boat_count" ) sbf_list_tables_pg() ## End(Not run)## Not run: sbf_list_tables_pg( "boat_count" ) sbf_list_tables_pg() ## End(Not run)
Returns file paths for all window files matching regular expression x_name.
sbf_list_windows( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), recursive = FALSE, include_root = TRUE, ext = "png" )sbf_list_windows( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), recursive = FALSE, include_root = TRUE, ext = "png" )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
recursive |
A flag specifying whether to recurse into subfolders. |
include_root |
A flag indicating whether to include objects in the top sub folder. |
ext |
A string of the file extension. |
Other list functions:
sbf_list_blocks(),
sbf_list_datas(),
sbf_list_dbs(),
sbf_list_numbers(),
sbf_list_objects(),
sbf_list_plots(),
sbf_list_strings(),
sbf_list_tables()
Load Code Block
sbf_load_block( x_name, sub = sbf_get_sub(), main = sbf_get_main(), exists = TRUE )sbf_load_block( x_name, sub = sbf_get_sub(), main = sbf_get_main(), exists = TRUE )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
exists |
A logical scalar specifying whether the file should exist. |
A code block or NULL if doesn't exist.
Other load functions:
load_rdss_recursive(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Load Blocks
sbf_load_blocks( sub = sbf_get_sub(), main = sbf_get_main(), rename = identity, env = parent.frame(), x_name = ".*" )sbf_load_blocks( sub = sbf_get_sub(), main = sbf_get_main(), rename = identity, env = parent.frame(), x_name = ".*" )
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
rename |
A single function argument which takes a character vector and returns a character vector of the same length. Used to rename objects before they are loaded into the environment. |
env |
The environment to load the objects into |
x_name |
A string of the Perl-compatible regular expression to match. |
An invisible character vector of the blocks' names.
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Recursively loads all the code blocks with names matching the regular expression x_name as the first character column (named blocks) in a data frame. Subsequent character vector columns specify the object names (named name) and sub folders (named sub1, sub2 etc).
sbf_load_blocks_recursive( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE, tag = ".*", meta = FALSE, drop = NULL, quiet = getOption("sbf.quiet", TRUE) )sbf_load_blocks_recursive( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE, tag = ".*", meta = FALSE, drop = NULL, quiet = getOption("sbf.quiet", TRUE) )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
include_root |
A flag indicating whether to include objects in the top sub folder. |
tag |
A string of the regular expression that the tag must match to be included. |
meta |
A flag specifying whether to include the report, caption and any other metadata as columns. |
drop |
A character vector specifying the names of sub folders
and files to drop or |
quiet |
A flag indicating whether messages should be silenced.
Warnings are still returned regardless.
Can be set globally using the option |
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Load Data
sbf_load_data( x_name, sub = sbf_get_sub(), main = sbf_get_main(), exists = TRUE )sbf_load_data( x_name, sub = sbf_get_sub(), main = sbf_get_main(), exists = TRUE )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
exists |
A logical scalar specifying whether the file should exist. |
A data frame or NULL if doesn't exist.
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Load Data Frame from Database
sbf_load_data_from_db( x_name, db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main() )sbf_load_data_from_db( x_name, db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main() )
x_name |
A string of the name. |
db_name |
A string of the database name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
A data.frame of the table.
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
sbf_load_data_from_pg() was moved to subfoldr2ext::sbfx_load_data_from_pg().
Read/load a table from a PostgreSQL database as a data frame into R.
sbf_load_data_from_pg( x, schema = getOption("psql.schema", "public"), config_path = getOption("psql.config_path", NULL), config_value = getOption("psql.config_value", "default") )sbf_load_data_from_pg( x, schema = getOption("psql.schema", "public"), config_path = getOption("psql.config_path", NULL), config_value = getOption("psql.config_value", "default") )
x |
A string of the table name |
schema |
A string of the schema name. Default value is |
config_path |
A string of a file path to the yaml configuration file.
The default value grabs the file path from the psql.config_path option
and uses |
config_value |
A string of the name of value. The default value grabs
the value from the psql.config_value option and uses |
Wrapper on psql::psql_read_table()
A data frame
Other postgresql functions:
sbf_backup_pg(),
sbf_close_pg(),
sbf_create_pg(),
sbf_execute_pg(),
sbf_get_config_file(),
sbf_get_config_value(),
sbf_get_schema(),
sbf_list_tables_pg(),
sbf_load_datas_from_pg(),
sbf_open_pg(),
sbf_reset_config_file(),
sbf_reset_config_value(),
sbf_reset_schema(),
sbf_save_data_to_pg(),
sbf_set_config_file(),
sbf_set_config_value(),
sbf_set_schema()
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
## Not run: sbf_load_data_from_pg("capture") sbf_load_data_from_pg("counts", "boat_count") ## End(Not run)## Not run: sbf_load_data_from_pg("capture") sbf_load_data_from_pg("counts", "boat_count") ## End(Not run)
Load Datas
sbf_load_datas( sub = sbf_get_sub(), main = sbf_get_main(), rename = identity, env = parent.frame(), x_name = ".*" )sbf_load_datas( sub = sbf_get_sub(), main = sbf_get_main(), rename = identity, env = parent.frame(), x_name = ".*" )
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
rename |
A single function argument which takes a character vector and returns a character vector of the same length. Used to rename objects before they are loaded into the environment. |
env |
The environment to load the objects into |
x_name |
A string of the Perl-compatible regular expression to match. |
An invisible character vector of the data frames' names.
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
## Not run: sbf_set_main(file.path(tempdir(), "output")) outing <- data.frame(x = 1) capture <- data.frame(x = 2) captures <- data.frame(x = 3) sbf_save_datas() # matches anywhere in the name sbf_load_datas(x_name = "capture") # capture, captures # ^ and $ match the whole name sbf_load_datas(x_name = "^capture$") # capture sbf_load_datas(x_name = "^(outing|capture)$") # capture, outing # (?! ) excludes names sbf_load_datas(x_name = "^(?!capture$)") # captures, outing sbf_reset() ## End(Not run)## Not run: sbf_set_main(file.path(tempdir(), "output")) outing <- data.frame(x = 1) capture <- data.frame(x = 2) captures <- data.frame(x = 3) sbf_save_datas() # matches anywhere in the name sbf_load_datas(x_name = "capture") # capture, captures # ^ and $ match the whole name sbf_load_datas(x_name = "^capture$") # capture sbf_load_datas(x_name = "^(outing|capture)$") # capture, outing # (?! ) excludes names sbf_load_datas(x_name = "^(?!capture$)") # captures, outing sbf_reset() ## End(Not run)
By default all tables are loaded. If x_name is specified, only the
matching tables are read from the database.
sbf_load_datas_from_db( db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main(), rename = identity, env = parent.frame(), x_name = ".*" )sbf_load_datas_from_db( db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main(), rename = identity, env = parent.frame(), x_name = ".*" )
db_name |
A string of the database name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
rename |
A single function argument which takes a character vector and returns a character vector of the same length. Used to rename objects before they are loaded into the environment. |
env |
The environment to load the objects into |
x_name |
A string of the Perl-compatible regular expression to match. |
An invisible character vector of the names of the loaded tables.
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
sbf_load_datas_from_pg() was moved to subfoldr2ext::sbfx_load_datas_from_pg().
Load all the tables in a schema as data frames into your environment from a PostgreSQL database.
sbf_load_datas_from_pg( schema = getOption("psql.schema", "public"), rename = identity, env = parent.frame(), config_path = getOption("psql.config_path", NULL), config_value = getOption("psql.config_value", "default") )sbf_load_datas_from_pg( schema = getOption("psql.schema", "public"), rename = identity, env = parent.frame(), config_path = getOption("psql.config_path", NULL), config_value = getOption("psql.config_value", "default") )
schema |
A string of the schema name. Default value is |
rename |
A single function argument which takes a character vector and returns a character vector of the same length. Used to rename objects before they are loaded into the environment. |
env |
The environment to load the objects into |
config_path |
A string of a file path to the yaml configuration file.
The default value grabs the file path from the psql.config_path option
and uses |
config_value |
A string of the name of value. The default value grabs
the value from the psql.config_value option and uses |
An invisible character vector of the paths to the saved objects.
Other postgresql functions:
sbf_backup_pg(),
sbf_close_pg(),
sbf_create_pg(),
sbf_execute_pg(),
sbf_get_config_file(),
sbf_get_config_value(),
sbf_get_schema(),
sbf_list_tables_pg(),
sbf_load_data_from_pg(),
sbf_open_pg(),
sbf_reset_config_file(),
sbf_reset_config_value(),
sbf_reset_schema(),
sbf_save_data_to_pg(),
sbf_set_config_file(),
sbf_set_config_value(),
sbf_set_schema()
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
## Not run: sbf_load_datas_from_pg() sbf_load_datas_from_pg(schema = "capture") sbf_load_datas_from_pg(rename = toupper) ## End(Not run)## Not run: sbf_load_datas_from_pg() sbf_load_datas_from_pg(schema = "capture") sbf_load_datas_from_pg(rename = toupper) ## End(Not run)
Recursively loads all the data frames with names matching the regular expression x_name as the first (list) column (named data) in a data frame. Subsequent character vector columns specify the object names (named name) and sub folders (named sub1, sub2 etc).
sbf_load_datas_recursive( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE, drop = NULL, quiet = getOption("sbf.quiet", TRUE) )sbf_load_datas_recursive( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE, drop = NULL, quiet = getOption("sbf.quiet", TRUE) )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
include_root |
A flag indicating whether to include objects in the top sub folder. |
drop |
A character vector specifying the names of sub folders
and files to drop or |
quiet |
A flag indicating whether messages should be silenced.
Warnings are still returned regardless.
Can be set globally using the option |
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Load Data Frame of Meta Table from Database
sbf_load_db_metatable( db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main() )sbf_load_db_metatable( db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main() )
db_name |
A string of the database name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
A data.frame of the table.
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Load Number
sbf_load_number( x_name, sub = sbf_get_sub(), main = sbf_get_main(), exists = TRUE )sbf_load_number( x_name, sub = sbf_get_sub(), main = sbf_get_main(), exists = TRUE )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
exists |
A logical scalar specifying whether the file should exist. |
A number or NULL if doesn't exist.
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Load Numbers
sbf_load_numbers( sub = sbf_get_sub(), main = sbf_get_main(), rename = identity, env = parent.frame(), x_name = ".*" )sbf_load_numbers( sub = sbf_get_sub(), main = sbf_get_main(), rename = identity, env = parent.frame(), x_name = ".*" )
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
rename |
A single function argument which takes a character vector and returns a character vector of the same length. Used to rename objects before they are loaded into the environment. |
env |
The environment to load the objects into |
x_name |
A string of the Perl-compatible regular expression to match. |
An invisible character vector of the numbers' names.
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Recursively loads all the numbers with names matching the regular expression x_name as the first double column (named numbers) in a data frame. Subsequent character vector columns specify the object names (named name) and sub folders (named sub1, sub2 etc).
sbf_load_numbers_recursive( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE, tag = ".*", meta = FALSE, drop = NULL, quiet = getOption("sbf.quiet", TRUE) )sbf_load_numbers_recursive( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE, tag = ".*", meta = FALSE, drop = NULL, quiet = getOption("sbf.quiet", TRUE) )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
include_root |
A flag indicating whether to include objects in the top sub folder. |
tag |
A string of the regular expression that the tag must match to be included. |
meta |
A flag specifying whether to include the report, caption and any other metadata as columns. |
drop |
A character vector specifying the names of sub folders
and files to drop or |
quiet |
A flag indicating whether messages should be silenced.
Warnings are still returned regardless.
Can be set globally using the option |
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Load Object
sbf_load_object( x_name, sub = sbf_get_sub(), main = sbf_get_main(), exists = TRUE )sbf_load_object( x_name, sub = sbf_get_sub(), main = sbf_get_main(), exists = TRUE )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
exists |
A logical scalar specifying whether the file should exist. |
An R object or NULL if doesn't exist.
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Load Objects
sbf_load_objects( sub = sbf_get_sub(), main = sbf_get_main(), rename = identity, env = parent.frame(), x_name = ".*" )sbf_load_objects( sub = sbf_get_sub(), main = sbf_get_main(), rename = identity, env = parent.frame(), x_name = ".*" )
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
rename |
A single function argument which takes a character vector and returns a character vector of the same length. Used to rename objects before they are loaded into the environment. |
env |
The environment to load the objects into |
x_name |
A string of the Perl-compatible regular expression to match. |
An invisible character vector of the objects' names.
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Recursively loads all the objects with names matching the regular expression x_name as the the first (list) column (named objects) in a data frame. Subsequent character vector columns specify the object names (named name) and sub folders (named sub1, sub2 etc).
sbf_load_objects_recursive( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE, drop = NULL, quiet = getOption("sbf.quiet", TRUE) )sbf_load_objects_recursive( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE, drop = NULL, quiet = getOption("sbf.quiet", TRUE) )
x_name |
A string of the Perl-compatible regular expression to match. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
include_root |
A flag indicating whether to include objects in the top sub folder. |
drop |
A character vector specifying the names of sub folders
and files to drop or |
quiet |
A flag indicating whether messages should be silenced.
Warnings are still returned regardless.
Can be set globally using the option |
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Load Plot
sbf_load_plot( x_name, sub = sbf_get_sub(), main = sbf_get_main(), exists = TRUE )sbf_load_plot( x_name, sub = sbf_get_sub(), main = sbf_get_main(), exists = TRUE )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
exists |
A logical scalar specifying whether the file should exist. |
A ggplot object or NULL if doesn't exist.
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Load Plot Data
sbf_load_plot_data( x_name, sub = sbf_get_sub(), main = sbf_get_main(), exists = TRUE )sbf_load_plot_data( x_name, sub = sbf_get_sub(), main = sbf_get_main(), exists = TRUE )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
exists |
A logical scalar specifying whether the file should exist. |
A data.frame or NULL if doesn't exist.
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Loads the lines of the .md file of the data of a plot saved by
sbf_save_plot().
sbf_load_plot_md( x_name, sub = sbf_get_sub(), main = sbf_get_main(), entities = FALSE, exists = TRUE )sbf_load_plot_md( x_name, sub = sbf_get_sub(), main = sbf_get_main(), entities = FALSE, exists = TRUE )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
entities |
A flag specifying whether to replace the spaces that align
the decimal points of numeric columns with the HTML entities for figure
( |
exists |
A logical scalar specifying whether the file should exist. |
A character vector of the lines of the plot data in markdown format or NULL if doesn't exist.
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Load Plots Data
sbf_load_plots_data( sub = sbf_get_sub(), main = sbf_get_main(), rename = identity, env = parent.frame(), x_name = ".*" )sbf_load_plots_data( sub = sbf_get_sub(), main = sbf_get_main(), rename = identity, env = parent.frame(), x_name = ".*" )
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
rename |
A single function argument which takes a character vector and returns a character vector of the same length. Used to rename objects before they are loaded into the environment. |
env |
The environment to load the objects into |
x_name |
A string of the Perl-compatible regular expression to match. |
An invisible character vector of the plots' names.
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Recursively loads all the default data from the plots with names matching the regular expression x_name as the first (list) column (named plots_data) in a data frame. Subsequent character vector columns specify the object names (named name) and sub folders (named sub1, sub2 etc).
sbf_load_plots_data_recursive( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE, tag = ".*", meta = FALSE, drop = NULL, quiet = getOption("sbf.quiet", TRUE) )sbf_load_plots_data_recursive( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE, tag = ".*", meta = FALSE, drop = NULL, quiet = getOption("sbf.quiet", TRUE) )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
include_root |
A flag indicating whether to include objects in the top sub folder. |
tag |
A string of the regular expression that the tag must match to be included. |
meta |
A flag specifying whether to include the report, caption and any other metadata as columns. |
drop |
A character vector specifying the names of sub folders
and files to drop or |
quiet |
A flag indicating whether messages should be silenced.
Warnings are still returned regardless.
Can be set globally using the option |
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Recursively loads all the plots with names matching the regular expression x_name as the first (list) column (named plots) in a data frame. Subsequent character vector columns specify the object names (named name) and sub folders (named sub1, sub2 etc).
sbf_load_plots_recursive( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE, tag = ".*", meta = FALSE, drop = NULL, quiet = getOption("sbf.quiet", TRUE) )sbf_load_plots_recursive( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE, tag = ".*", meta = FALSE, drop = NULL, quiet = getOption("sbf.quiet", TRUE) )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
include_root |
A flag indicating whether to include objects in the top sub folder. |
tag |
A string of the regular expression that the tag must match to be included. |
meta |
A flag specifying whether to include the report, caption and any other metadata as columns. |
drop |
A character vector specifying the names of sub folders
and files to drop or |
quiet |
A flag indicating whether messages should be silenced.
Warnings are still returned regardless.
Can be set globally using the option |
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Loads an sf tbl that must meet the same requirements as sbf_save_spatial.
sbf_load_spatial( x_name, sub = sbf_get_sub(), main = sbf_get_main(), exists = TRUE )sbf_load_spatial( x_name, sub = sbf_get_sub(), main = sbf_get_main(), exists = TRUE )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
exists |
A logical scalar specifying whether the file should exist. |
An sf tbl or NULL if doesn't exist.
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Loads sf tbls that must meet the same requirements as sbf_save_spatials.
sbf_load_spatials( sub = sbf_get_sub(), main = sbf_get_main(), rename = identity, env = parent.frame(), x_name = ".*" )sbf_load_spatials( sub = sbf_get_sub(), main = sbf_get_main(), rename = identity, env = parent.frame(), x_name = ".*" )
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
rename |
A single function argument which takes a character vector and returns a character vector of the same length. Used to rename objects before they are loaded into the environment. |
env |
The environment to load the objects into |
x_name |
A string of the Perl-compatible regular expression to match. |
An invisible character vector of the data frames' names.
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Load String
sbf_load_string( x_name, sub = sbf_get_sub(), main = sbf_get_main(), exists = TRUE )sbf_load_string( x_name, sub = sbf_get_sub(), main = sbf_get_main(), exists = TRUE )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
exists |
A logical scalar specifying whether the file should exist. |
A string or NULL if doesn't exist.
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Load Strings
sbf_load_strings( sub = sbf_get_sub(), main = sbf_get_main(), rename = identity, env = parent.frame(), x_name = ".*" )sbf_load_strings( sub = sbf_get_sub(), main = sbf_get_main(), rename = identity, env = parent.frame(), x_name = ".*" )
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
rename |
A single function argument which takes a character vector and returns a character vector of the same length. Used to rename objects before they are loaded into the environment. |
env |
The environment to load the objects into |
x_name |
A string of the Perl-compatible regular expression to match. |
An invisible character vector of the strings' names.
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Recursively loads all the numbers with names matching the regular expression x_name as the first character column (named strings) in a data frame. Subsequent character vector columns specify the object names (named name) and sub folders (named sub1, sub2 etc).
sbf_load_strings_recursive( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE, tag = ".*", meta = FALSE, drop = NULL, quiet = getOption("sbf.quiet", TRUE) )sbf_load_strings_recursive( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE, tag = ".*", meta = FALSE, drop = NULL, quiet = getOption("sbf.quiet", TRUE) )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
include_root |
A flag indicating whether to include objects in the top sub folder. |
tag |
A string of the regular expression that the tag must match to be included. |
meta |
A flag specifying whether to include the report, caption and any other metadata as columns. |
drop |
A character vector specifying the names of sub folders
and files to drop or |
quiet |
A flag indicating whether messages should be silenced.
Warnings are still returned regardless.
Can be set globally using the option |
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Load Table
sbf_load_table( x_name, sub = sbf_get_sub(), main = sbf_get_main(), exists = TRUE )sbf_load_table( x_name, sub = sbf_get_sub(), main = sbf_get_main(), exists = TRUE )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
exists |
A logical scalar specifying whether the file should exist. |
A data frame or NULL if doesn't exist.
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Loads the lines of the .md file of a table saved by sbf_save_table().
sbf_load_table_md( x_name, sub = sbf_get_sub(), main = sbf_get_main(), entities = FALSE, exists = TRUE )sbf_load_table_md( x_name, sub = sbf_get_sub(), main = sbf_get_main(), entities = FALSE, exists = TRUE )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
entities |
A flag specifying whether to replace the spaces that align
the decimal points of numeric columns with the HTML entities for figure
( |
exists |
A logical scalar specifying whether the file should exist. |
A character vector of the lines of the table in markdown format or NULL if doesn't exist.
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Load Tables
sbf_load_tables( sub = sbf_get_sub(), main = sbf_get_main(), rename = identity, env = parent.frame(), x_name = ".*" )sbf_load_tables( sub = sbf_get_sub(), main = sbf_get_main(), rename = identity, env = parent.frame(), x_name = ".*" )
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
rename |
A single function argument which takes a character vector and returns a character vector of the same length. Used to rename objects before they are loaded into the environment. |
env |
The environment to load the objects into |
x_name |
A string of the Perl-compatible regular expression to match. |
An invisible character vector of the data frames' names.
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Recursively loads all the data frames with names matching the regular expression x_name as the first (list) column (named tables) in a data frame. Subsequent character vector columns specify the object names (named name) and sub folders (named sub1, sub2 etc).
sbf_load_tables_recursive( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE, tag = ".*", meta = FALSE, drop = NULL, quiet = getOption("sbf.quiet", TRUE) )sbf_load_tables_recursive( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE, tag = ".*", meta = FALSE, drop = NULL, quiet = getOption("sbf.quiet", TRUE) )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
include_root |
A flag indicating whether to include objects in the top sub folder. |
tag |
A string of the regular expression that the tag must match to be included. |
meta |
A flag specifying whether to include the report, caption and any other metadata as columns. |
drop |
A character vector specifying the names of sub folders
and files to drop or |
quiet |
A flag indicating whether messages should be silenced.
Warnings are still returned regardless.
Can be set globally using the option |
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Recursively loads all the paths to the png files with names matching the regular expression x_name as the the first (list) column (named windows) in a data frame. Subsequent character vector columns specify the object names (named name) and sub folders (named sub1, sub2 etc).
sbf_load_windows_recursive( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE, tag = ".*", meta = FALSE, drop = NULL, quiet = getOption("sbf.quiet", TRUE) )sbf_load_windows_recursive( x_name = ".*", sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE, tag = ".*", meta = FALSE, drop = NULL, quiet = getOption("sbf.quiet", TRUE) )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
include_root |
A flag indicating whether to include objects in the top sub folder. |
tag |
A string of the regular expression that the tag must match to be included. |
meta |
A flag specifying whether to include the report, caption and any other metadata as columns. |
drop |
A character vector specifying the names of sub folders
and files to drop or |
quiet |
A flag indicating whether messages should be silenced.
Warnings are still returned regardless.
Can be set globally using the option |
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
this function is now deprecated as of version 0.0.0.9045
sbf_number_exists(x_name, sub = sbf_get_sub(), main = sbf_get_main())sbf_number_exists(x_name, sub = sbf_get_sub(), main = sbf_get_main())
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
A flag specifying whether the number exists.
Other exists functions:
sbf_block_exists(),
sbf_data_exists(),
sbf_object_exists(),
sbf_plot_exists(),
sbf_string_exists(),
sbf_table_exists()
this function is now deprecated as of version 0.0.0.9045
sbf_object_exists(x_name, sub = sbf_get_sub(), main = sbf_get_main())sbf_object_exists(x_name, sub = sbf_get_sub(), main = sbf_get_main())
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
A flag specifying whether the object exists.
Other exists functions:
sbf_block_exists(),
sbf_data_exists(),
sbf_number_exists(),
sbf_plot_exists(),
sbf_string_exists(),
sbf_table_exists()
Opens a SQLiteConnection to a SQLite database. Foreign key constraints are enabled.
sbf_open_db( db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main(), exists = TRUE, caption = NULL, report = NA, tag = NULL, ask = getOption("sbf.ask", TRUE) )sbf_open_db( db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main(), exists = TRUE, caption = NULL, report = NA, tag = NULL, ask = getOption("sbf.ask", TRUE) )
db_name |
A string of the database name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
exists |
A logical scalar specifying whether the database must already exist. |
caption |
A string specifying the database metadata table caption. If NULL the caption is unchanged. If the caption is not specified for a databases it is set to be "". Deprecated. |
report |
A logical scalar specifying whether to include the database metadata table in the report. If report = NA the setting is not changed. Soft-deprecated. If the report status is not specified for a databases it is included in the report. deprecated. |
tag |
A string of the tag. Deprecated. |
ask |
A flag specifying whether to ask before deleting an existing database (if exists = FALSE). |
Other database functions:
sbf_add_blob_column_to_db(),
sbf_close_db(),
sbf_copy_db(),
sbf_create_db(),
sbf_execute_db(),
sbf_query_db(),
sbf_upload_flobs_to_db()
Opens a pdf device in the current pdfs subfolder using
grDevices::[pdf][grDevices::pdf]().
sbf_open_pdf( x_name = "plots", sub = sbf_get_sub(), main = sbf_get_main(), width = 6, height = width )sbf_open_pdf( x_name = "plots", sub = sbf_get_sub(), main = sbf_get_main(), width = 6, height = width )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
width |
A positive number indicating the width in inches. |
height |
A positive number indicating the height in inches. |
Other graphic functions:
sbf_close_pdf(),
sbf_close_window(),
sbf_close_windows(),
sbf_open_window()
sbf_open_pg() was moved to subfoldr2ext::sbfx_open_pg().
Connect to a PostgreSQL database with a config.yml file.
sbf_open_pg( config_path = getOption("psql.config_path", NULL), config_value = getOption("psql.config_value", "default") )sbf_open_pg( config_path = getOption("psql.config_path", NULL), config_value = getOption("psql.config_value", "default") )
config_path |
A string of a file path to the yaml configuration file.
The default value grabs the file path from the psql.config_path option
and uses |
config_value |
A string of the name of value. The default value grabs
the value from the psql.config_value option and uses |
Wrapper on psql::psql_connect()
An S4 object that inherits from DBIConnection.
Other postgresql functions:
sbf_backup_pg(),
sbf_close_pg(),
sbf_create_pg(),
sbf_execute_pg(),
sbf_get_config_file(),
sbf_get_config_value(),
sbf_get_schema(),
sbf_list_tables_pg(),
sbf_load_data_from_pg(),
sbf_load_datas_from_pg(),
sbf_reset_config_file(),
sbf_reset_config_value(),
sbf_reset_schema(),
sbf_save_data_to_pg(),
sbf_set_config_file(),
sbf_set_config_value(),
sbf_set_schema()
## Not run: conn <- sbf_open_pg() sbf_close_pg(conn) sbf_open_pg("config.yml") sbf_close_pg(conn) sbf_open_pg(config_path = "config.yml", config_value = "database") sbf_close_pg(conn) ## End(Not run)## Not run: conn <- sbf_open_pg() sbf_close_pg(conn) sbf_open_pg("config.yml") sbf_close_pg(conn) sbf_open_pg(config_path = "config.yml", config_value = "database") sbf_close_pg(conn) ## End(Not run)
Opens a graphics window on any platform. By default the window is 6 x 6 inches.
sbf_open_window(width = 6, height = width)sbf_open_window(width = 6, height = width)
width |
A positive number of the plotting area width in inches. |
height |
A positive number of the plotting area height in inches. |
Other graphic functions:
sbf_close_pdf(),
sbf_close_window(),
sbf_close_windows(),
sbf_open_pdf()
Path to Code Block
sbf_path_block( x_name, sub = sbf_get_sub(), main = sbf_get_main(), ext = "rds", exists = NA )sbf_path_block( x_name, sub = sbf_get_sub(), main = sbf_get_main(), ext = "rds", exists = NA )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
ext |
A string specifying the extension. |
exists |
A logical scalar specifying whether the file should exist. |
A string indicating the path.
Path to Data
sbf_path_data( x_name, sub = sbf_get_sub(), main = sbf_get_main(), ext = "rds", exists = NA )sbf_path_data( x_name, sub = sbf_get_sub(), main = sbf_get_main(), ext = "rds", exists = NA )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
ext |
A string specifying the extension. |
exists |
A logical scalar specifying whether the file should exist. |
A string indicating the path.
Path to Database
sbf_path_db( x_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main(), ext = "sqlite", exists = NA )sbf_path_db( x_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main(), ext = "sqlite", exists = NA )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
ext |
A string specifying the extension. |
exists |
A logical scalar specifying whether the file should exist. |
A string indicating the path.
Path to Number
sbf_path_number( x_name, sub = sbf_get_sub(), main = sbf_get_main(), ext = "rds", exists = NA )sbf_path_number( x_name, sub = sbf_get_sub(), main = sbf_get_main(), ext = "rds", exists = NA )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
ext |
A string specifying the extension. |
exists |
A logical scalar specifying whether the file should exist. |
A string indicating the path.
Path to Object
sbf_path_object( x_name, sub = sbf_get_sub(), main = sbf_get_main(), ext = "rds", exists = NA )sbf_path_object( x_name, sub = sbf_get_sub(), main = sbf_get_main(), ext = "rds", exists = NA )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
ext |
A string specifying the extension. |
exists |
A logical scalar specifying whether the file should exist. |
A string indicating the path.
Path to Plot
sbf_path_plot( x_name, sub = sbf_get_sub(), main = sbf_get_main(), ext = "rds", exists = NA )sbf_path_plot( x_name, sub = sbf_get_sub(), main = sbf_get_main(), ext = "rds", exists = NA )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
ext |
A string specifying the extension. |
exists |
A logical scalar specifying whether the file should exist. |
A string indicating the path.
Path to String
sbf_path_string( x_name, sub = sbf_get_sub(), main = sbf_get_main(), ext = "rds", exists = NA )sbf_path_string( x_name, sub = sbf_get_sub(), main = sbf_get_main(), ext = "rds", exists = NA )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
ext |
A string specifying the extension. |
exists |
A logical scalar specifying whether the file should exist. |
A string indicating the path.
Path to Table
sbf_path_table( x_name, sub = sbf_get_sub(), main = sbf_get_main(), ext = "rds", exists = NA )sbf_path_table( x_name, sub = sbf_get_sub(), main = sbf_get_main(), ext = "rds", exists = NA )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
ext |
A string specifying the extension. |
exists |
A logical scalar specifying whether the file should exist. |
A string indicating the path.
Path to Window
sbf_path_window( x_name, sub = sbf_get_sub(), main = sbf_get_main(), ext = "png", exists = NA )sbf_path_window( x_name, sub = sbf_get_sub(), main = sbf_get_main(), ext = "png", exists = NA )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
ext |
A string specifying the extension. |
exists |
A logical scalar specifying whether the file should exist. |
A string indicating the path.
this function is now deprecated as of version 0.0.0.9045
sbf_plot_exists(x_name, sub = sbf_get_sub(), main = sbf_get_main())sbf_plot_exists(x_name, sub = sbf_get_sub(), main = sbf_get_main())
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
A flag specifying whether the plot exists.
Other exists functions:
sbf_block_exists(),
sbf_data_exists(),
sbf_number_exists(),
sbf_object_exists(),
sbf_string_exists(),
sbf_table_exists()
Retries printing a ggplot object if grid errors occurs.
sbf_print( x, newpage = is.null(vp), vp = NULL, ntry = getOption("sbf.ntry", 3L), plot = getOption("sbf.plot", TRUE) )sbf_print( x, newpage = is.null(vp), vp = NULL, ntry = getOption("sbf.ntry", 3L), plot = getOption("sbf.plot", TRUE) )
x |
An object to print. |
newpage |
draw new (empty) page first? |
vp |
viewport to draw plot in |
ntry |
A positive whole number specifying the number of tries. |
plot |
A flag indicating whether or not to print the plot. |
Grid errors include the text "cannot pop the top-level viewport" or "no applicable method for 'depth'"
Really just a wrapper on DBI::dbGetQuery().
sbf_query_db( sql, db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main() )sbf_query_db( sql, db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main() )
sql |
A string of the SQL statement to execute. |
db_name |
A string of the database name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
A scalar numeric of the number of rows affected by the statement.
Other database functions:
sbf_add_blob_column_to_db(),
sbf_close_db(),
sbf_copy_db(),
sbf_create_db(),
sbf_execute_db(),
sbf_open_db(),
sbf_upload_flobs_to_db()
Reset Main, Sub and Database Name
sbf_reset()sbf_reset()
An invisible NULL.
Other directory functions:
sbf_add_sub(),
sbf_get_archive(),
sbf_get_db_name(),
sbf_get_main(),
sbf_get_sub(),
sbf_get_workbook_name(),
sbf_reset_db_name(),
sbf_reset_main(),
sbf_reset_sub(),
sbf_set_db_name(),
sbf_set_main(),
sbf_set_sub(),
sbf_up_sub()
sbf_reset()sbf_reset()
sbf_reset_config_file() was moved to subfoldr2ext::sbfx_reset_config_file().
Reset the psql.config_path option to the default value.
sbf_reset_config_file()sbf_reset_config_file()
An invisible string of the default file path
Other postgresql functions:
sbf_backup_pg(),
sbf_close_pg(),
sbf_create_pg(),
sbf_execute_pg(),
sbf_get_config_file(),
sbf_get_config_value(),
sbf_get_schema(),
sbf_list_tables_pg(),
sbf_load_data_from_pg(),
sbf_load_datas_from_pg(),
sbf_open_pg(),
sbf_reset_config_value(),
sbf_reset_schema(),
sbf_save_data_to_pg(),
sbf_set_config_file(),
sbf_set_config_value(),
sbf_set_schema()
## Not run: sbf_reset_config_file() ## End(Not run)## Not run: sbf_reset_config_file() ## End(Not run)
sbf_reset_config_value() was moved to subfoldr2ext::sbfx_reset_config_value().
Reset the value for psql.config_value to the default value.
sbf_reset_config_value()sbf_reset_config_value()
An invisible string of the default file path
Other postgresql functions:
sbf_backup_pg(),
sbf_close_pg(),
sbf_create_pg(),
sbf_execute_pg(),
sbf_get_config_file(),
sbf_get_config_value(),
sbf_get_schema(),
sbf_list_tables_pg(),
sbf_load_data_from_pg(),
sbf_load_datas_from_pg(),
sbf_open_pg(),
sbf_reset_config_file(),
sbf_reset_schema(),
sbf_save_data_to_pg(),
sbf_set_config_file(),
sbf_set_config_value(),
sbf_set_schema()
## Not run: sbf_reset_config_value() ## End(Not run)## Not run: sbf_reset_config_value() ## End(Not run)
Sets database name option to 'database'.
sbf_reset_db_name()sbf_reset_db_name()
An invisible string of the 'database'.
Other directory functions:
sbf_add_sub(),
sbf_get_archive(),
sbf_get_db_name(),
sbf_get_main(),
sbf_get_sub(),
sbf_get_workbook_name(),
sbf_reset(),
sbf_reset_main(),
sbf_reset_sub(),
sbf_set_db_name(),
sbf_set_main(),
sbf_set_sub(),
sbf_up_sub()
sbf_reset_db_name()sbf_reset_db_name()
Reset Main
sbf_reset_main(rm = FALSE, ask = getOption("sbf.ask", TRUE))sbf_reset_main(rm = FALSE, ask = getOption("sbf.ask", TRUE))
rm |
A flag specifying whether to remove the folder and all its contents if it already exists. |
ask |
A flag specifying whether to ask before removing the existing folder. |
An invisible copy of the string "output".
Other reset:
sbf_reset_sub(),
sbf_rm_main()
Other directory functions:
sbf_add_sub(),
sbf_get_archive(),
sbf_get_db_name(),
sbf_get_main(),
sbf_get_sub(),
sbf_get_workbook_name(),
sbf_reset(),
sbf_reset_db_name(),
sbf_reset_sub(),
sbf_set_db_name(),
sbf_set_main(),
sbf_set_sub(),
sbf_up_sub()
sbf_reset_schema() was moved to subfoldr2ext::sbfx_reset_schema().
Reset schema name back to public
sbf_reset_schema()sbf_reset_schema()
An invisible string of the schema name the database is set to
Other postgresql functions:
sbf_backup_pg(),
sbf_close_pg(),
sbf_create_pg(),
sbf_execute_pg(),
sbf_get_config_file(),
sbf_get_config_value(),
sbf_get_schema(),
sbf_list_tables_pg(),
sbf_load_data_from_pg(),
sbf_load_datas_from_pg(),
sbf_open_pg(),
sbf_reset_config_file(),
sbf_reset_config_value(),
sbf_save_data_to_pg(),
sbf_set_config_file(),
sbf_set_config_value(),
sbf_set_schema()
## Not run: sbf_reset_schema() ## End(Not run)## Not run: sbf_reset_schema() ## End(Not run)
Reset Sub Folder
sbf_reset_sub(rm = FALSE, ask = getOption("sbf.ask", TRUE))sbf_reset_sub(rm = FALSE, ask = getOption("sbf.ask", TRUE))
rm |
A flag specifying whether to remove the folder and all its contents if it already exists. |
ask |
A flag specifying whether to ask before removing the existing folder. |
An invisible character vector of length 0.
Other reset:
sbf_reset_main(),
sbf_rm_main()
Other directory functions:
sbf_add_sub(),
sbf_get_archive(),
sbf_get_db_name(),
sbf_get_main(),
sbf_get_sub(),
sbf_get_workbook_name(),
sbf_reset(),
sbf_reset_db_name(),
sbf_reset_main(),
sbf_set_db_name(),
sbf_set_main(),
sbf_set_sub(),
sbf_up_sub()
sbf_set_sub("nameofsub") sbf_get_sub() sbf_reset_sub()sbf_set_sub("nameofsub") sbf_get_sub() sbf_reset_sub()
Delete Flobs Subdfolder
sbf_rm_flobs( sub = sbf_get_sub(), main = sbf_get_main(), ask = getOption("sbf.ask", TRUE) )sbf_rm_flobs( sub = sbf_get_sub(), main = sbf_get_main(), ask = getOption("sbf.ask", TRUE) )
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
ask |
A flag specifying whether to ask before deleting the subfolder. |
A invisible string of the directory deleted.
Other housekeeping functions:
sbf_archive_main(),
sbf_convert_meta(),
sbf_rm_main(),
sbf_unarchive_main()
Remove Main
sbf_rm_main(main = sbf_get_main(), ask = getOption("sbf.ask", TRUE))sbf_rm_main(main = sbf_get_main(), ask = getOption("sbf.ask", TRUE))
main |
A string specifying the path to the main folder (by default the current main folder) |
ask |
A flag specifying whether to ask before removing the existing folder. |
An invisible copy of the main folder.
Other reset:
sbf_reset_main(),
sbf_reset_sub()
Other housekeeping functions:
sbf_archive_main(),
sbf_convert_meta(),
sbf_rm_flobs(),
sbf_unarchive_main()
Rounds the numeric columns of a data frame in the same way as the .md
file saved by sbf_save_table() and sbf_save_plot().
sbf_round_data( x, proportion = FALSE, format_column = list(), round_as_estimate = character(0) )sbf_round_data( x, proportion = FALSE, format_column = list(), round_as_estimate = character(0) )
x |
A data frame. |
proportion |
A flag specifying whether the columns |
format_column |
A list of two-sided formulas of the form
|
round_as_estimate |
A character vector of numeric columns, other than
|
The rounding is described in sbf_save_table().
The numeric columns stay numeric, so significant trailing zeros are not
kept when the values are printed; use sbf_as_md() with round = TRUE
to keep them.
Integer columns and columns that are not numeric are not altered.
Columns formatted by format_column are replaced by the values returned by
the function, which are not rounded further.
x with its numeric columns rounded.
x <- data.frame( estimate = c(0.53124, 12.3456), lower = c(0.21234, 9.8765), upper = c(0.87012, 15.4321), length = c(1.23456, 123.456) ) sbf_round_data(x) sbf_round_data(x, format_column = list(length ~ round(., 1)))x <- data.frame( estimate = c(0.53124, 12.3456), lower = c(0.21234, 9.8765), upper = c(0.87012, 15.4321), length = c(1.23456, 123.456) ) sbf_round_data(x) sbf_round_data(x, format_column = list(length ~ round(., 1)))
sbf_save_aws_files() was moved to subfoldr2ext::sbfx_save_aws_files().
Download files from an AWS S3 bucket into the analysis.
sbf_save_aws_files( bucket_name, sub = sbf_get_sub(), main = sbf_get_main(), data_type = NULL, year = NULL, month = NULL, day = NULL, file_name = NULL, file_extension = NULL, max_request_size = 1000, ask = getOption("sbf.ask", TRUE), silent = TRUE, aws_access_key_id = Sys.getenv("AWS_ACCESS_KEY_ID"), aws_secret_access_key = Sys.getenv("AWS_SECRET_ACCESS_KEY"), region = Sys.getenv("AWS_REGION", "ca-central-1") )sbf_save_aws_files( bucket_name, sub = sbf_get_sub(), main = sbf_get_main(), data_type = NULL, year = NULL, month = NULL, day = NULL, file_name = NULL, file_extension = NULL, max_request_size = 1000, ask = getOption("sbf.ask", TRUE), silent = TRUE, aws_access_key_id = Sys.getenv("AWS_ACCESS_KEY_ID"), aws_secret_access_key = Sys.getenv("AWS_SECRET_ACCESS_KEY"), region = Sys.getenv("AWS_REGION", "ca-central-1") )
bucket_name |
A string of the AWS S3 bucket name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
data_type |
A string (by default |
year |
A whole number (by default |
month |
A whole number (by default |
day |
A whole number (by default |
file_name |
A string (by default |
file_extension |
A string (by default |
max_request_size |
A whole number (by default |
ask |
A flag specifying whether to ask before overwriting files. |
silent |
A flag (by default |
aws_access_key_id |
A string of your AWS user access key ID. The default
is the environment variable named |
aws_secret_access_key |
A string of your AWS user secret access key. The
default is the environment variable named |
region |
A string of the AWS region. The default is the environment
variable named |
Other save functions:
sbf_basename_sans_ext(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_window(),
sbf_save_workbook()
## Not run: sbf_save_aws_files( bucket_name = "exploit-upload-poissonconsulting", data_type = "upload-recapture", year = 2021, file_name = "processed_data", file_extension = "csv" ) ## End(Not run)## Not run: sbf_save_aws_files( bucket_name = "exploit-upload-poissonconsulting", data_type = "upload-recapture", year = 2021, file_name = "processed_data", file_extension = "csv" ) ## End(Not run)
A block in this context is a character vector of length one of.
sbf_save_block( x, x_name = substitute(x), sub = sbf_get_sub(), main = sbf_get_main(), caption = "", report = TRUE, tag = "", notes = "" )sbf_save_block( x, x_name = substitute(x), sub = sbf_get_sub(), main = sbf_get_main(), caption = "", report = TRUE, tag = "", notes = "" )
x |
A string of the block to save. |
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
caption |
A string of the caption. |
report |
A flag specifying whether to include in a report. |
tag |
A string of the tag. |
notes |
A string of additional notes to save with the metadata. |
An invisible string of the path to the saved object.
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_window(),
sbf_save_workbook()
Save Data
sbf_save_data( x, x_name = substitute(x), sub = sbf_get_sub(), main = sbf_get_main() )sbf_save_data( x, x_name = substitute(x), sub = sbf_get_sub(), main = sbf_get_main() )
x |
The data frame to save. |
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
An invisible string of the path to the saved data.frame
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_window(),
sbf_save_workbook()
Save Data Frame to Existing Database
sbf_save_data_to_db( x, x_name = substitute(x), db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main(), commit = TRUE, strict = TRUE, silent = getOption("rws.silent", FALSE) )sbf_save_data_to_db( x, x_name = substitute(x), db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main(), commit = TRUE, strict = TRUE, silent = getOption("rws.silent", FALSE) )
x |
The object to save. |
x_name |
A string of the table name. |
db_name |
A string of the database name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
commit |
A flag specifying whether to commit the operations (calling with commit = FALSE can be useful for checking data). |
strict |
A flag specifying whether to error if x has extraneous columns or if exists = TRUE extraneous data frames. |
silent |
A flag specifying whether to suppress messages and warnings. |
An invisible character vector of the paths to the saved objects.
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_window(),
sbf_save_workbook()
sbf_save_data_to_pg() was moved to subfoldr2ext::sbfx_save_data_to_pg().
Add data with a data frame to your PostgreSQL database. The data frame name
must match the table name in your database, if not use the tbl_name
argument to pass the table name.
sbf_save_data_to_pg( x, x_name = NULL, schema = getOption("psql.schema", "public"), config_path = getOption("psql.config_path", NULL), config_value = getOption("psql.config_value", "default") )sbf_save_data_to_pg( x, x_name = NULL, schema = getOption("psql.schema", "public"), config_path = getOption("psql.config_path", NULL), config_value = getOption("psql.config_value", "default") )
x |
The data frame to save. |
x_name |
A string of the name. |
schema |
A string of the schema name. Default value is |
config_path |
A string of a file path to the yaml configuration file.
The default value grabs the file path from the psql.config_path option
and uses |
config_value |
A string of the name of value. The default value grabs
the value from the psql.config_value option and uses |
Wrapper on psql::psql_add_data()
A scalar numeric.
Other postgresql functions:
sbf_backup_pg(),
sbf_close_pg(),
sbf_create_pg(),
sbf_execute_pg(),
sbf_get_config_file(),
sbf_get_config_value(),
sbf_get_schema(),
sbf_list_tables_pg(),
sbf_load_data_from_pg(),
sbf_load_datas_from_pg(),
sbf_open_pg(),
sbf_reset_config_file(),
sbf_reset_config_value(),
sbf_reset_schema(),
sbf_set_config_file(),
sbf_set_config_value(),
sbf_set_schema()
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_window(),
sbf_save_workbook()
## Not run: sbf_save_data_to_pg(outing, "creel") sbf_save_data_to_pg(outing_new, "creel", "outing") ## End(Not run)## Not run: sbf_save_data_to_pg(outing, "creel") sbf_save_data_to_pg(outing_new, "creel", "outing") ## End(Not run)
Save Data Frames
sbf_save_datas( sub = sbf_get_sub(), main = sbf_get_main(), env = parent.frame(), x_name = ".*" )sbf_save_datas( sub = sbf_get_sub(), main = sbf_get_main(), env = parent.frame(), x_name = ".*" )
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
env |
An environment. |
x_name |
A string of the Perl-compatible regular expression to match. |
An invisible character vector of the paths to the saved objects.
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_window(),
sbf_save_workbook()
## Not run: sbf_set_main(file.path(tempdir(), "output")) outing <- data.frame(x = 1) capture <- data.frame(x = 2) captures <- data.frame(x = 3) # matches anywhere in the name sbf_save_datas(x_name = "capture") # capture, captures # ^ and $ match the whole name sbf_save_datas(x_name = "^capture$") # capture sbf_save_datas(x_name = "^(outing|capture)$") # capture, outing # (?! ) excludes names sbf_save_datas(x_name = "^(?!capture$)") # captures, outing sbf_reset() ## End(Not run)## Not run: sbf_set_main(file.path(tempdir(), "output")) outing <- data.frame(x = 1) capture <- data.frame(x = 2) captures <- data.frame(x = 3) # matches anywhere in the name sbf_save_datas(x_name = "capture") # capture, captures # ^ and $ match the whole name sbf_save_datas(x_name = "^capture$") # capture sbf_save_datas(x_name = "^(outing|capture)$") # capture, outing # (?! ) excludes names sbf_save_datas(x_name = "^(?!capture$)") # captures, outing sbf_reset() ## End(Not run)
By default, every table in the database must have a matching data frame
in env. To save a subset of the tables, specify x_name to match their
names.
sbf_save_datas_to_db( db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main(), commit = TRUE, strict = TRUE, env = parent.frame(), silent = getOption("rws.silent", FALSE), x_name = ".*" )sbf_save_datas_to_db( db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main(), commit = TRUE, strict = TRUE, env = parent.frame(), silent = getOption("rws.silent", FALSE), x_name = ".*" )
db_name |
A string of the database name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
commit |
A flag specifying whether to commit the operations (calling with commit = FALSE can be useful for checking data). |
strict |
A flag specifying whether to error if x has extraneous columns or if exists = TRUE extraneous data frames. |
env |
An environment. |
silent |
A flag specifying whether to suppress messages and warnings. |
x_name |
A string of the Perl-compatible regular expression to match. |
An invisible character vector of the names of the tables saved.
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_window(),
sbf_save_workbook()
Saves meta table descriptions to a database. Its important to note that if overwrite = TRUE and x includes blank descriptions then existing non-blank descriptions will be overwritten.
sbf_save_db_metatable_descriptions( x, db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main(), overwrite = FALSE, strict = TRUE )sbf_save_db_metatable_descriptions( x, db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main(), overwrite = FALSE, strict = TRUE )
x |
A data.frame with Table, Column and Description columns. |
db_name |
A string of the database name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
overwrite |
A flag specifying whether to overwrite existing descriptions. |
strict |
A flag specifying whether to error if x has extraneous descriptions. |
A invisible data.frame of the altered descriptions.
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_window(),
sbf_save_workbook()
Converts a database to an single excel workbook where each table is its own spreadsheet.
sbf_save_db_to_workbook( workbook_name = sbf_get_workbook_name(), db_name = sbf_get_db_name(), exclude_tables = "^$", sub = sbf_get_sub(), main = sbf_get_main(), epgs = NULL, x_name = ".*" )sbf_save_db_to_workbook( workbook_name = sbf_get_workbook_name(), db_name = sbf_get_db_name(), exclude_tables = "^$", sub = sbf_get_sub(), main = sbf_get_main(), epgs = NULL, x_name = ".*" )
workbook_name |
The name of the excel workbook you are creating. Default is the base name of the current working directory. |
db_name |
A string of the database name. |
exclude_tables |
A regular expression listing tables to be excluded.
Currently soft-deprecated. Use |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
epgs |
The projection to convert to |
x_name |
A string of the Perl-compatible regular expression to match. |
Other excel:
sbf_get_workbook_name(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_workbook()
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_window(),
sbf_save_workbook()
## Not run: sbf_save_db_to_workbook() # exclude the sites table sbf_save_db_to_workbook(x_name = "^(?!sites$)") # exclude the sites and species table sbf_save_db_to_workbook(x_name = "^(?!(sites|species)$)") ## End(Not run)## Not run: sbf_save_db_to_workbook() # exclude the sites table sbf_save_db_to_workbook(x_name = "^(?!sites$)") # exclude the sites and species table sbf_save_db_to_workbook(x_name = "^(?!(sites|species)$)") ## End(Not run)
Save Dataframe to Excel Workbook
sbf_save_excel( x, x_name = substitute(x), max_sheets = 1L, sub = sbf_get_sub(), main = sbf_get_main(), epgs = NULL )sbf_save_excel( x, x_name = substitute(x), max_sheets = 1L, sub = sbf_get_sub(), main = sbf_get_main(), epgs = NULL )
x |
The data frame to save. |
x_name |
A string of the name. |
max_sheets |
An integer specifying the maximum number of sheets to split your table into for writing to excel. The default is 1. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
epgs |
The projection to convert to |
This takes a data frame and saves it to their own excel workbook.
This function will split up large dataframes into smaller tables for writing
to excel because excel only allows a maximum number of 1,048,576. For the
max_sheets argument you can pass a number higher then the required
and it will only return as many sheets as there is data.
An invisible string of the path to the saved data.frame
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_window(),
sbf_save_workbook()
Other excel:
sbf_get_workbook_name(),
sbf_save_db_to_workbook(),
sbf_save_excels(),
sbf_save_workbook()
## Not run: sbf_save_excel() ## End(Not run)## Not run: sbf_save_excel() ## End(Not run)
Saves data frames from the environment to their own excel workbook. Each table will be its own excel workbook.
sbf_save_excels( sub = sbf_get_sub(), main = sbf_get_main(), env = parent.frame(), epgs = NULL, x_name = ".*" )sbf_save_excels( sub = sbf_get_sub(), main = sbf_get_main(), env = parent.frame(), epgs = NULL, x_name = ".*" )
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
env |
An environment. |
epgs |
The projection to convert to |
x_name |
A string of the Perl-compatible regular expression to match. |
An invisible string of the path to the saved data.frame
Other excel:
sbf_get_workbook_name(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_workbook()
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_window(),
sbf_save_workbook()
## Not run: sbf_save_excels() ## End(Not run)## Not run: sbf_save_excels() ## End(Not run)
Saves and systematically renames all blobbed files by default (dir = NULL) to flobs sub directory corresponding to database using dbflobr::save_all_flobs().
sbf_save_flobs_from_db( db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main(), dir = NULL, dbflobr_sub = FALSE, replace = FALSE )sbf_save_flobs_from_db( db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main(), dir = NULL, dbflobr_sub = FALSE, replace = FALSE )
db_name |
A string of the database name. |
sub |
A logical scalar specifying whether to save all existing files in a subdirectory of the same name (sub = TRUE) or all possible files in a subdirectory of the same name (sub = NA) or not nest files within a subdirectory (sub = FALSE). |
main |
A string specifying the path to the main folder (by default the current main folder) |
dir |
A string of the path to the directory to save the files in. |
dbflobr_sub |
A logical specifying whether to save all existing files in a subdirectory of the same name (dbflobr_sub = TRUE) or all possible files in a subdirectory of the same name (dbflobr_sub = NA) or not nest files within a subdirectory (dbflobr_sub = FALSE). |
replace |
A flag specifying whether to replace existing files. If sub = TRUE (or sub = NA) and replace = TRUE then all existing files within a subdirectory are deleted. |
An invisible named list of named vectors of the file names and new file names saved.
Other flob:
sbf_add_blob_column_to_db(),
sbf_upload_flobs_to_db()
Save sf data frame to Geopackage
sbf_save_gpkg( x, x_name = substitute(x), sub = sbf_get_sub(), main = sbf_get_main() )sbf_save_gpkg( x, x_name = substitute(x), sub = sbf_get_sub(), main = sbf_get_main() )
x |
The sf data frame to save. |
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
This takes an sf data frame and saves as geopackage.
An invisible string of the path to the saved geopackage
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_window(),
sbf_save_workbook()
## Not run: sbf_save_gpkg() ## End(Not run)## Not run: sbf_save_gpkg() ## End(Not run)
An sf object of file name file_name is saved as file_name.gpkg.
sbf_save_gpkgs( sub = sbf_get_sub(), main = sbf_get_main(), env = parent.frame(), all_sfcs = TRUE, x_name = ".*" )sbf_save_gpkgs( sub = sbf_get_sub(), main = sbf_get_main(), env = parent.frame(), all_sfcs = TRUE, x_name = ".*" )
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
env |
An environment. |
all_sfcs |
A flag specifying whether to save non-active sfc columns as geopackages. |
x_name |
A string of the Perl-compatible regular expression to match. |
By default (all_sfcs = TRUE) non-active sfc columns are saved
as file_name_geometry_column_name.gpkg this includes data frames with
no active sfc column.
An invisible character vector of the paths to the saved objects.
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_window(),
sbf_save_workbook()
Save Number
sbf_save_number( x, x_name = substitute(x), sub = sbf_get_sub(), main = sbf_get_main(), report = TRUE, tag = "", notes = "", signif = getOption("sbf.signif", 22) )sbf_save_number( x, x_name = substitute(x), sub = sbf_get_sub(), main = sbf_get_main(), report = TRUE, tag = "", notes = "", signif = getOption("sbf.signif", 22) )
x |
The number to save. |
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
report |
A flag specifying whether to include in a report. |
tag |
A string of the tag. |
notes |
A string of additional notes to save with the metadata. |
signif |
A positive whole number specifying the number of significant digits to round by. |
An invisible string of the path to the saved object.
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_window(),
sbf_save_workbook()
Save Numbers
sbf_save_numbers( sub = sbf_get_sub(), main = sbf_get_main(), signif = getOption("sbf.signif", 22), env = parent.frame(), x_name = ".*" )sbf_save_numbers( sub = sbf_get_sub(), main = sbf_get_main(), signif = getOption("sbf.signif", 22), env = parent.frame(), x_name = ".*" )
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
signif |
A positive whole number specifying the number of significant digits to round by. |
env |
An environment. |
x_name |
A string of the Perl-compatible regular expression to match. |
An invisible character vector of the paths to the saved objects.
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_window(),
sbf_save_workbook()
Save Object
sbf_save_object( x, x_name = substitute(x), sub = sbf_get_sub(), main = sbf_get_main() )sbf_save_object( x, x_name = substitute(x), sub = sbf_get_sub(), main = sbf_get_main() )
x |
The object to save. |
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
An invisible string of the path to the saved object.
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_window(),
sbf_save_workbook()
Save Objects
sbf_save_objects( sub = sbf_get_sub(), main = sbf_get_main(), env = parent.frame(), x_name = ".*" )sbf_save_objects( sub = sbf_get_sub(), main = sbf_get_main(), env = parent.frame(), x_name = ".*" )
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
env |
An environment. |
x_name |
A string of the Perl-compatible regular expression to match. |
An invisible character vector of the paths to the saved objects.
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_window(),
sbf_save_workbook()
Saves a ggplot object. By default it saves the last plot to be modified or created.
sbf_save_plot( x = ggplot2::last_plot(), x_name = substitute(x), sub = sbf_get_sub(), main = sbf_get_main(), caption = "", report = TRUE, tag = "", notes = "", units = "in", width = NA, height = width, dpi = 300, limitsize = TRUE, csv = 1000L, drop_uninformative_cols = TRUE, proportion = FALSE, format_column = list(), round_as_estimate = character(0), no_big_mark = character(0), drop_sd = FALSE )sbf_save_plot( x = ggplot2::last_plot(), x_name = substitute(x), sub = sbf_get_sub(), main = sbf_get_main(), caption = "", report = TRUE, tag = "", notes = "", units = "in", width = NA, height = width, dpi = 300, limitsize = TRUE, csv = 1000L, drop_uninformative_cols = TRUE, proportion = FALSE, format_column = list(), round_as_estimate = character(0), no_big_mark = character(0), drop_sd = FALSE )
x |
The ggplot object to save. |
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
caption |
A string of the caption. |
report |
A flag specifying whether to include in a report. |
tag |
A string of the tag. |
notes |
A string of additional notes to save with the metadata. |
units |
A string of the units. Can be "in" (default) or "mm" or "cm". |
width |
A number of the plot width in inches. |
height |
A number of the plot width in inches. |
dpi |
A number of the resolution in dots per inch. |
limitsize |
When |
csv |
A count specifying the maximum number of rows to save as a csv file. |
drop_uninformative_cols |
A flag indicating whether to drop
uninformative columns via |
proportion |
A flag specifying whether the columns |
format_column |
A list of two-sided formulas of the form
|
round_as_estimate |
A character vector of numeric columns, other than
|
no_big_mark |
A character vector of numeric columns (e.g. |
drop_sd |
A flag specifying whether to drop the |
The function saves:
A png file of the plot.
A yaml file of the plot metadata.
An rds file of the plot.
A csv of the data passed to ggplot(), provided it has at least one row
and no more than csv rows. If x is a patchwork object, only the data
for the first patch is saved, to maintain compatibility with previous
versions.
An xlsx workbook with a sheet for the data passed to each ggplot()
call and a sheet for each geom layer. Sheets are labelled <p>_<l>_<geom>,
where <p> is the patch index (1 for a simple ggplot), <l> is the layer
index (0 for the ggplot() data), and <geom> is the layer type (e.g.
point, line). Layers with more than csv rows are omitted.
An md file of the same data as the csv with the values rounded and
formatted for display as described in sbf_save_table(). The values in the
plot are not rounded. The md file is not saved if there is no ggplot()
data or getOption("sbf.save_md") is FALSE, in which case any existing
md file for the plot is deleted.
The csv, xlsx and md files are named using the x_name argument. Not
specifying x overwrites existing files that used x_name = "plot".
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_window(),
sbf_save_workbook()
## Not run: require(ggplot2) require(patchwork) ggplot(mtcars) + geom_line(aes(mpg, cyl, color = cyl), mtcars) + ggtitle("1") sbf_save_plot() p_patches <- ((ggplot(mtcars) + geom_line(aes(mpg, cyl, color = cyl), mtcars) + ggtitle("1")) + (ggplot() + geom_line(aes(Sepal.Length, Petal.Length), iris) + ggtitle("2"))) / ((ggplot() + geom_point(aes(mpg, cyl, color = cyl), mtcars) + ggtitle("3")) + ((ggplot(iris) + geom_point(aes(Sepal.Length, Petal.Length)) + ggtitle("4")) + (ggplot() + geom_point(aes(Sepal.Length, Petal.Length, color = Species), iris) + ggtitle("5") + theme(legend.position = "none")))) p_patches sbf_save_plot(p_patches) ## End(Not run)## Not run: require(ggplot2) require(patchwork) ggplot(mtcars) + geom_line(aes(mpg, cyl, color = cyl), mtcars) + ggtitle("1") sbf_save_plot() p_patches <- ((ggplot(mtcars) + geom_line(aes(mpg, cyl, color = cyl), mtcars) + ggtitle("1")) + (ggplot() + geom_line(aes(Sepal.Length, Petal.Length), iris) + ggtitle("2"))) / ((ggplot() + geom_point(aes(mpg, cyl, color = cyl), mtcars) + ggtitle("3")) + ((ggplot(iris) + geom_point(aes(Sepal.Length, Petal.Length)) + ggtitle("4")) + (ggplot() + geom_point(aes(Sepal.Length, Petal.Length, color = Species), iris) + ggtitle("5") + theme(legend.position = "none")))) p_patches sbf_save_plot(p_patches) ## End(Not run)
Saves a png file to the windows.
sbf_save_png( x, x_name = sbf_basename_sans_ext(x), sub = sbf_get_sub(), main = sbf_get_main(), caption = "", report = TRUE, tag = "", notes = "", width = NA, units = "in" )sbf_save_png( x, x_name = sbf_basename_sans_ext(x), sub = sbf_get_sub(), main = sbf_get_main(), caption = "", report = TRUE, tag = "", notes = "", width = NA, units = "in" )
x |
A string of the path to the png file to save. |
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
caption |
A string of the caption. |
report |
A flag specifying whether to include in a report. |
tag |
A string of the tag. |
notes |
A string of additional notes to save with the metadata. |
width |
A number of the plot width in inches. |
units |
A string of the units. Can be "in" (default) or "mm" or "cm". |
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_window(),
sbf_save_workbook()
Saves an sf tbl with at least one row for which the first column (not a geometry) is unique with no missing values and only one geometry column which must have a defined projection.
sbf_save_spatial(x, x_name = NULL, sub = sbf_get_sub(), main = sbf_get_main())sbf_save_spatial(x, x_name = NULL, sub = sbf_get_sub(), main = sbf_get_main())
x |
The sf tbl to save. |
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
An invisible string of the path to the saved data.frame
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_window(),
sbf_save_workbook()
Saves sf tbls each with at least one row for which the first column (not a geometry) is unique with no missing values and only one geometry column which must have a defined projection. The functions expects that all data frames in the environment meet these requirements.
sbf_save_spatials( sub = sbf_get_sub(), main = sbf_get_main(), env = parent.frame(), x_name = ".*" )sbf_save_spatials( sub = sbf_get_sub(), main = sbf_get_main(), env = parent.frame(), x_name = ".*" )
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
env |
An environment. |
x_name |
A string of the Perl-compatible regular expression to match. |
An invisible character vector of the paths to the saved objects.
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_window(),
sbf_save_workbook()
A string in this context is a character vector of length one of inline text.
sbf_save_string( x, x_name = substitute(x), sub = sbf_get_sub(), main = sbf_get_main(), report = TRUE, tag = "", notes = "" )sbf_save_string( x, x_name = substitute(x), sub = sbf_get_sub(), main = sbf_get_main(), report = TRUE, tag = "", notes = "" )
x |
The string to save. |
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
report |
A flag specifying whether to include in a report. |
tag |
A string of the tag. |
notes |
A string of additional notes to save with the metadata. |
An invisible string of the path to the saved object.
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_window(),
sbf_save_workbook()
Save Strings
sbf_save_strings( sub = sbf_get_sub(), main = sbf_get_main(), env = parent.frame(), x_name = ".*" )sbf_save_strings( sub = sbf_get_sub(), main = sbf_get_main(), env = parent.frame(), x_name = ".*" )
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
env |
An environment. |
x_name |
A string of the Perl-compatible regular expression to match. |
An invisible character vector of the paths to the saved objects.
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_table(),
sbf_save_window(),
sbf_save_workbook()
Saves a data frame as .rds and .csv files with the unrounded values
and as a .md file with the values rounded and formatted for display.
sbf_save_table( x, x_name = substitute(x), sub = sbf_get_sub(), main = sbf_get_main(), caption = "", report = TRUE, tag = "", notes = "", proportion = FALSE, format_column = list(), round_as_estimate = character(0), no_big_mark = character(0), drop_sd = FALSE )sbf_save_table( x, x_name = substitute(x), sub = sbf_get_sub(), main = sbf_get_main(), caption = "", report = TRUE, tag = "", notes = "", proportion = FALSE, format_column = list(), round_as_estimate = character(0), no_big_mark = character(0), drop_sd = FALSE )
x |
The data frame to save. |
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
caption |
A string of the caption. |
report |
A flag specifying whether to include in a report. |
tag |
A string of the tag. |
notes |
A string of additional notes to save with the metadata. |
proportion |
A flag specifying whether the columns |
format_column |
A list of two-sided formulas of the form
|
round_as_estimate |
A character vector of numeric columns, other than
|
no_big_mark |
A character vector of numeric columns (e.g. |
drop_sd |
A flag specifying whether to drop the |
In the .md file, estimates are rounded following the rounding policy in
the usepois report template, which is adapted from Cole (2015).
The column estimate is rounded to the second significant digit of the
column sd if present and otherwise of 1/4 of the interval between the
columns lower and upper.
The columns lower and upper are rounded to one fewer decimal place than
the estimate but to at least two significant digits.
Estimates without an sd or interval are rounded to three significant
digits.
The column svalue is rounded to one decimal place.
Other double columns are rounded to four significant digits, without
adding trailing zeros beyond the digits of the value, while integer columns
are not rounded.
Significant trailing zeros are retained, commas are used as thousands
separators for numbers of 1000 or more except in the columns named by
no_big_mark, and numeric columns are padded with spaces to align their
decimal points.
The .md file is not saved if getOption("sbf.save_md") is FALSE, in
which case any existing .md file for the table is deleted.
An invisible string of the path to the saved object.
Cole, T.J. 2015. Too many digits: the presentation of numerical data. Archives of Disease in Childhood 100(7): 608-609. doi:10.1136/archdischild-2014-307149.
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_window(),
sbf_save_workbook()
## Not run: sbf_save_table( coef, caption = "Parameter estimates.", format_column = list(zscore ~ round(., 1)) ) sbf_save_table(ppc, round_as_estimate = "observed") sbf_save_table(counts, no_big_mark = "year") ## End(Not run)## Not run: sbf_save_table( coef, caption = "Parameter estimates.", format_column = list(zscore ~ round(., 1)) ) sbf_save_table(ppc, round_as_estimate = "observed") sbf_save_table(counts, no_big_mark = "year") ## End(Not run)
Saves the current graphics device to a png file.
sbf_save_window( x_name = "window", sub = sbf_get_sub(), main = sbf_get_main(), caption = "", report = TRUE, tag = "", notes = "", width = NA, height = width, units = "in", dpi = 300 )sbf_save_window( x_name = "window", sub = sbf_get_sub(), main = sbf_get_main(), caption = "", report = TRUE, tag = "", notes = "", width = NA, height = width, units = "in", dpi = 300 )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
caption |
A string of the caption. |
report |
A flag specifying whether to include in a report. |
tag |
A string of the tag. |
notes |
A string of additional notes to save with the metadata. |
width |
A number of the plot width in inches. |
height |
A number of the plot width in inches. |
units |
A string of the units. Can be "in" (default) or "mm" or "cm". |
dpi |
A number of the resolution in dots per inch. |
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_workbook()
This takes the data frames from the environment and saves them to a single excel workbook where each table is its own spreadsheet.
sbf_save_workbook( workbook_name = basename(getwd()), sub = sbf_get_sub(), main = sbf_get_main(), env = parent.frame(), epgs = NULL, x_name = ".*" )sbf_save_workbook( workbook_name = basename(getwd()), sub = sbf_get_sub(), main = sbf_get_main(), env = parent.frame(), epgs = NULL, x_name = ".*" )
workbook_name |
The name of the excel workbook you are creating. Default is the base name of the current working directory. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
env |
An environment. |
epgs |
The projection to convert to |
x_name |
A string of the Perl-compatible regular expression to match. |
An invisible string of the path to the saved data.frame
Other excel:
sbf_get_workbook_name(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels()
Other save functions:
sbf_basename_sans_ext(),
sbf_save_aws_files(),
sbf_save_block(),
sbf_save_data(),
sbf_save_data_to_db(),
sbf_save_data_to_pg(),
sbf_save_datas(),
sbf_save_datas_to_db(),
sbf_save_db_metatable_descriptions(),
sbf_save_db_to_workbook(),
sbf_save_excel(),
sbf_save_excels(),
sbf_save_gpkg(),
sbf_save_gpkgs(),
sbf_save_number(),
sbf_save_numbers(),
sbf_save_object(),
sbf_save_objects(),
sbf_save_plot(),
sbf_save_png(),
sbf_save_spatial(),
sbf_save_spatials(),
sbf_save_string(),
sbf_save_strings(),
sbf_save_table(),
sbf_save_window()
## Not run: sbf_save_workbook() ## End(Not run)## Not run: sbf_save_workbook() ## End(Not run)
sbf_set_config_file() was moved to subfoldr2ext::sbfx_set_config_file().
A wrapper to quickly set the psql.config_path options parameter.
sbf_set_config_file(path = "config.yml")sbf_set_config_file(path = "config.yml")
path |
A file path to the location of the yaml file containing your connection details. |
This function is recommended to be added to your header when used.
An invisible string of the file path given
Other postgresql functions:
sbf_backup_pg(),
sbf_close_pg(),
sbf_create_pg(),
sbf_execute_pg(),
sbf_get_config_file(),
sbf_get_config_value(),
sbf_get_schema(),
sbf_list_tables_pg(),
sbf_load_data_from_pg(),
sbf_load_datas_from_pg(),
sbf_open_pg(),
sbf_reset_config_file(),
sbf_reset_config_value(),
sbf_reset_schema(),
sbf_save_data_to_pg(),
sbf_set_config_value(),
sbf_set_schema()
## Not run: sbf_set_config_file() sbf_set_config_file("Keys/config-captures.yml") ## End(Not run)## Not run: sbf_set_config_file() sbf_set_config_file("Keys/config-captures.yml") ## End(Not run)
sbf_set_config_value() was moved to subfoldr2ext::sbfx_set_config_value().
Wrapper for setting the psql.config_value options parameter.
sbf_set_config_value(value = NULL)sbf_set_config_value(value = NULL)
value |
A string of the config file value to grab. |
This function is recommended to be added to your header when used.
An invisible string of the value given
Other postgresql functions:
sbf_backup_pg(),
sbf_close_pg(),
sbf_create_pg(),
sbf_execute_pg(),
sbf_get_config_file(),
sbf_get_config_value(),
sbf_get_schema(),
sbf_list_tables_pg(),
sbf_load_data_from_pg(),
sbf_load_datas_from_pg(),
sbf_open_pg(),
sbf_reset_config_file(),
sbf_reset_config_value(),
sbf_reset_schema(),
sbf_save_data_to_pg(),
sbf_set_config_file(),
sbf_set_schema()
## Not run: sbf_set_config_value("shinyapp") ## End(Not run)## Not run: sbf_set_config_value("shinyapp") ## End(Not run)
Sets database name option (without the extension or path).
sbf_set_db_name(db_name = "database")sbf_set_db_name(db_name = "database")
db_name |
A string specifying the new database name (without the extension or path). |
An invisible string specifying the new database name (without the extension or path).
Other db_name:
sbf_get_db_name()
Other directory functions:
sbf_add_sub(),
sbf_get_archive(),
sbf_get_db_name(),
sbf_get_main(),
sbf_get_sub(),
sbf_get_workbook_name(),
sbf_reset(),
sbf_reset_db_name(),
sbf_reset_main(),
sbf_reset_sub(),
sbf_set_main(),
sbf_set_sub(),
sbf_up_sub()
sbf_set_db_name("database")sbf_set_db_name("database")
The directory is created when needed if it doesn't already exist.
sbf_set_main(..., rm = FALSE, ask = getOption("sbf.ask", TRUE))sbf_set_main(..., rm = FALSE, ask = getOption("sbf.ask", TRUE))
... |
One or more character vectors which are combined together. |
rm |
A flag specifying whether to remove the folder and all its contents if it already exists. |
ask |
A flag specifying whether to ask before removing the existing folder. |
An invisible string of the path to the main folder.
Other directory functions:
sbf_add_sub(),
sbf_get_archive(),
sbf_get_db_name(),
sbf_get_main(),
sbf_get_sub(),
sbf_get_workbook_name(),
sbf_reset(),
sbf_reset_db_name(),
sbf_reset_main(),
sbf_reset_sub(),
sbf_set_db_name(),
sbf_set_sub(),
sbf_up_sub()
sbf_set_schema() was moved to subfoldr2ext::sbfx_set_schema().
sbf_set_schema(schema = "public")sbf_set_schema(schema = "public")
schema |
A string of the schema name. Default value is |
An invisible schema name
Other postgresql functions:
sbf_backup_pg(),
sbf_close_pg(),
sbf_create_pg(),
sbf_execute_pg(),
sbf_get_config_file(),
sbf_get_config_value(),
sbf_get_schema(),
sbf_list_tables_pg(),
sbf_load_data_from_pg(),
sbf_load_datas_from_pg(),
sbf_open_pg(),
sbf_reset_config_file(),
sbf_reset_config_value(),
sbf_reset_schema(),
sbf_save_data_to_pg(),
sbf_set_config_file(),
sbf_set_config_value()
## Not run: sbf_set_schema("capture") ## End(Not run)## Not run: sbf_set_schema("capture") ## End(Not run)
Set Sub Folder
sbf_set_sub(..., rm = FALSE, ask = getOption("sbf.ask", TRUE))sbf_set_sub(..., rm = FALSE, ask = getOption("sbf.ask", TRUE))
... |
One or more character vectors which are combined together. |
rm |
A flag specifying whether to remove the folder and all its contents if it already exists. |
ask |
A flag specifying whether to ask before removing the existing folder. |
An invisible string specifying the new sub folder.
Other directory functions:
sbf_add_sub(),
sbf_get_archive(),
sbf_get_db_name(),
sbf_get_main(),
sbf_get_sub(),
sbf_get_workbook_name(),
sbf_reset(),
sbf_reset_db_name(),
sbf_reset_main(),
sbf_reset_sub(),
sbf_set_db_name(),
sbf_set_main(),
sbf_up_sub()
sbf_set_sub("nameofsub") sbf_get_sub() sbf_reset_sub()sbf_set_sub("nameofsub") sbf_get_sub() sbf_reset_sub()
this function is now deprecated as of version 0.0.0.9045
sbf_string_exists(x_name, sub = sbf_get_sub(), main = sbf_get_main())sbf_string_exists(x_name, sub = sbf_get_sub(), main = sbf_get_main())
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
A flag specifying whether the string exists.
Other exists functions:
sbf_block_exists(),
sbf_data_exists(),
sbf_number_exists(),
sbf_object_exists(),
sbf_plot_exists(),
sbf_table_exists()
Recursively returns all the subs of block with name x_name.
sbf_subs_block_recursive( x_name, sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE )sbf_subs_block_recursive( x_name, sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
include_root |
A flag indicating whether to include objects in the top sub folder. |
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Recursively returns all the subs of data frames of objects with name x_name.
sbf_subs_data_recursive( x_name, sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE )sbf_subs_data_recursive( x_name, sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
include_root |
A flag indicating whether to include objects in the top sub folder. |
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Recursively returns all the subs of number with name x_name.
sbf_subs_number_recursive( x_name, sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE )sbf_subs_number_recursive( x_name, sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
include_root |
A flag indicating whether to include objects in the top sub folder. |
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Recursively returns all the subs of objects with name x_name.
sbf_subs_object_recursive( x_name, sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE )sbf_subs_object_recursive( x_name, sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
include_root |
A flag indicating whether to include objects in the top sub folder. |
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Recursively returns all the subs of plot with name x_name.
sbf_subs_plot_recursive( x_name, sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE )sbf_subs_plot_recursive( x_name, sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
include_root |
A flag indicating whether to include objects in the top sub folder. |
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Recursively returns all the subs of string with name x_name.
sbf_subs_string_recursive( x_name, sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE )sbf_subs_string_recursive( x_name, sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
include_root |
A flag indicating whether to include objects in the top sub folder. |
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_table_recursive(),
sbf_subs_window_recursive()
Recursively returns all the subs of table with name x_name.
sbf_subs_table_recursive( x_name, sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE )sbf_subs_table_recursive( x_name, sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
include_root |
A flag indicating whether to include objects in the top sub folder. |
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_window_recursive()
Recursively returns all the subs of window with name x_name.
sbf_subs_window_recursive( x_name, sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE )sbf_subs_window_recursive( x_name, sub = sbf_get_sub(), main = sbf_get_main(), include_root = TRUE )
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
include_root |
A flag indicating whether to include objects in the top sub folder. |
Other load functions:
load_rdss_recursive(),
sbf_load_block(),
sbf_load_blocks(),
sbf_load_blocks_recursive(),
sbf_load_data(),
sbf_load_data_from_db(),
sbf_load_data_from_pg(),
sbf_load_datas(),
sbf_load_datas_from_db(),
sbf_load_datas_from_pg(),
sbf_load_datas_recursive(),
sbf_load_db_metatable(),
sbf_load_number(),
sbf_load_numbers(),
sbf_load_numbers_recursive(),
sbf_load_object(),
sbf_load_objects(),
sbf_load_objects_recursive(),
sbf_load_plot(),
sbf_load_plot_data(),
sbf_load_plot_md(),
sbf_load_plots_data(),
sbf_load_plots_data_recursive(),
sbf_load_plots_recursive(),
sbf_load_spatial(),
sbf_load_spatials(),
sbf_load_string(),
sbf_load_strings(),
sbf_load_strings_recursive(),
sbf_load_table(),
sbf_load_table_md(),
sbf_load_tables(),
sbf_load_tables_recursive(),
sbf_load_windows_recursive(),
sbf_subs_block_recursive(),
sbf_subs_data_recursive(),
sbf_subs_number_recursive(),
sbf_subs_object_recursive(),
sbf_subs_plot_recursive(),
sbf_subs_string_recursive(),
sbf_subs_table_recursive()
this function is now deprecated as of version 0.0.0.9045
sbf_table_exists(x_name, sub = sbf_get_sub(), main = sbf_get_main())sbf_table_exists(x_name, sub = sbf_get_sub(), main = sbf_get_main())
x_name |
A string of the name. |
sub |
A string or character vector specifying the path to the sub folder (by default the current sub folder). |
main |
A string specifying the path to the main folder (by default the current main folder) |
A flag specifying whether the table exists.
Other exists functions:
sbf_block_exists(),
sbf_data_exists(),
sbf_number_exists(),
sbf_object_exists(),
sbf_plot_exists(),
sbf_string_exists()
Unarchives an archived main folder.
sbf_unarchive_main( main = sbf_get_main(), archive = 1L, ask = getOption("sbf.ask", TRUE) )sbf_unarchive_main( main = sbf_get_main(), archive = 1L, ask = getOption("sbf.ask", TRUE) )
main |
A string specifying the path to the main folder (by default the current main folder) |
archive |
A positive whole number specifying the folder archived folder where 1L (the default) indicates the most recently archived folder or a character string of the path to the archived folder. |
ask |
A flag specifying whether to ask before removing the existing folder. |
An invisible string of the path to the previously archived folder.
Other archive:
sbf_archive_main(),
sbf_get_archive()
Other housekeeping functions:
sbf_archive_main(),
sbf_convert_meta(),
sbf_rm_flobs(),
sbf_rm_main()
Moves up the sub folder hierarchy.
sbf_up_sub(n = 1L, rm = FALSE, ask = getOption("sbf.ask", TRUE))sbf_up_sub(n = 1L, rm = FALSE, ask = getOption("sbf.ask", TRUE))
n |
A positive int of the number of subfolders to move up. |
rm |
A flag specifying whether to remove the folder and all its contents if it already exists. |
ask |
A flag specifying whether to ask before removing the existing folder. |
An invisible string specifying the new sub folder.
Other directory functions:
sbf_add_sub(),
sbf_get_archive(),
sbf_get_db_name(),
sbf_get_main(),
sbf_get_sub(),
sbf_get_workbook_name(),
sbf_reset(),
sbf_reset_db_name(),
sbf_reset_main(),
sbf_reset_sub(),
sbf_set_db_name(),
sbf_set_main(),
sbf_set_sub()
sbf_set_sub("nameofsub/othersub/yetothersub") sbf_up_sub() sbf_get_sub() sbf_reset_sub()sbf_set_sub("nameofsub/othersub/yetothersub") sbf_up_sub() sbf_get_sub() sbf_reset_sub()
Uploads all files to database by default dir = NULL then uploads flobs subdirectory corresponding to database using dbflobr::import_all_flobs().
sbf_upload_flobs_to_db( db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main(), dir = NULL, dbflobr_sub = FALSE, exists = FALSE, replace = FALSE )sbf_upload_flobs_to_db( db_name = sbf_get_db_name(), sub = sbf_get_sub(), main = sbf_get_main(), dir = NULL, dbflobr_sub = FALSE, exists = FALSE, replace = FALSE )
db_name |
A string of the database name. |
sub |
A logical scalar specifying whether to import flobs based on their filename (sub = FALSE) or the name of their subdirectory (sub = TRUE) which must only contain 1 file. If sub = NA and replace = TRUE then the names of the subdirectories are used irrespective of whether they include files and existing flobs are deleted if the corresponding subdirectory is empty. If sub = TRUE or sub = NA then recursion is just one subfolder deep. |
main |
A string specifying the path to the main folder (by default the current main folder) |
dir |
A string of the path to the directory to import the files from. Files need to be within nested folders like 'table1/column1/a.csv'. This structure is created automatically if save_all_flobs() function is used. |
dbflobr_sub |
A logical scalar specifying whether to import flobs based on their filename (sub = FALSE) or the name of their subdirectory (sub = TRUE) which must only contain 1 file. If sub = NA and replace = TRUE then the names of the subdirectories are used irrespective of whether they include files and existing flobs are deleted if the corresponding subdirectory is empty. If sub = TRUE or sub = NA then recursion is just one subfolder deep. |
exists |
A logical scalar specifying whether the column must (TRUE) or mustn't (FALSE) already exist or whether it doesn't matter (NA). IF FALSE, a new BLOB column is created. |
replace |
A flag indicating whether to replace existing flobs (TRUE) or not (FALSE). |
An invisible named list indicating directory path, file names and whether files were successfully written to database.
Other flob:
sbf_add_blob_column_to_db(),
sbf_save_flobs_from_db()
Other database functions:
sbf_add_blob_column_to_db(),
sbf_close_db(),
sbf_copy_db(),
sbf_create_db(),
sbf_execute_db(),
sbf_open_db(),
sbf_query_db()
Writes all the data frames in the environment to an xlsx file. Each data frame is saved to a sheet with the same name.
sbf_write_datas_to_xlsx( path, exists = NA, env = parent.frame(), ask = getOption("sbf.ask", TRUE) )sbf_write_datas_to_xlsx( path, exists = NA, env = parent.frame(), ask = getOption("sbf.ask", TRUE) )
path |
A string of the path to the xlsx file (with the extension). |
exists |
A logical scalar specifying whether the file should exist. |
env |
An environment. |
ask |
A flag specifying whether to ask before deleting an existing database (if exists = FALSE). |
An invisible character vector of the names of the data frames.