hs_tidy_filenames: hs_tidy_filenames function

Description Usage Arguments Examples

View source: R/hs_tidy_filenames.R

Description

Function to tidy/clean filenames in hyperspec objects (i.e. remove absolute path in name, and/or replace filenames).

Usage

1
2
3
4
5
6
7
hs_tidy_filenames(
  hs.x,
  remove_pattern = "path",
  rename_df = NULL,
  old_name_col,
  new_name_col
)

Arguments

hs.x

HyperSpec object

remove_pattern

What should be adjusted in filenames. "path" means remove the absolute path of the file and only keep the filename "rename" means that you supply a dataframe with matching old and new filenames. In this case you must supply a dataframe in rename_df and designate the old filename column (old_name_col) and new filename column (new_name_col).

rename_df

dataframe containing old and new filenames for the hyperspec objects

old_name_col

column in rename_df with old filenames

new_name_col

column in rename df with new filenames

Examples

1
2
3
4
data("hs_example")

# Remove path from spectral ID
hs_tidy_filenames(hs_example, remove_pattern = "path")

CMET-UGent/MicroRaman documentation built on July 25, 2020, 6:20 p.m.