#script for bone remodelling calculation print("SOFTWARE FOR BONE REMODELLING CALCULATION: BR 1.0") print("SELECT THE APPLICATION") selector<-"NA" while(selector!=0){ system("clear") repeat{ print("MENU") print("Press de number of the item selected") print("1-CALCULATE DOSE OF FLUORIDE") print("2-CALCULATE FLUORIDE INGESTED BY WATER") print("3-CALCULATE BONE FORMATION AND RESORPTION") print("4-HELP") print("0-QUIT") try(selector<-as.numeric(scan(file = "", what = "",nmax=1)),silent=TRUE) try(if(selector==0|selector==1|selector==2|selector==3|selector==4){break}) } if(selector==1){ print("Press de number of the item selected") print("1-HUMAN BEINGS") print("2-RATS") specie<-as.numeric(scan(file="",what="",nmax=1)) if(specie==1){ print("INTRODUCE FLUORIDE CONCENTRATION OF SOLUTION IN mole/L. SUGESTED CONCENTRATION: 0.5 mole/l") fconcentration<-as.numeric(scan(file="",what="",nmax=1)) volumehuman<-250/(fconcentration*1000) writeLines(paste("VOLUME OF FLUORIDE CONCENTRATION TO BE ORALLY ADMINISTERED:" , round(volumehuman,digits=2)," ml")) writeLines(paste("D OF FLUORIDE TO BE ORALLY ADMINISTERED: 250000 nmole")) readline("TAKE NOTE OF THE VOLUME AND PRESS ENTER") } if(specie==2){ print("INTRODUCE FLUORIDE CONCENTRATION OF SOLUTION IN mole/L. SUGESTED CONCENTRATION: 0.085 mole/l") fconcentration<-as.numeric(scan(file="",what="",nmax=1)) print("INTRODUCE BODY WEIGHT OF RAT IN grams") bw<-as.numeric(scan(file="",what="",nmax=1)) volumerat<-0.0002*bw/fconcentration writeLines(paste("VOLUME OF FLUORIDE CONCENTRATION TO BE ORALLY ADMINISTERED:" , round(volumerat,digits=2)," ml")) writeLines(paste("D OF FLUORIDE TO BE ORALLY ADMINISTERED: " , round(fconcentration*1000000/volumerat,digits=0)," nmole")) readline("TAKE NOTE OF THE VOLUME AND PRESS ENTER") } } if(selector==2){ print("INTRODUCE WATER FLUORIDE CONCENTRATION IN mg/L (ppm)") waterconcentration<-as.numeric(scan(file="",what="",nmax=1)) print("INTRODUCE VOLUME OF DAILY WATER CONSUMPTION IN LITRES") watervolume<-as.numeric(scan(file="",what="",nmax=1)) I<-waterconcentration*watervolume*1000000/19 writeLines(paste("FLUORIDE INGESTED BY WATER:" , round(I,digits=0)," nmole")) readline("TAKE NOTE OF FLUORIDE INGESTED BY WATER (I) AND PRESS ENTER") } if(selector==3){ print("INTRODUCE V1 IN mL") V1<-as.numeric(scan(file="",what="",nmax=1)) print("INTRODUCE t1 IN min") t1<-as.numeric(scan(file="",what="",nmax=1)) print("INTRODUCE F1 IN nmole/L") F1<-as.numeric(scan(file="",what="",nmax=1)) print("INTRODUCE V2 IN mL") V2<-as.numeric(scan(file="",what="",nmax=1)) print("INTRODUCE t2 IN min") t2<-as.numeric(scan(file="",what="",nmax=1)) print("INTRODUCE F2 IN nmole/L") F2<-as.numeric(scan(file="",what="",nmax=1)) print("INTRODUCE D IN nmole") D<-as.numeric(scan(file="",what="",nmax=1)) print("INTRODUCE I IN nmole") I<-as.numeric(scan(file="",what="",nmax=1)) BF<-F1*V1/t1*((D/((F2*V2)-(F1*V1*t2/t1)))-1) BR<-(F1*V1/t1*(D/((F2*V2)-(F1*V1*t2/t1))))-I/t2 writeLines(paste("Bone formation: ", round(BF,digits=4), " nmole/min")) writeLines(paste("Bone resorption: ", round(BR,digits=4)," nmole/min")) readline("PRESS ENTER TO CONTINUE") } if(selector==4){ print("CONTACT Dr. Alfredo Rigalli, arigalli@unr.edu.ar or Dra. Maela Lupo, maela_lupo@hotmail.com") readline("PRESS ENTER TO CONTINUE") } } suppressWarnings(try(rm(selector,fconcentration,volumehuman,volumerat,waterconcentration,watervolume,I, V1,t1,F1,V2,t2,F2),silent=TRUE)) print("THANK YOU FOR USING BR 1.0")