A collection of some frequently used R commands.
Creating column for categorical group assignment. Shown below is to assign A/B/C according to some existing values.
Similarly for new column for derived values from existing column.
Sampling using the sampling package with strata.
With R Studio, view command can be invoked from clicking the variable under the Environment tab, and the frame will then be listed nicely in a tabular format in the data frame window.
Data frame at a glance – head, str, summary.