Store the names of all the installed packages in the object pkgs. Count their number (no need to store that number in an object).

(from: Cotton, 2013, Learning R, O’Reilly)