search for: extractsign

Displaying 1 result from an estimated 1 matches for "extractsign".

Did you mean: extracting
2007 Oct 10
4
simple function with if -> lapply to dataframe
...writing a simple function to extract the sign of values and apply it to a data frame (see below). Whatever I do I get error-messages... What is wrong? Thanking you in advance, Cheers, Georg. *********************** Georg Ehret Institute of Genetic Medicine Johns Hopkins University Baltimore > extractsign<-function(x){ + if (x<0) a<--1 + else a<-1 + return (a) + } > a meanSBP meanSBP_tttcorr res_asb_SBP res_asb_SBP_tttcorr meanDBP meanDBP_tttcorr res_asb_DBP res_asb_DBP_tttcorr one -0.04 -0.01 -0.11...