Skip to content

Instantly share code, notes, and snippets.

@pgensler
Last active October 14, 2016 20:13
Show Gist options
  • Save pgensler/38b82bb3f0dcdeab66344c26eb845fb4 to your computer and use it in GitHub Desktop.
Save pgensler/38b82bb3f0dcdeab66344c26eb845fb4 to your computer and use it in GitHub Desktop.
#Create Player Table
playernumber <- c(40,16,34,13,5,9,22,11)
athlete <- c("John Resetti","Tom Nook","K.K Slider","Tortimer Montcillo","Booker Wright","Gayle Puffpants","Wolfgang Puck","Agent S")
height <- c("5-11", "6-4","5-10","6-7","6-10","6-4","6-8","6-9")
position <- c("Guard","Forward","Forward","Guard","Center","Center","PG","PG")
status <- c("B","S","S","S","S","S","B","B")
roster <- data.frame(playernumber,athlete,height,position,status)
names(roster) <- c("Player Number","Athlete","Height","Position","Status")
#View the Roster
kable(roster, col.names = names(roster), align = 'l', caption = "Player Table Data")
#Create WorkOut Log Table
playernum <- c(34,16,13,22,34,13,9,7)
dateofwrkout <- c("1/26/1983","1/30/1983","1/4/1983","1/6/1983","1/8/1983","1/24/1983","1/14/1983","1/18/1983")
exercise <- c("bench","bench","deadlift","bench","deadlift","squat","squat","deadlift")
weight <- c(50,90,40,110,30,60,130,150)
reps <- c(7,6,8,4,4,3,6,4)
workoutlog <- data.frame(playernum,dateofwrkout,exercise,weight,reps)
names(workoutlog) <- c("Player ID","Date of Workout","Exercise","Weight","Reps")
#View the workoutlog
kable(workoutlog, align = 'l', caption = "January Workout Log")
#Data Table try
datatable(workoutlog, rownames = FALSE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment