I am starting with a simple program.
month_name <- sprintf("E4%sMONTHS", firstUpper(letter));
week_name <- sprintf("E4%sWEEKS", firstUpper(letter));
From this link: sprintf writes formatted data to a character string in memory instead of stdout
These two functions are assigning names to the variable month_name and week_name.
% signifies that what comes next is special
s is for string
%s is a special string
firstUpper is found in ggplot2: It is the "Upper case first letter of string"
firstUpper(letter) is the special string of interest.
So sprintf puts together a changing character string depending on the string "letter" - which has been defined before.
Till the next function...
0 Comments:
Post a Comment