Learn R Programming

RavenR (version 2.2.0)

rvn_write_Raven_newfile: Opens/Creates a new file, writes common file header.

Description

Opens/Creates a new file, writes common file header.

Usage

rvn_write_Raven_newfile(
  filename,
  description,
  filetype,
  author = NULL,
  creationDate = TRUE,
  linelen = 74,
  textlen = 40
)

Value

TRUE

returns TRUE if executed successfully

Arguments

filename

Name of the file, with extension

description

File Description (e.g., Basin or project information, R script name)

filetype

File extension, Encoding, Raven version (e.g. "rvp ASCII Raven 2.9.1")

author

Name of file author (optional)

creationDate

Bool of whether creation date should be added to header. (default TRUE)

linelen

length (width) of header, in text characters (default: 74)

textlen

Length of textlines (default: 40, used to right-align text)

Author

Leland Scantlebury, leland@scantle.com

Examples

Run this code
tf <- file.path(tempdir(), "HogwartsBasin.rvp")
rvn_write_Raven_newfile(filename = tf,
                description = "Hogwarts River Basin RVP File Generated by HP_FileGen.R",
                filetype = "rvp ASCII Raven 2.9.1",
                author = 'Harry Potter')

# view file
readLines(tf)

Run the code above in your browser using DataLab