diff --git a/NPOD Organizing Data for Analysis Workshop 2019.pptx b/NPOD Organizing Data for Analysis Workshop 2021 final.pptx
similarity index 58%
rename from NPOD Organizing Data for Analysis Workshop 2019.pptx
rename to NPOD Organizing Data for Analysis Workshop 2021 final.pptx
index c65a047851c01a672a413ab890fca30db16a088e..8927efaf82006ce458da858360373c7f5f656cd8 100644
Binary files a/NPOD Organizing Data for Analysis Workshop 2019.pptx and b/NPOD Organizing Data for Analysis Workshop 2021 final.pptx differ
diff --git a/R/Example1.R b/R/Example1.R
new file mode 100755
index 0000000000000000000000000000000000000000..a7d891056bacb9ef7da51c5eb69ad0798998d65b
--- /dev/null
+++ b/R/Example1.R
@@ -0,0 +1,32 @@
+require(tidyverse)
+library(readxl)
+
+FeedIntake <- read_excel("Example 1.xlsx", 
+                         sheet = " Feed Intake") 
+colnames(FeedIntake)[-(1:3)]=paste("Week",1:21)
+
+FeedIntake
+
+Strength <- read_excel("Example 1.xlsx", 
+                        sheet = "strength", na = c("N/A","N","N/a") ) %>%
+  rename(TRT=`Trt #`)
+colnames(Strength)[-(1:3)]=paste("Week",c(1:8,10:13,16:21))
+
+Strength
+
+FeedIntake_long<-FeedIntake %>%
+  pivot_longer(-(Farm:TRT),names_to="Week",values_to="Feed Intake",)
+
+Strength_long<-Strength %>%
+  fill(Farm:TRT) %>%
+  group_by(Farm,`Pen #`,TRT) %>%
+  mutate(Rep=row_number()) %>%
+  pivot_longer(-c(Farm:TRT,Rep),names_to="Week",values_to="strength")  %>%
+  group_by(Farm,`Pen #`,TRT,Week) %>%
+  summarise(strength=mean(strength,na.rm=TRUE))
+  
+
+Combined <-FeedIntake_long %>%
+  full_join(Strength_long)
+  
+
diff --git a/R/Example2.R b/R/Example2.R
old mode 100644
new mode 100755
index 2adaa8d1c79f272f1cf12fa2b0b0cbdba628f1de..91dbcc64f5a9e81868d0d76356cc9836ccfc0527
--- a/R/Example2.R
+++ b/R/Example2.R
@@ -1,7 +1,7 @@
 #' ---
 #' title: "NPOOD Workshop Organizing Data for Analysis: Example 2"
 #' author: "Steve Kachman"
-#' date: "Summer 2019"
+#' date: "Summer 2021"
 #' ---
 
 require(tidyverse)
@@ -50,7 +50,7 @@ Treatments <- Weight %>%
 Treatments
 
 #'
-#' Add treatment informaion to the FeedIntake tibble
+#' Add treatment information to the FeedIntake tibble
 #' 
 
 FeedIntake <- FeedIntake %>%
@@ -64,7 +64,7 @@ FeedIntake
 #' 
 
 FeedIntake_long <- FeedIntake %>%
-  gather(key="Week",value="Feed Intake",`2 wks`:`8 wks`) %>%
+  pivot_longer(`2 wks`:`8 wks`,names_to="Week",values_to="Feed Intake") %>%
   mutate(Week=parse_number(Week))
 
 FeedIntake_long
diff --git a/R/Example3.R b/R/Example3.R
new file mode 100755
index 0000000000000000000000000000000000000000..56c128dca1b3c800b848a598d8f22bd790ef4314
--- /dev/null
+++ b/R/Example3.R
@@ -0,0 +1,6 @@
+require(tidyverse)
+
+library(readxl)
+Example_3 <- read_excel("Example 3.xlsx", 
+                        sheet = "SAS")
+View(Example_3)
diff --git a/SAS/import intake and weight.sas b/SAS/import intake and weight.sas
deleted file mode 100644
index 29534c5017b3f424ae3d06894d4dd25281539f76..0000000000000000000000000000000000000000
--- a/SAS/import intake and weight.sas	
+++ /dev/null
@@ -1,22 +0,0 @@
-PROC IMPORT OUT= WORK.intake 
-            DATAFILE= "C:\Users\Kathy\Statistics Department\NPOD\Organiz
-ing Data for Analysis Workshop 2019\Example 2.xlsx" 
-            DBMS=EXCEL REPLACE;
-     RANGE="' Feed Intake$'"; 
-     GETNAMES=YES;
-     MIXED=NO;
-     SCANTEXT=YES;
-     USEDATE=YES;
-     SCANTIME=YES;
-RUN;
-
-PROC IMPORT OUT= WORK.weight 
-            DATAFILE= "C:\Users\Kathy\Statistics Department\NPOD\Organizing Data for Analysis Workshop 2019\Example 2.xlsx" 
-            DBMS=EXCEL REPLACE;
-     RANGE="Weight$"; 
-     GETNAMES=YES;
-     MIXED=NO;
-     SCANTEXT=YES;
-     USEDATE=YES;
-     SCANTIME=YES;
-RUN;
diff --git a/SAS/import intake csv 08052021l.sas b/SAS/import intake csv 08052021l.sas
new file mode 100644
index 0000000000000000000000000000000000000000..4aba05e3d7683e96c543755182b7d79c95c800ae
--- /dev/null
+++ b/SAS/import intake csv 08052021l.sas	
@@ -0,0 +1,7 @@
+PROC IMPORT OUT= WORK.INTAKEcsv 
+            DATAFILE= "C:\Users\Kathy\Statistics Department\NPOD\Organiz
+ing Data for Analysis Workshop 2021\files for participants\Example 2.csv" 
+            DBMS=CSV REPLACE;
+     GETNAMES=YES;
+     DATAROW=2; 
+RUN;
diff --git a/SAS/import intake exel.sas b/SAS/import intake exel.sas
new file mode 100644
index 0000000000000000000000000000000000000000..9af40416dd46e36f09e0bdc420ebaaaced00c728
--- /dev/null
+++ b/SAS/import intake exel.sas	
@@ -0,0 +1,12 @@
+PROC IMPORT OUT= WORK.intake 
+            DATAFILE= "C:\Users\Kathy\Statistics Department\NPOD\Organiz
+ing Data for Analysis Workshop 2021\files for participants\Example 2.xls
+x" 
+            DBMS=EXCEL REPLACE;
+     RANGE="' Feed Intake$'"; 
+     GETNAMES=YES;
+     MIXED=NO;
+     SCANTEXT=YES;
+     USEDATE=YES;
+     SCANTIME=YES;
+RUN;
diff --git a/SAS/transposing repeated intake data complex with comments.sas b/SAS/transposing repeated intake data complex with comments.sas
new file mode 100644
index 0000000000000000000000000000000000000000..b397cbf8cea81f046ffd17e71e0e9bf5ee04bb4d
--- /dev/null
+++ b/SAS/transposing repeated intake data complex with comments.sas	
@@ -0,0 +1,44 @@
+*note that you need to change the path for the filename to the one on your;
+*computer. ;
+PROC IMPORT OUT= WORK.INTAKE1 
+            DATAFILE= "C:\Users\Kathy\Statistics Department\NPOD\Organiz
+ing Data for Analysis Workshop 2021\Example 1.xlsx" 
+            DBMS=EXCEL REPLACE;
+     RANGE="' Feed Intake$'"; 
+     GETNAMES=YES;
+     MIXED=NO;
+     SCANTEXT=YES;
+     USEDATE=YES;
+     SCANTIME=YES;
+RUN;
+*transposing by farm pen__ and trt, means that for each farm pen__;
+*trt combination, that it will transpose any other variables into a column;
+*in this case, the only other variables are the variables June_21_July_5 to;
+*March_14__March_28.  Note that the order of the intake rows are dependent;
+*on the order of the columns in the dataset;
+
+proc transpose data=intake1 out=intrans1(rename=(col1=intake));
+   by farm pen__ trt;
+run;
+
+*this code is to correctly assign a week number to each observation;
+*and to rename the pen variable, so that it is easier to use;
+*When you set a dataset by variables in the data, this tells SAS;
+*that you want to keep track of which record SAS is on in the dataset;
+*within the variables.  We really only needed to set by farm pen__, since;
+*we are using the pen variable in our if statement;
+data intaketrans1;
+retain week; *this tells SAS to keep the current value in week from record
+to record.  Otherwise, SAS would assign . to week;
+drop _name_ _label_;
+rename pen__=pen;*note that the renaming doesn't take place until after the 
+dataset has been created;
+set intrans1;
+by farm pen__ trt;
+if first.pen__ then week=2; *if this is the first record of the current pen then
+set the week =2;
+else week=week+2; *if this is not the first record of the current pen then add
+2 to the week variable;
+output; *this tells SAS to output the record to the new intaketrans1 dataset;
+run;
+
diff --git a/SAS/transposing repeated intake data.sas b/SAS/transposing repeated intake data from class.sas
similarity index 55%
rename from SAS/transposing repeated intake data.sas
rename to SAS/transposing repeated intake data from class.sas
index d652d8fe24ca8089b8dc311967e4b52f443d1b77..acc1a339447e7b18b62c51bd5439bd515362ae18 100644
--- a/SAS/transposing repeated intake data.sas	
+++ b/SAS/transposing repeated intake data from class.sas	
@@ -1,13 +1,18 @@
+*note that you need to run the import intake SAS program first;
+*in order to create the dataset needed;
 proc transpose data=intake out=intrans(rename=(col1=intake));
    by pen__ animal__;
 run;
+*this is to see what happens if you dont transpose by pen and animal';
+proc transpose data=intake out=intransn(rename=(col1=intake));
+run;
 *create new variable for week;
 data intaketrans;
 drop _name_ _label_;
 rename pen__=pen;
 rename animal__=id;
 set intrans;
-week= substr(_label_,1,1);
+week= substr(_label_,1,1); *substr function starting at the first character, pulls one character;
 run;
 
 
@@ -37,3 +42,7 @@ data intaketrt;
 merge intaketrans trt;
 by pen id;
 run;
+*example of merging without by pen id;
+data intaketrtgarbage;
+merge intaketrans trt;
+run;