Introduction: This function will generate roster for a week (168 hrs. or 24X7). Flow time of a watercourse to an individual farmer calculate based on their holding area (bigga or hectares), This flow time roster generated by this function known as "warabandi" in canal irrigated agricultural areas (Punjab, Rajasthan, Haryana and Some areas of Pakistan)
library(warabandi)
head(warabandi_data)
Here we are not writing output to reduce vignettes and space
output<-warabandi(file = warabandi_data, output = FALSE, nof = "my_file.csv")
Output generated by package is a list of different objects. 1. Flow time per unit area in minutes 2. Rakva or total area under command subject to be irrigated 3. Bharai or fillig time; as a compensation 4. Jharai or empty time 5. Weekdays or total duration has to be divided 6. Final table calculated by warabandi saved as a output file to the working directory
output[1:5] Report_Table<-data.frame(output[6]) head(Report_Table)
Generation of the report in printable format which can be supplied or distribut- ed among all the farmers. This step is highle depend on the external packages (knitr, flextable). Code chunk provide below is a sample which can be modified as per user need like header and fotters. Lets read output file generated by warabandi package
data2<-Report_Table
flextable::flextable(head(data2))
data3 <- data.frame(head(data2)) invisible(by(data3, seq_len(nrow((data3))), function(row) { chak<-"Chak-38 R.B" distributries<- "R.B II" dateOI<-date() dateOd<-"Date of distribution __/__/____" note1<-"Note: All schedules issued before this, are cancelled" Year_o_Valid<-"Year: April 2019 to 2025" Issue<-"Issue Serial No:________/___" Jal_upbhokta<-"Jal Upbhokta Sangam:" d5 <-flextable::fit_to_width(flextable::flextable(row), max_width = 7, inc=1L, max_iter = 20) d5 <- flextable::add_header_lines(d5, c(paste(Year_o_Valid,"\t","\t", chak), paste(Jal_upbhokta, distributries, "\t","\t", Issue, "\t","\t","\t","\t", dateOI))) d5 <-flextable::add_footer_lines(d5, c(paste(dateOd, "\t", "\t", note1), paste("President", "\n", "\n", "\n", Jal_upbhokta, distributries))) #flextable::flextable_to_rmd(d5) }))
That's all! Thanks for being here. Let me know if you heve any doubt about this package or issue Harvinder Singh Department of pharmacology PGIMER, Chandigarh (160012) harvindermaan4@gmail.com ORCID https://orcid.org/0000-0002-6349-3143
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.