2 ms·
I understand where you're coming from, but these two lines are exactly 'taking a list of libraries for import'. packages is a character vector of package names
by dandermotj 10y ago
I understand where you're coming from, but these two lines are exactly 'taking a list of libraries for import'.
packages is a character vector of package names, lapply is by definition 'list apply'. We're taking a list of packages and applying the library function on them.
This seems complicated if you're not used to it but R is a functional language. Approaching R from this perspective makes it a powerful, flexible.