P

Peter Alping

Git Minimal Setup

To install Git on Windows with minimal changes to you system follow these steps: Download the portable version from git-scm.com Extract the archive into an applications folder in your home directory, e.g. C:\Users\<username>\Applications Edit environmental variables for your account and to the Path variable add %USERPROFILE%\Applications\Git\bin (or whatever path you chose in step 2) Test by opening a new terminal and running the command git --version which should print something like...
Read post

Python Setup with Anaconda

Anaconda is a platform for managing virtual environments and packages for Python and R. Miniconda is a minimal installer for Anaconda, which only contains the necessary packages. It is important to use virtual environments to separate the development environments of different projects and this is made easy using Anaconda. You can read more about virtual environments here. Installation If you just want a normal installation of Anaconda, download the latest executable of Miniconda and install l...
Read post

STATA on Remote Server

This is a brief documentation of how to install STATA packages in a remote workspace for an end user that will not have internet access. This assumes that STATA is already installed on the server. We will also assume that we can access the server workspace at G:\user_id\, that the user can access it from H:\, and that the directory structure looks like this: ├── applications <- Applications added by the administrator │ └── stata │ └── ado <- STATA packages └── user ...
Read post

R on Remote Server

This is a brief documentation of how to set up an R environment in Windows in a remote workspace for an end user that will not have internet access. We will assume that we can access the server workspace at G:\user_id\, that the user can access it from H:\, and that the directory structure looks like this: ├── applications <- Applications added by the administrator │ └── r │ ├── libraries <- R packages │ ├── R <- Base R files │ └── RStudio <- O...
Read post

SAS Scripts - Better Exit Codes

Normally, if a SAS script generates any warnings the exit code is 1, which is generally interpreted as an error by the terminal. To avoid this, we can run SAS through a batch script which converts exit code 1 to 0 (meaning OK). The batch script can be found here. :: Name: sascli.cmd :: Purpose: Run SAS scripts with more generous exit codes. Normally, if a SAS :: script runs with warnings the exit code is 1 (interpreted as an :: error). This script converts exit code 1 to 0 ...
Read post

SAS to CSV - The Free Way

Free as in Freedom As I mentioned in SAS to CSV - The Easy Way, I don't do much of my actual work in SAS, but some of the data I receive is still in the SAS data format. This lead me to create a SAS script to easily convert .sas7bdat files into .csv files that you can find here. But what if we don't have SAS installed on our computer in the first place? It is an expensive piece of software after all, and not really in line with the Open Data paradigm. Luckily, other people have created packa...
Read post

SAS to CSV - The Easy Way

Since I don't do much of my work in SAS, but some of the data I receive is in SAS format, I've created a SAS script that can be run from the terminal to convert a .sas7bdat file into an ordinary .csv file (optionally compressed to .csv.gz). There is also a Python script to run batch conversions of many SAS data files in parallel. This requires both Python and SAS to be installed. The SAS and Python scripts can be found here. Single file conversion Make sure SAS is on the path and from the roo...
Read post