[R] include

Val valkremk at gmail.com
Sat Feb 24 05:34:07 CET 2018


Hi All,

I am reading a file as follow,

mydat <- read.table(textConnection("Col1 Col2 col3
Z2 NA NA
Z3 X1 NA
Z4 Y1 W1"),header = TRUE)

1. "NA" are   missing  should be replace by 0
2.  value that are in COl2 and Col3  should be included  in col1 before
they appear
in col2 and col3. So the output data looks like as follow,

X1  0  0
Y1  0  0
W1  0  0
Z2  0  0
Z3 X1  0
Z4 Y1 W1

Thank you in advance

	[[alternative HTML version deleted]]



More information about the R-help mailing list