Using data files with statistical and mathematical software on IUanyWare

When using local data files with an IUanyWare application, you must point the application to the location of those files (i.e., in a folder on your computer's hard drive or on a flash drive).

In an application with a graphical user interfaces, to point to the appropriate drive, folder, and file(s), use the Open dialog box in the File menu (see Save your files when using an IUanyWare application).

In an application with a command-line or text user interface, you may need to type the path to the local files along with application-specific commands, statements, and/or arguments. See the examples below, depending on the application you are using:

Three examples are provided for each application (except R):

  • Read in a software-specific file or library.
  • Import a Microsoft Excel file. (Due to compatibility issues between 64-bit and 32-bit Excel files, you may need to save your Excel files in .csv format.)
  • Read in a tab-delimited text file with three variables and variable names in the first row

Each example assumes your local data files are stored in a Temp folder on your desktop (Windows: C:\\Users\You\Desktop\Temp; macOS: /Users/You/Desktop/Temp). Customize the local path and commands, as needed, depending on the location of your file(s).

If you have questions about using statistical and mathematical software at Indiana University, contact Research Analytics. Research Analytics is located on the IU Bloomington campus at Woodburn Hall 200; staff are available for consultation Monday-Friday 9am-noon and by appointment.


R

R does not have its own data format. Additionally, UITS does not recommend that you import data into R directly from an Excel file. Rather, you should save the Excel spreadsheet as a CSV file or a text file and use one of the following commands:

Comma-delimited file
data <- read.csv("//Client/C$/Users/You/Desktop/Temp/test.csv", header=T)
Tab-delimited text file
data <- read.table("//Client/C$/Users/You/Desktop/Temp/test.txt", header=T)

SAS

SAS library
LIBNAME st "\\Client\C$\Users\You\Desktop\Temp";
Excel file
PROC IMPORT OUT= work.newdata 
   DATAFILE= "\\Client\C$\Users\You\Desktop\Temp\test.xlsx" 
   [additional statements]
RUN; 
Tab-delimited text file
DATA work.newdata;
   INFILE "\\Client\C$\Users\You\Desktop\Temp\test.txt";  
   [additional statements]
RUN;

SPSS

SPSS data file
GET FILE='\\Client\C$\Users\You\Desktop\Temp\test.sav'. 
Excel file
GET DATA 
  /TYPE=XLSX 
  /FILE='\\Client\C$\Users\You\Desktop\Temp\test.xlsx' 
  [additional statements]
EXECUTE.
Tab-delimited text file
GET DATA
  /TYPE=TXT
  /FILE='\\Client\C$\Users\You\Desktop\Temp\test.txt'
  [additional statements]
EXECUTE.

Stata

Stata data file
use "\\Client\C$\Users\You\Desktop\Temp\test.dta", clear
Excel file
import excel "\\Client\C$\Users\You\Desktop\Temp\text.xlsx", clear
Tab-delimited text file
insheet using "\\Client\C$\Users\You\Desktop\Temp\test.txt", clear

This is document bbtr in the Knowledge Base.
Last modified on 2018-10-10 18:26:24.

Contact us

For help or to comment, email the UITS Support Center.