write.mif: Write .mif file

View source: R/write.mif.R

write.mifR Documentation

Write .mif file

Description

A wrapper around readr::write_lines for writing files conforming to the .mif standard.

Usage

write.mif(
  x,
  path,
  comment_header = NULL,
  comment = "#",
  append = FALSE,
  sep = ";",
  na = "NA"
)

write.IAMCcsv(
  x,
  path,
  comment_header = NULL,
  comment = "#",
  append = FALSE,
  sep = ",",
  na = ""
)

Arguments

x

A quitte data frame.

path

Path or connection to write to.

comment_header

Comment header to be written to the .mif file. Ignored if append is TRUE.

comment

A character to prefix comment header lines with. Must match existing comment characters in file path if append is TRUE.

append

Overwrite existing files (FALSE, default), or append to them (TRUE).

sep

Single character used to separate fields within a record. Defaults to ⁠;⁠.

na

String used for NA elements. Defaults to 'NA' for write.mif() and to '' for write.IAMCcsv().

Details

write.IAMCcsv() uses commas as filed separators instead of semi-colons.

Author(s)

Michaja Pehl

Examples

write.mif(quitte_example_data, tempfile())


pik-piam/quitte documentation built on April 12, 2025, 5:49 p.m.