{"id":31297264,"url":"https://github.com/alixlahuec/syntaxr","last_synced_at":"2025-10-13T11:16:01.870Z","repository":{"id":56936938,"uuid":"172167863","full_name":"alixlahuec/syntaxr","owner":"alixlahuec","description":"A simple R package that generates SPSS syntax from an R environment, using paste functions \u0026 pipes.","archived":false,"fork":false,"pushed_at":"2020-08-04T21:33:21.000Z","size":90,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-24T22:11:23.941Z","etag":null,"topics":["bulk-operation","r","rpackage","spss","syntax"],"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/alixlahuec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-23T03:44:48.000Z","updated_at":"2020-08-04T21:33:23.000Z","dependencies_parsed_at":"2022-08-21T06:50:06.866Z","dependency_job_id":null,"html_url":"https://github.com/alixlahuec/syntaxr","commit_stats":null,"previous_names":["greenmeen/syntaxr"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/alixlahuec/syntaxr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alixlahuec%2Fsyntaxr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alixlahuec%2Fsyntaxr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alixlahuec%2Fsyntaxr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alixlahuec%2Fsyntaxr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alixlahuec","download_url":"https://codeload.github.com/alixlahuec/syntaxr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alixlahuec%2Fsyntaxr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014761,"owners_count":26085593,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bulk-operation","r","rpackage","spss","syntax"],"created_at":"2025-09-24T22:06:09.854Z","updated_at":"2025-10-13T11:16:01.834Z","avatar_url":"https://github.com/alixlahuec.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"## syntaxr \u003cimg src=\"hex_sticker.png\" width = \"175\" height = \"200\" align=\"right\" /\u003e\nAn R package for generating bulk SPSS syntax from the R environment.\n\n[![Travis build status](https://travis-ci.org/greenmeen/syntaxr.svg?branch=master)](https://travis-ci.org/greenmeen/syntaxr)\n[![Coverage status](https://codecov.io/gh/greenmeen/syntaxr/branch/master/graph/badge.svg)](https://codecov.io/github/greenmeen/syntaxr?branch=master)\n[![Project Status: Inactive – The project has reached a stable, usable state but is no longer being actively developed; support/maintenance will be provided as time allows.](https://www.repostatus.org/badges/latest/inactive.svg)](https://www.repostatus.org/#inactive)\n[![CRAN Version](https://www.r-pkg.org/badges/version-ago/syntaxr?color=orange)](https://cran.r-project.org/package=syntaxr)\n[![](https://cranlogs.r-pkg.org/badges/grand-total/syntaxr?color=blue)](https://cranlogs.r-pkg.org/badges/grand-total/syntaxr?color=blue)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![DOI](https://zenodo.org/badge/172167863.svg)](https://zenodo.org/badge/latestdoi/172167863)\n\n**Note : Due to personal events in the past year, I am no longer working on developing further releases for the package. Recent updates to dependencies might or might not lead to broken code - please use at your own risk. If you run into problems, you can create an issue here on GitHub, or get in touch with me directly. I'll try to address it as soon as possible.**\n\n#### Description\n`syntaxr` provides overall enhanced flexibility for variable manipulation, and facilitates the streamlining of SPSS dataset transformation. This package was designed for systematic transformation of variables, and is especially suited for large datasets that don't lend themselves to easy bulk manipulation.\nIt can also be used to selectively apply SPSS functions to variables, according to simple or complex criteria.\n\n#### Installation\n- Recommended installation is through CRAN : `install.packages('syntaxr')`.\n- Alternatively, the latest development version can be installed with devtools : `devtools::install_github(\"greenmeen/syntaxr\")`.\n\n### Usage\n#### 1. Importing SPSS data (optional)\nHere's some sample code that asks the user to select an SPSS datafile, loads the data with the `haven` package, and extracts variable names and types. You can also use the `foreign` package.\n```r\n# Load haven and select a file\nlibrary('haven')\ndataset \u003c- haven::read_spss(choose.files())\n\n# Extract the vector containing all the variable names\nvars \u003c- names(dataset)\n# Obtain the class of the first element of each variable\ntypes \u003c- lapply(dataset, function(x) class(x[[1]][[1]]))\n\n# Summarize the information in a table\nsummary_table \u003c- cbind(vars, types, make.row.names = FALSE)\ncolnames(summary_table) \u003c- c(\"Variable Name\", \"Variable Type\")\n```\n\n#### 2. Functions available\n\n- Here is the list of the base SPSS functions that are currently supported by `syntaxr` :\n\n| SPSS syntax function |`syntaxr` function      | Additional information                |\n|---------------------:|:----------------------:|:--------------------------------------|\n|              concat()|`spss.format.concat()`  |Called by other functions (only)       |\n|                 max()|`spss.format.max()`     |Called by other functions (only)       |\n|               rtrim()|`spss.rtrim()`          |Used within other functions            |\n|               COMPUTE|`spss.format.compute()` |Requires a call to a format function** |\n|                STRING|`spss.string()`         |                                       |\n|      RENAME VARIABLES|`spss.rename()`         |                                       |\n\n** `spss.format.compute()` takes two arguments : the name of the computed variable, and the computation. The computation needs to have been formatted already (see function examples). I'm currently developing a feature where the function could take as argument a list that contains a regex and the necessary arguments, though that's still only an idea.\n\n- Additionally, the following functions are also available :\n\n| SPSS syntax function    |`syntaxr` function      | Additional information                                         |\n|------------------------:|:----------------------:|:---------------------------------------------------------------|\n|    COMPUTE _var_ = max()|`spss.compute.max()`    |                                                                |\n| COMPUTE _var_ = concat()|`spss.compute.concat()` |Assumes the new STRING already exists                           |\n|                         |`spss.concat.new()`    |Generates syntax using `spss.string()` to create a STRING first |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falixlahuec%2Fsyntaxr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falixlahuec%2Fsyntaxr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falixlahuec%2Fsyntaxr/lists"}