create ''.gz'-filenames from a list or dataframe

Share:

Description

creates filenames based on a list or dataframe with the (header)-names:

area source parameter resolution timestep date1 date2 option

by aligning the defined filetype:

e.g. area_source_parameter_resolution_timestep_date1_date2.option.filetype

Usage

1
name_join(parts,filetype='gz')

Arguments

parts

a list or dataframe with the parts:

  • area , the region keyword

  • source , the data source

  • param , the parameter saved in the '.gz'-file. Can only be one value!

  • resolution , the spatial resolution

  • timestep , the temporal resolution

  • date1 & date2 , the temporal resolution (the time interval covered).

  • option a character string holding supplmentary information of '.gz'-file treatment

filetype

character string inidicating the filtype to be checked. ('.gz' by default)

Author(s)

Herve Demarq, translated from IDL by Robert K. Bauer

See Also

See check_gzfiles to return summary of available '.gz'-files and name_split to split '.gz'-filenames

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Example: read and plot '.gz'-file
owd <- getwd()
setwd(system.file("test_files", package="oceanmap"))
check_gzfiles() # return file summary-table
gz.files <- Sys.glob('*.gz') # load sample-'.gz'-files

# return summary of availble '.gz'-files
# suffix-column corresponds to option column of the name_join-call
# addition n-column returns the number of available files per filetype
check_gzfiles(gz.files)

## Example: split and rejoin '.gz'-filenames
name_split(gz.files) # return summary-table per file
name_join(name_split(gz.files))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.