SAS to R (unb01)

The following SAS code is probably reading two excel files. What else is it doing? Could you please give a high-level overview of the code from R's perspective?

# Part A
LIBNAME RA 'C:\Users\Steve\UNDO\ADRAW';
LIBNAME XX 'C:\Users\Steve\UNDO\PHD'; 

# Part B
PROC IMPORT OUT=WEEK DATAFILE= "C:\Users\Steve\input\Week.xlsx" DBMS=xlsx REPLACE;run;
PROC IMPORT OUT=TRIP DATAFILE= "C:\Users\Steve\input\Trip.xlsx" DBMS=xlsx REPLACE;run;

# Part C
	Data trip;
	set trip;
	fmtname='TRIP';
	Start=Start;
	label=TRIP;run;

	Proc format CNTLIN=TRIP;run;
# Part D
	Data Week;
	set Week;
	fmtname='WEEK';
	Start=Start;
	label=Week;run;

	Proc format CNTLIN=WEEK;run;
*end ;

One of several utilities, from the {xlsx} package

file <- system.file("tests", "test_import.xlsx", package = "xlsx")
res <- read.xlsx(file, 1)  # read first sheet
head(res)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.