## Abstract

R is one of the world’s fastest developing open-source projects today. It is statistical software that is widely used in academic institutions, industry, and research facilities. Because R is free, it has become an important resource for many statisticians in the developing world in particular. All the common activities of the modern statistician are possible within R, such as data manipulation, calculation and graphical display.

R can be used successfully by screen reader users with almost no modification. In the presenter’s opinion, this software is the best option available for blind people needing to analyse numerical data.

Dealing with statistics is no longer the domain of mathematically competent people alone. Decisions in scientific research as well as in industry and government are dependent on evidence. As a consequence, the ability to be literate with statistics, even at a basic level, is becoming even more important than it was in the past. This will often be demonstrated by successful completion of a course in statistics as part of a degree at university.

Blind job seekers will improve their employment prospects if they are able to show their competence in dealing with statistics. R offers the blind person access, especially if we link the ability to use the right software with our specialised hardware.

This tutorial will demonstrate how to import data and then create simple numeric summaries, such as those taught in the first few weeks of most introductory statistics courses.

## Getting started

We assume R is installed. It is a simple installation exercise. Get the latest installer for R under Windows. Users of other operating systems will need to find the appropriate version at CRAN - the Comprehensive R Archive Network.

We also need a document conversion toolkit called pandoc. If you have not installed it already you can obtain a copy from the pandoc download page.

You should also have the add-on package known as BrailleR installed. Having BrailleR installed ensures that the other add-on packages we use in this session are also installed.

Take special note: We do not need to do anything different to our sighted colleagues to get R up and running for us. That’s right — no special setup instructions.

R works in several different modes. We can run it interactively using the terminal or GUI. We will start by using the GUI like everyone else would when they first start using R.

## Useful documents

I have been creating an e-book called “Let’s Use R Now” as a means of supporting students getting started with R. I call it “LURN” for short. There are two main audiences: First, I teach statistics to students seeing R for the first time. Some have already used other software for their introductory courses. Second, I have made the e-book accessible so that blind students can use it easily.

LURN gets updated every now and again and is available in a range of formats. The latest version is available at the LURN home page.

You should have a copy of LURN in pdf and html — Choose the one that works best for you.

## A first exercise

Let’s type in some commands. Try

    getwd()

to see what R thinks you have chosen for your working directory. (We’ll need to know this information in a minute or two.)

Now try something numeric:

    sample(40,10)

Review the screen to see what R has generated for you. We can ask that the result of any command be stored for later use. Edit the last command issued by first pressing the up arrow.

    MySample = sample(40,10)

Again, check the screen and see what R has given you. Try

    MySample

In general, R does not give the user lots of feedback. I call it “what you request is what you get”.

We can try some functions like:

    mean(MySample)
sd(MySample)

These are summary statistics so only one number is returned.

Let’s close R now. Use the standard ALT+F4 key combination. Say “yes” to the question about saving your workspace. Note that this is the most accessible dialogue R has to offer you.

## Switching to the terminal version (Windows users)

The installation process included placing a shortcut on the desktop. This was for the GUI version that we just used. We can make an additional shortcut for the terminal version by:

1. Find the main R shortcut.
2. Hit copy (CTRL+C) and then paste (CTRL+V).
3. Find the new shortcut and rename it using the F2 key.
4. Edit the target file that this shortcut points towards. You will need to hit Alt+Enter to get to the shortcut properties. Instead of “Rgui.exe”, we want “RTerm.exe” — you’ll need to hit OK to get this to finish.

Now open R in terminal mode using your new shortcut. Check the working directory is what you expected it to be. If it is, then the commands you entered before and the data saved will be there. Use the up and down arrow keys to see.

N.B. There are times when the screen reader loses focus and typing does not lead to commands being generated. The solution is to tap the Alt key once and start typing again. It is annoying, but a small price to pay for accessibility.

## Mathematical operations

R can be used like a calculator

    MySample+5
sqrt(MySample)

Notice that these operations worked on every element of your sample.

Try a few other experiments. You may need to use brackets to get what you want. Always use round brackets for commands; square brackets and curly braces have special uses.

You can put one command inside another.

## Basic accessibility strategies

One strategy for reading the output from a number of statistical software options is to send the text displayed on screen to a text file. The file is viewed in an internet browser so that updates can be seen by refreshing the browser after each additional set of commands is issued.

In R this could be achieved using the sink() command. It would be issued using something like:

    sink("MyTest.txt")
mean(MySample)

The command would be printed on screen, but not the output. You would need to look for the output in the text file mentioned in the sink() command. You could open this file in a browser and leave it open while you issued more commands. For example, by asking R for the standard deviation:

    sd(MySample)

You would then need to go back to the browser and see what was there. You need to remember to refresh the browser, usually using the f5 key. To stop adding to the file, you would issue the command:

    sink()

This process works, but it is quite cumbersome. It is how other people have been accessing output from software such as SPSS and Stata for years.

## The BrailleR package

I’ve been working on making R even easier and more efficient to use for blind people since late 2011; all my work goes into the BrailleR package for use by other blind people, and into the LURN e-book in order to demonstrate what is possible.

The first example I like to show people is for a histogram. You can issue these commands for yourself if you like, or just read through the output provided. Comments are given following the number sign (hash) and do not need to be typed into R.

library(BrailleR) # once per session
The BrailleR.View,  option is set to FALSE.

Attaching package: 'BrailleR'
The following objects are masked from 'package:graphics':

boxplot, hist
The following object is masked from 'package:utils':

history
attach(airquality) # gain access to some data that comes with R
MyHist = hist(Ozone)  # create a histogram

VI(MyHist)  # a Visual Interpretation of the graph given in text 
This is a histogram, with the title: Histogram of Ozone
"Ozone" is marked on the x-axis.
Tick marks for the x-axis are at: 0, 50, 100, and 150
There are a total of 116 elements for this variable.
Tick marks for the y-axis are at: 0, 10, 20, and 30
It has 9 bins with equal widths, starting at 0 and ending at 180 .
The mids and counts for the bins are:
mid = 10  count = 37
mid = 30  count = 34
mid = 50  count = 14
mid = 70  count = 15
mid = 90  count = 9
mid = 110  count = 4
mid = 130  count = 2
mid = 150  count = 0
mid = 170  count = 1
detach(airquality) # drop the data set as we don't need it anymore

## Concluding remarks

I can’t show you everything great about R. I have shown you that:

1. R works for blind people. We can therefore work with our sighted peers in as near to equal way as we can currently hope from statistical software.
2. R offers blind students a back up plan for creating statistical analyses when other options fail us.

Why wouldn’t we use R?

I am willing to help anyone that uses R when they get to university. If you can’t find an answer to your question on my webpages (including LURN) then please href{mailto:a.j.godfrey`massey.ac.nz}{send me an email.} I will try to help as best I can. Please mention that you attended this workshop to remind me who you are.