[R] Please help me debugg

Shrinivas Dharma dh@rm@ @end|ng |rom metr|cuk@com
Fri Nov 5 07:59:21 CET 2021

I am trying to run the following double loop which  I have written but it
is not running.
Unable to get my head around the mistake. Please try to spot the bug and

> for(i in 1:122){
+ for(j in 1:68){
+ if(V(FriendGraph)$name[i]==names[j]){
+ gender_vector[i]<-sex[j]
+ break;}
+ else{gender_vector[i]<-NA}
+ } }

*Error in `[.data.frame`(sex, j) : undefined columns selectedCalled from:
`[.data.frame`(sex, j)*

Warm Regards,
*Shrinivas Dharmadhikari*

Metric Consultancy Ltd.
91, Florida Estate,
Keshavanagar, Mundhwa

M: +91 98 230 09850
E : dharma using metricuk.com

*P* Please consider the environment and do not print this email unless
absolutely necessary.

	[[alternative HTML version deleted]]

More information about the R-help mailing list