Skip to content

creating new variable

2 messages · Niklas Fischer, PIKAL Petr

3 days later
#
Hi
Well I am a little lost in your explanation maybe you could show us part of your variables.

Anyway if rel is existence of relation
and int is intensity of relation
whole <-int*rel
 [1] 2 1 5 2 5 0 4 4 0 2

Gives you 0 where there is no relation and numbers 1:5 showing intensity of relation

change it to factor

whole <-factor(whole)

and chase levels
levels(whole) <-rep(c("weak", "medium", "strong"), each=2)

Regards
Petr