sas_from_r: Convert R table to SAS

View source: R/from-r.R

sas_from_rR Documentation

Convert R table to SAS

Description

Converts R table into a table in the current SAS session. R tables must only have logical, integer, double, factor, character, POSIXct, or Date class columns.

Usage

sas_from_r(x, table_name, libref = "WORK", factors_as_strings = TRUE)

Arguments

x

data.frame; R table.

table_name

string; Name of table to be created in SAS.

libref

string; Name of libref to store SAS table within.

factors_as_strings

logical; If TRUE, factors will become SAS strings. Else, factors will become formatted numerics.

Details

SAS only has two data types (numeric and character). Data types are converted as follows:

  • logical -> numeric

  • integer -> numeric

  • double -> numeric

  • factor -> character

  • character -> character

  • POSIXct -> numeric (datetime; timezones are lost)

  • Date -> numeric (date)

Value

data.frame; x.

See Also

sas_to_r()

Examples


sas_connect()

sas_from_r(mtcars, "mtcars")


sasquatch documentation built on Feb. 28, 2026, 1:07 a.m.