the factor format of str() command output

My data name is w, which has num, int, factor variables, when I use str(w), the factor format of srt(w) output includes 'w/', namely, one of factor variable line is '$ drv: Factor w/ 2 levels "0", "1": 1 1 1 1 1 1 1 1... my question is : what dose the symbol '/' do here? and int num variables do not include the symbol. 'w' may be data name.

The symbols w/ is an abbreviation of "with". It is just a coincidence that it matches your data frame name. Here is the str() output of a data frame named DF. The factor Site has two levels.

str(DF)
'data.frame':	14 obs. of  3 variables:
 $ Proportion: num  0.0874 0.7214 0.9726 0.4673 0.5928 ...
 $ Salinity  : num  0 0.2 0.5 1 3 5 10 0 0.2 0.5 ...
 $ Site      : Factor w/ 2 levels "MD","SQ": 2 2 2 2 2 2 2 1 1 1 ...
1 Like

Thank you! You solved my problem. :grin: :grin: :grin:

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.