Skip to content

Instantly share code, notes, and snippets.

View MavropaliasG's full-sized avatar
🤡

Georgios Mavropalias MavropaliasG

🤡
View GitHub Profile
H.Z H.Α H.Β H.C H.D H.E H.F H.G H.H H.I H.J H_SD.Z H_SD.Α H_SD.Β H_SD.C H_SD.D H_SD.E H_SD.F H_SD.G H_SD.H H_SD.I H_SD.J L.Z L.Α L.Β L.C L.D L.E L.F L.G L.H L.I L.J L_SD.Z L_SD.Α L_SD.Β L_SD.C L_SD.D L_SD.E L_SD.F L_SD.G L_SD.H L_SD.I L_SD.J
1 32.875 35.1286 32.904 30.5796 29.6328 30.9814 33.958 30.987 33.396 34.2624 33.2758 3.4401167858083 2.29288318498784 3.93382936843987 4.68995909363824 5.9930318871169 6.43084786789425 4.17749643925641 4.37005795156083 4.19410675829789 4.96651933450379 5.28499462629812 33.0112 35.193 32.8754 32.9736 34.3618 34.7732 34.32 31.3152 30.746 31.9264 32.7546 6.7490616532967 8.81494722048862 7.75732384911188 7.28950357020284 7.63263563259769 7.03375473698081 7.72221189167974 7.03184123825332 7.54252577058905 8.25930041226253 8.77262747413795
variable value L1
1 Z 32.875 H
2 Α 35.1286 H
3 Β 32.904 H
4 C 30.5796 H
5 D 29.6328 H
6 E 30.9814 H
7 F 33.958 H
8 G 30.987 H
9 H 33.396 H
# Download to your working directory https://github.com/MavropaliasG/R-Scripts/blob/master/Scripts/Easy%20repeated%20measures/data/mydata.csv
mydata <- read.csv("~/mydata.csv", stringsAsFactors=FALSE)
variablename <- "SquatH" # variable name, change the value in the quotation marks, case sensitive, write the name of the variable up until the time point
groupnames <- c("H","L") # enter group names in quotation marks and seperated by comma, e.g. c("One","Two","Three")
GroupColumnName <- "Group" # enter the name of the column that the Group variable is located
df <- data.frame(mydata) # renames the data frame
df[] <- lapply(df, unlist) # make the data frame not a list
df[df==""] <- NA # make empty cells NA
@MavropaliasG
MavropaliasG / example.txt
Last active December 18, 2017 17:38
An example of column naming in a tab-delimited file.
ID SquatHZ1 SquatHZ2 SquatHZ3 SquatHΑ1 SquatHΑ2 SquatHΑ3 SquatHΒ1 SquatHΒ2 SquatHΒ3 SquatHC1 SquatHC2 SquatHC3 SquatHD1 SquatHD2 SquatHD3 SquatHE1 SquatHE2 SquatHE3 SquatHF1 SquatHF2 SquatHF3 SquatHG1 SquatHG2 SquatHG3 SquatHH1 SquatHH2 SquatHH3 SquatHI1 SquatHI2 SquatHI3 SquatHJ1 SquatHJ2 SquatHJ3 Group
1 30.411 34.967 35.757 31.396 30.656 36.289 32.65 34.967 29.925 29.442 37.094 34.967 34.445 29.683 34.706 31.645 30.168 35.493 31.149 34.706 35.23 32.903 34.186 34.706 35.493 35.493 36.825 33.413 37.094 37.364 29.202 37.636 40.684 H
2 24.832 28.489 29.683 28.018 33.158 32.903 33.67 35.23 34.186 26.858 30.902 29.202 23.74 30.411 26.858 31.895 34.186 30.411 33.927 37.364 34.706 33.413 32.145 31.396 34.186 35.23 33.927 36.556 33.158 33.413 31.149 32.903 33.158 H
3 28.964 30.411 29.683 27.784 27.088 24.611 26.858 26.401 25.275 25.275 26.174 27.088 25.947 26.401 30.656 27.319 28.018 28.018 25.053 24.611 25.722 23.525 25.053 23.311 22.045 22.463 20.613 22.463 23.311 23.957 24.611 23.957 25.722 L
4 31.645 34.706 36.