Warning: package 'fitplc' was built under R version 4.4.2
Loading required package: nlme
Attaching package: 'nlme'
The following object is masked from 'package:dplyr':
collapse
Loading required package: car
Loading required package: carData
Attaching package: 'car'
The following object is masked from 'package:dplyr':
recode
The following object is masked from 'package:purrr':
some
Following Pneumatron manual script to transform Pressure in Pdiff(difference from initial to final pressure)
results=NULLfor(psampinunique(data_all$SAMPLE)){data=data_all[data_all$SAMPLE==psamp, ]# Identify individual measurements by checking continuity in the "n" columndata$MEASUREMENT=c(1, diff(data$NLOG))n=1for(rowin1:nrow(data)){if(data$MEASUREMENT[row]!=1)n=n+1data$MEASUREMENT[row]=n}# Get initial and final pressures for each measurement# This assumes that the desired, final pressure, is pressure at the end of# the measurementdata.summ_ini<-data[0, ]data.summ_end<-data[0, ]for(iinunique(data$MEASUREMENT)){data.summ_ini=rbind(data.summ_ini,data[data$MEASUREMENT==i&data$NLOG==1, ])data.summ_end=rbind(data.summ_end,data[data$MEASUREMENT==i&data$NLOG==max(data$NLOG[data$MEASUREMENT==i]), ])}data.summ=merge(data.summ_ini, data.summ_end, by =c("SAMPLE", "MEASUREMENT"), all =TRUE, suffixes =c("_INI","_END"))data.summ$P_DIFF=data.summ$PRESSURE_END-data.summ$PRESSURE_INI# Store fileresults=rbind(results, data.summ)}
data_psi$Psi<-as.numeric(data_psi$Psi)#ter certeza que esta numéricodata_psi<-data_psi%>%rename(SAMPLE =Log)#colocar o mesmo nome da planilha do pneumatron (SAMPLE)data<-inner_join(results, data_psi, by ="SAMPLE")atm<-90str(data)