R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

library(SASmarkdown)
## Warning: package 'SASmarkdown' was built under R version 4.0.3
## sas, saslog, sashtml, and sashtmllog engines
##    are now ready to use.

proc means data=sashelp.class;
run;
##                                          The MEANS Procedure
## 
##             Variable     N            Mean         Std Dev         Minimum         Maximum
##             ------------------------------------------------------------------------------
##             Age         19      13.3157895       1.4926722      11.0000000      16.0000000
##             Height      19      62.3368421       5.1270752      51.3000000      72.0000000
##             Weight      19     100.0263158      22.7739335      50.5000000     150.0000000
##             ------------------------------------------------------------------------------

use SAS html engine format to make nicer output


proc means data=sashelp.class;
run;
Variable N Mean Std Dev Minimum Maximum
Age
Height
Weight
19
19
19
13.3157895
62.3368421
100.0263158
1.4926722
5.1270752
22.7739335
11.0000000
51.3000000
50.5000000
16.0000000
72.0000000
150.0000000

use SAS log engine format to output sas log

2          
3          proc means data=sashelp.class;
4          run;

NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The PROCEDURE MEANS printed page 1.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.93 seconds
      cpu time            0.15 seconds
      

5          
##                                          The MEANS Procedure
## 
##             Variable     N            Mean         Std Dev         Minimum         Maximum
##             ------------------------------------------------------------------------------
##             Age         19      13.3157895       1.4926722      11.0000000      16.0000000
##             Height      19      62.3368421       5.1270752      51.3000000      72.0000000
##             Weight      19     100.0263158      22.7739335      50.5000000     150.0000000
##             ------------------------------------------------------------------------------

proc corr data=sashelp.class plots=matrix;
run;
3 Variables: Age Height Weight

Simple Statistics
Variable N Mean Std Dev Sum Minimum Maximum
Age 19 13.31579 1.49267 253.00000 11.00000 16.00000
Height 19 62.33684 5.12708 1184 51.30000 72.00000
Weight 19 100.02632 22.77393 1901 50.50000 150.00000

Pearson Correlation Coefficients, N = 19
Prob > |r| under H0: Rho=0
Age Height Weight
Age
1.00000
0.81143
<.0001
0.74089
0.0003
Height
0.81143
<.0001
1.00000
0.87779
<.0001
Weight
0.74089
0.0003
0.87779
<.0001
1.00000

Scatter Plot Matrix


set engine back to R and test R code

plot(cars)

reference:

need to put inside {}: sas engine="sas", engine.path="C:\Program Files\SASHome\SASFoundation\9.4\sas.exe"

need to put inside {}:r, engine="sashtml", engine.path="C:\Program Files\SASHome\SASFoundation\9.4\sas.exe", error=T

need to put inside {}: r, engine="saslog", engine.path="C:\Program Files\SASHome\SASFoundation\9.4\sas.exe", error=T

need to put inside{}: r, engine="R"