swat: SWAT: SAS Wrapper for Analytics Transfer (SWAT)

swatR Documentation

SWAT: SAS Wrapper for Analytics Transfer (SWAT)

Description

This package enables you to connect from R to a SAS Cloud Analytic Services host, run actions on in-memory tables, and work with the results of the actions.

  • The CAS class provides an interface to your connection to the CAS server and CAS session.

  • The CASTable class provides an interface to the in-memory tables.

  • The casDataFrame class provides an interface to the results for most actions.

Details

Depending on how you install the package, you might be able to use binary communication with CAS. This is more efficient for bandwidth, but requires that your R installation have access to a precompiled library (rswat.so or rswat.dll). An alternative is to communicate with the server using the REST interface of the server over HTTP. See the connection examples that follow.

The responses and results of the actions are returned as R objects.

Connect and start a session

  s  <- CAS('cloud.example.com', 5570)  # binary communication

  s2 <- CAS('cloud.example.com', 8777, protocol='https')

Run a simple action

   results <- runAction(s, "builtins.serverStatus")
   results$server
   nodes actions
 1     1      15

You can also run an action using the generated R function:

   results <- cas.builtins.serverStatus(s)
   results$server
   nodes actions
 1     1      15

Upload a data.frame to a CASTable

  irisct <- as.casTable(s, iris)

Load a CAS actionSet

  runAction(s, "builtins.loadActionSet", actionSet="regression")

Useful links

Action documentation

See the Actions and Action Sets by Name and Product

Author(s)

Maintainer: Jared Dean Jared.Dean@sas.com

Authors:


sassoftware/R-swat documentation built on Feb. 19, 2025, 10:33 a.m.