r - Going from multiple dummy variables to a single variable -


How do I n are mutually exclusive in a data frame that I can take the dummy variable and Do they include a single variable? In the following example,

  K & lt; - data. Frames (H = sample (C (T, F), 100, T)) ifelse (k $ H == T, F, sample (C (T, F)) - & gt; K $ kk $ u & lt; - ifelse (k $ H == T | k $ k == T, F, T)   

A simple way of them to convert a variable i h , k or u with the level of?

To do this I think with that you can do ifelse etc., as in this example, but I have my data file several hundred dummy and I manually I am also lazy for.

- The name (k) [applied (k, 1, joe)]

will transform Bull into a dummy variable.

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -