{"id":23331105,"url":"https://github.com/sassoftware/r-swat","last_synced_at":"2025-04-09T11:12:26.996Z","repository":{"id":19850099,"uuid":"88091195","full_name":"sassoftware/R-swat","owner":"sassoftware","description":"The SAS Scripting Wrapper for Analytics Transfer (SWAT) package is the R client to SAS Cloud Analytic Services (CAS). It allows users to execute CAS actions and process the results all from R.","archived":false,"fork":false,"pushed_at":"2025-02-14T17:41:18.000Z","size":1218,"stargazers_count":51,"open_issues_count":6,"forks_count":22,"subscribers_count":19,"default_branch":"main","last_synced_at":"2025-04-02T09:08:30.038Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sassoftware.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-12T19:59:55.000Z","updated_at":"2025-02-14T17:41:22.000Z","dependencies_parsed_at":"2023-09-23T12:41:49.668Z","dependency_job_id":"20d95c60-7444-4779-9f93-82a415e2c737","html_url":"https://github.com/sassoftware/R-swat","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sassoftware%2FR-swat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sassoftware%2FR-swat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sassoftware%2FR-swat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sassoftware%2FR-swat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sassoftware","download_url":"https://codeload.github.com/sassoftware/R-swat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248027411,"owners_count":21035594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-20T22:31:03.745Z","updated_at":"2025-04-09T11:12:26.971Z","avatar_url":"https://github.com/sassoftware.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SAS Scripting Wrapper for Analytics Transfer (SWAT) for R\n\nSWAT is an R package that enables you to interface with\nSAS Cloud Analytics Services (CAS), the in-memory server that is \nthe centerpiece of the [SAS Viya](http://www.sas.com/en_us/software/viya.html)\nplatform. \nUsing the SWAT package, you can write an R program that connects to a CAS server, \nanalyze large in-memory data sets, and then work with the results of the data \nanalysis using familiar data-wrangling techniques in R.\n\nThis package provides facilities for starting a CAS session and \nrunning actions in CAS--such as classifying data with a decision tree or modeling\nwith linear regression. Data processing is performed by CAS, which can scale from\na single-machine server to distributed servers that run on multiple hosts and\nperform massively parallel processing.\n\n## Installation and Configuration\n\n### Requirements\n\nTo use the SWAT package for R, the client machine that runs R must meet \nthe following requirements: \n\n* Use 64-bit Linux or 64-bit Windows. \n* Use a 64-bit version of R. \n* Use R 3.1.0 or later.\n* Install the ``dplyr``, ``httr`` and ``jsonlite`` packages. These packages\nhave additional dependencies that are automatically installed from CRAN\nwhen you run install.packages(). \n\n### Installation\n\nThe SWAT package for R is available from SAS as a tar.gz file. You can download \nreleases from https://github.com/sassoftware/R-swat/releases.\n\nAfter you download the package, you can install the package with a command that is \nsimilar to the following: \n\n```\nR CMD INSTALL R-swat-X.X.X-platform.tar.gz\n```\n\nYou can also install from within R directly using a URL.\n\n```\n# Make sure prerequisites are installed\n\u003e install.packages('dplyr')\n\u003e install.packages('httr')\n\u003e install.packages('jsonlite')\n\n\u003e install.packages('https://github.com/sassoftware/R-swat/releases/download/vX.X.X/R-swat-X.X.X-platform.tar.gz',\n                   repos=NULL, type='file')\n```\n\nIf you are running on a platform that does not have an associated installer, \nyou should install the source code tar.gz.  These platforms will be\nlimited to using the CAS REST interface only.\n\n```\n\u003e install.packages('https://github.com/sassoftware/R-swat/archive/vX.X.X.tar.gz', \n                   repos=NULL, type='file')\n```\n\n## Connecting to CAS\n\n### Authinfo File\nUsing a .authinfo file is not required to use the package, but is recommended. When you \nenter your credentials (user ID and password) in a .authinfo file and secure the \npermissions, you can avoid specifying those credentials in programs. \n\nThroughout the documentation, it is assumed that you have a .authinfo file. The following \nstatement connects R to CAS and supplies the credentials from the .authinfo file: \n\n```\nconn \u003c- swat::CAS('cloud.example.com', 8777, protocol='http')\n```\n\nIf you do not use a .authinfo file, then you must connect with a statement like the following: \n\n```\nconn \u003c- swat::CAS('cloud.example.com', 8777, protocol='http', username='sasdemo', password='!s3cret')\n```\n\n### Binary and REST Communication\n\nCommunication between R and CAS can be performed in a binary format with proprietary C \nlibraries, or over HTTP to a REST interface on the server. The C libraries (and therefore \nbinary communication) are supported for 64-bit Linux or Windows only. Connections to CAS that use \nbinary communication are similar to the following example: \n\n```\nconn \u003c- swat::CAS('cloud.example.com', 5570)\n```\n\n## Example\n\n```\n\u003e library(swat)\n\n# Connect to CAS\n\u003e conn \u003c- swat::CAS('cloud.example.com', 8777)\n\n# Load Iris data set into in-memory table\n\u003e iris.ct \u003c- as.casTable(conn, iris)\n\n# Use basic R functions on CAS table\n\u003e min(iris.ct$Sepal.Length)\n[1] 4.3\n\n\u003e max(iris.ct$Sepal.Length)\n[1] 7.9\n\n\u003e mean(iris.ct$Sepal.Length)\n[1] 5.843333\n\n# Call CAS actions on the table\n\u003e out \u003c- cas.simple.summary(iris.ct)\n\u003e out\n$Summary\n        Column Min Max   N NMiss     Mean   Sum       Std     StdErr       Var\n1 Sepal.Length 4.3 7.9 150     0 5.843333 876.5 0.8280661 0.06761132 0.6856935\n2  Sepal.Width 2.0 4.4 150     0 3.057333 458.6 0.4358663 0.03558833 0.1899794\n3 Petal.Length 1.0 6.9 150     0 3.758000 563.7 1.7652982 0.14413600 3.1162779\n4  Petal.Width 0.1 2.5 150     0 1.199333 179.9 0.7622377 0.06223645 0.5810063\n      USS       CSS       CV   TValue         ProbT\n1 5223.85 102.16833 14.17113 86.42537 3.331256e-129\n2 1430.40  28.30693 14.25642 85.90830 8.004458e-129\n3 2582.71 464.32540 46.97441 26.07260  2.166017e-57\n4  302.33  86.56993 63.55511 19.27060  2.659021e-42\n\n# Explore results\n\u003e out$Summary[c('Column', 'Min', 'Max')]\n```\n\nIf you get an error message about the **TCP/IP negClientSSL support routine**, you \nlikely have an issue with your SSL certificate configuration.  See the \n[Encryption](https://sassoftware.github.io/python-swat/encryption.html) documentation\n(the R configuration is the same as the Python client) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsassoftware%2Fr-swat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsassoftware%2Fr-swat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsassoftware%2Fr-swat/lists"}