Skip to contents

We are looking for Windows 11 testers!!!


the Haabefuld1,2 Utility Box_ (theHUB) was developed and designed on a Mac. theHUB should work on a Windows system, but R requires a different set of applications for macOS versus Windows. Please let Emilio know if you have any trouble and he will help you out.

Setting up R and RStudio

R and RStudio are open source and freely available applications available for numerous, popular operating systems. Specifically, RStudio is available for Windows 10, macOS 10.13+, Ubuntu 16, Ubuntu 18/Debian 10, Fedora 19/Red Hat 7, Fedora 28/Red Hat 8, Debian 9, OpenSUSE 15.

Installing R

Visit CRAN and download the installer (“Precompiled binary distributions of the base system and contributed packages”) for your operating system. Mac and Windows users should download the version available from CRAN. Linux users should check their distribution’s package management system to see if R is available.

Installing RStudio

  • Download RStudio from the RStudio server.
  • Double-click on the file and follow the directions for your operating system.

Installing Packages

install.packages("devtools", "tidyverse", "lubridate", 
                 "readxl", "openxlsx", 
                 "cowplot", "GGally", "ggtext", "ggwordcloud", "ggVennDiagram", "geomtextpath",
                 "tidytext", "textdata", "ragg", "hexbin", "sf", "fuzzyjoin",
                 "zipcodeR")

We use a select collection of packages to construct plots that stand out. We rely heavily on

Data Visualization Resources

There are several developmental packages that need to be installed from GitHub.

fix missing fonts when writing a PDF https://github.com/thomasp85/ggraph/issues/152 via Malcolm Barrett extrafont::font_import() (Restart Rstudio)

extrafont::loadfonts()

Use ragg with knitr

knitr supports png output from ragg by setting dev = "ragg_png" in the chunk settings or globally with knitr::opts_chunk$set(dev = "ragg_png").

Use ragg in RStudio

ragg can be used as the graphic back-end to the RStudio device (for RStudio >= 1.4) by choosing AGG as the backend in the graphics pane in general options (see screenshot)

Setup zipcodeR

library(zipcodeR)
download_zip_data(force = FALSE)

OS Functions

There are two ways to install via Homebrew and MacPorts. According to various websites, it is possible to have both Homebrew and MacPorts installed without any problems.

Installing Homebrew is straightforward

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Installing MacPorts is a bit more involved, and specific install scripts are available for each macOS version. After installing MacPorts, run the following from the macOS Terminal.

wget

wget is a command line function to download website files. It is needed to download historical datasets and map shapefile from their respective websites.

macOS

wget via Homebrew

brew install wget

wget via MacPorts

sudo port install wget
Windows 10 & 11

Compliers

Download and Install the Oracle Database JDBC driver and Companion Jars Downloads

Visit the Oracle Database JDBC driver and Companion Jars Downloads page and download the Zipped JDBC driver (ojdbc11.jar) and Companion Jars file.

The following instructions are for installation on macOS (version 11 or newer). Similar steps should work on Linux and Windows.

Command Line Install

Within your home directory (aka folder) create a software directory. Move the ojdbc11-full.tar.gz file into the software and unzip the file. The easiest way to accomplish this is via the macOS Terminal. When downloading the ojdbc11-full.tar.gz file you were likely given the option where to save it. Please save it to the Downloads directory.

emilio@iMac ~ % mkdir -p software
emilio@iMac ~ % cd software
emilio@iMac software % tar zxvf ~/Downloads/ojdbc11-full.tar.gz
emilio@iMac software % cd ojdbc11-full
emilio@iMac ojdbc11-full % ls
Javadoc-Readmes    ojdbc.policy      ojdbc11dms_g.jar   osdt_cert.jar    ucp11.jar
LICENSE.txt        ojdbc11.jar       ons.jar            osdt_core.jar    xdb.jar
README.txt         ojdbc11_g.jar     oraclepki.jar      rsi.jar          xmlparserv2.jar
dms.jar            ojdbc11dms.jar    orai18n.jar        simplefan.jar    xmlparserv2_sans_jaxp_services.jar

Install Via the File Viewer

Open a macOS finder window and ensure you are in your home directory.

  • Create a folder called “software”
  • Copy (or move) the ojdbc11-full.tar.gz file to the software folder
  • Double click the ojdbc11-full.tar.gz file to unzip the file

Location of the OJDBC Jar File

The location (aka complete path) of the ojdbc11.jar file is needed to set the classPath variable for the RJDBC::JDBC() function within the R script below. For my installation, the classPath is /Users/emilio/software/ojdbc11-full/ojdbc11.jar

dBeaver

dBeaver Community is a

“free multi-platform [macOS, Windows, Linux, there is even an Eclipse plugin] database tool for developers, database administrators, analysts and all people who need to work with databases” that “supports all popular databases: MySQL, PostgreSQL, SQLite, Oracle, DB2, SQL Server, Sybase, MS Access, Teradata, Firebird, Apache Hive, Phoenix, Presto, etc.”

Download & Install

Please see our document for setting up dBeaver to access the MSUEDW.

Microsoft Visual Studio Code

With the sunsetting of GitHub’s Atom the I find Microsoft Visual Studio Code to be an excellent text editor. Yes. I use, kinda like, and endorse using Microsoft Visual Studio Code. (Younger me is so disappointed.)

It has a lot of great R-related features including “syntax highlighting, R language service based on code analysis, interacting with R terminals, viewing data, plots, workspace variables, help pages, managing packages, and working with R Markdown documents” via REditorSupport, is awesome for viewing (and sometime editing) CSV files (and other delimited files) with Rainbow CSV, and has an Atom teletype-like feature called Live Share. It also provide Python integration!

  • Download Microsoft Visual Studio Code here.
  • Instructions to install Extensions are available here.
  • Explore the Extensions marketplace here.

Commonly installed extensions: