Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IRRIGATION section not written properly with write_filex() #37

Open
mehmoodmz opened this issue Aug 5, 2022 · 0 comments
Open

IRRIGATION section not written properly with write_filex() #37

mehmoodmz opened this issue Aug 5, 2022 · 0 comments

Comments

@mehmoodmz
Copy link

mehmoodmz commented Aug 5, 2022

For some reason, write_filex() is not writing the IRRIGATION section properly when creating a new IRRIGATION section from scratch. Any help would be much appreciated!

I believe the output should be something like:


*IRRIGATION AND WATER MANAGEMENT
@I  EFIR  IDEP  ITHR  IEPT  IOFF  IAME  IAMT IRNAME
 1    .9    30    50   100 GS000 IR004    10 -99
@I IDATE  IROP IRVAL
 1 22001 IR004    10

See the following reproducible example:

library(tidyverse)

file_x <- tibble(I = 1,
         EFIR=0.9,
         IDEP=30,
         ITHR=50,
         IEPT=100,
         IOFF="GS000",
         IAME="IR004",
         IAMT=10,
         IRNAME=NA_character_,
         IDATE = list(as.POSIXct("2022-01-01")),
         IROP = list("IR004"),
         IRVAL = list(10)) %>% 
  list(`IRRIGATION AND WATER MANAGEMENT` = .)

DSSAT::write_filex(file_x, "example.WHX")

readLines("example.WHX")
#> [1] "*EXP.DETAILS: "                                                       
#> [2] ""                                                                     
#> [3] "*IRRIGATION AND WATER MANAGEMENT"                                     
#> [4] "@I  EFIR  IDEP  ITHR  IEPT  IOFF  IAME  IAMT IRNAME IDATE  IROP IRVAL"
#> [5] " 1  0.90   30.   50.  100. GS000 IR004   10. -99 22001 IR004  10.0"   
#> [6] ""

Created on 2022-08-05 by the reprex package (v2.0.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant