write_gms: Write GMS file

View source: R/write_gms.R

write_gmsR Documentation

Write GMS file

Description

This function takes a data frame and writes it to a GMS file. The columns of the data frame, except the last one, are combined into a single column with period (".") as the separator.

Usage

write_gms(x, file)

Arguments

x

A data frame with the data in the last column and the sets in all previous columns.

file

Path to the output file.

Value

Invisible version of the modified data frame.

Examples

# Create a data frame
df <- data.frame(
  i = c(rep("seattle", 3), rep("san-diego", 3)),
  j = rep(c("new-york", "chicago", "topeka"), 2),
  value = c(2.5, 1.7, 1.8, 2.5, 1.8, 1.4)
)

# Write the data frame to a GMS file
write_gms(df, tempfile())


christophe-gouel/gamsr documentation built on Feb. 13, 2025, 12:42 p.m.