Counts number of patients and eyes (right and left).
eyestr: identical to eyes(x, report = TRUE, ...)
eyes(x, id = NULL, eye = NULL, report = FALSE, ...)eyestr(x, id = NULL, eye = NULL, small_num = TRUE, para = FALSE, UK = FALSE)
required. (data frame)
Patient identifying column
Eye identifying column.
if TRUE, text returned for report
passed to eyes_to_string
If TRUE: writing numbers <= 12 as words
If TRUE: Adding "A total of" to comply with most journal standards and to avoid awkward long numbers.
Logical, Use UK (English) style (TRUE) or USA (American) style (FALSE).
eyes: Named integer vector with count of patients and eyes
eyestr: Character string - can be directly pasted into reports
For any below, cases are always ignored (you can write in upper or lower case, as you please)
id and eye arguments overrule the name guessing for the respective columns.
patient ID columns:
First, eyes is looking for names that contain both strings
"pat" and "id" (the order doesn't matter)
Next, it will look for columns that are plainly called "ID"
Last, it will search for all names that contain either "pat" or "id"
eye variable column:
eyes looks for columns called either "eye" or "eyes"
eyes recognizes integer coding 0:1 and 1:2, with right being
the lower number. For strings coding it recognizes
right eyes: c("r", "re", "od", "right") and
left eyes: c("l", "le", "os", "left")
Using eyes_to_string to parse the output of eyes into
a text which you can use for reports. Arguments to eyes_to_string
are passed via ...:
small_num If TRUE (default): numbers <= 12 as words
para If TRUE (not default): Adding "A total of" to comply with most journal standards and to avoid awkward long numbers.
UK TRUE: UK style (English) or FALSE (default): US style (American).
eyes guesses columns that identify patients and eyes.
# NOT RUN {
eyes(amd)
eyestr(amd, para = TRUE)
# }
Run the code above in your browser using DataLab