Batdata[c("TBC")] <- recode.variables(Batdata[c("TBC")] , "0 -> NA;")
# Create new BW variable then change data file name
BW<-within(Batdata,BW<-Fmax-Fmin)
BatStats<-BW
BatStats<-Deducer::descriptive.table (vars = d (Dur,TBC,Fmin,Fmax,BW,Fmean,Fk,Fc,Sc,Pmc),data= BatStats,func.names =c("Valid N","Minimum","Maximum","Mean","St. Deviation"),func.additional= list(p10=function(x) quantile(x, c(0.10), na.rm=TRUE),p25=function(x) quantile(x, c(0.25), na.rm=TRUE),p75=function(x) quantile(x, c(0.75),na.rm=TRUE),p90=function(x) quantile(x, c(0.90),na.rm=TRUE)))
## Write the results Change output name and directory for stats.
write.csv(BatStats,file="C:\\=Bat data working\\Acoustic Parameters\\Batdata_Stats.csv")
So in order to create the new "harmonic"
variables I thought I could simply use the following.
FcH1<-within(Batdata,FcH1<-Fc*.5)
FcH3<-within(Batdata,FcH3<-FcH1*3)
I assumed this should work.
Thanks all
Bruce