DidierMurilloF / FielDHub

FielDHub is an R Shiny design of experiments (DOE) app that aids in the creation of traditional, unreplicated, augmented and partially replicated (p-rep) designs applied to agriculture, plant breeding, forestry, animal and biological sciences.
https://didiermurillof.github.io/FielDHub/
Other
41 stars 20 forks source link

Error when using diagonal_arrangement function #2

Closed Prof-ThiagoOliveira closed 3 years ago

Prof-ThiagoOliveira commented 3 years ago

Dear authors,

I have been testing all examples provided in the package. However, this particular example using the function diagonal_arrangement() has reported an issue due to the getData() function. The issue starts in line 169 of function diagonal_arrangement() regarding getData() function output, which returns that it produces NAs by coercion. However, when I checked the dataset generated by getData(), no NA was introduced by coercion. Perhaps, some minor changes in the getData() function will correct this issue.

Please test the example below:

R> spatDB <- diagonal_arrangement(nrows = 30, ncols = 26,
+                                 checks = 5, 
+                                 plotNumber = 1, 
+                                 kindExpt = "DBUDC", 
+                                 planter = "serpentine", 
+                                 splitBy = "row", 
+                                 data = treatment_list)
> [1] 725
> [1] 725
> [1] 725
> [1] 725
> [1] 725
> [1] 725
> [1] 725
> [1] 725
> Error in (1 + s):cuts_max[i] : NA/NaN argument
   In addition: Warning messages:
   1: In getData() : NAs introduced by coercion
   2: In getData() : NAs introduced by coercion
   3: In getData() : NAs introduced by coercion
   4: In getData() : NAs introduced by coercion
   5: In getData() : NAs introduced by coercion
   6: In getData() : NAs introduced by coercion
   7: In getData() : NAs introduced by coercion
   8: In getData() : NAs introduced by coercion
DidierMurilloF commented 3 years ago

Hi ThiagoOliveira,

Thank you for your time dedicated to testing FielDHub. I ran the same example, and it works well. I wonder if you generated the synthetic data before running the example. Just like in the documentation example,

library(FielDHub) checks <- 5;expts <- 5 list_checks <- paste("CH", 1:checks, sep = "") treatments <- paste("G", 6:725, sep = "") BLOCK <- c(rep("ALL", checks), rep(1:expts, c(150,155,95,200,120))) treatment_list <- data.frame(list(ENTRY = 1:725, NAME = c(list_checks, treatments), BLOCK = BLOCK)) head(treatment_list, 12) ENTRY NAME BLOCK 1 1 CH1 ALL 2 2 CH2 ALL 3 3 CH3 ALL 4 4 CH4 ALL 5 5 CH5 ALL 6 6 G6 1 7 7 G7 1 8 8 G8 1 9 9 G9 1 10 10 G10 1 11 11 G11 1 12 12 G12 1 tail(treatment_list, 12) ENTRY NAME BLOCK 714 714 G714 5 715 715 G715 5 716 716 G716 5 717 717 G717 5 718 718 G718 5 719 719 G719 5 720 720 G720 5 721 721 G721 5 722 722 G722 5 723 723 G723 5 724 724 G724 5 725 725 G725 5

then, the example runs well,

spatDB <- diagonal_arrangement(nrows = 30, ncols = 26,

  • checks = 5,
  • plotNumber = 1,
  • kindExpt = "DBUDC",
  • planter = "serpentine",
  • splitBy = "row",
  • data = treatment_list) [1] 725 [1] 725 [1] 725 [1] 725 [1] 725 [1] 725 [1] 725 [1] 725 [1] 725 [1] 725 [1] 725

spatDB$infoDesign $Lines [1] 150 155 95 200 120

$checks [1] 5

$RepChecks 1 2 3 4 5 12 11 12 12 13

$percentChecks [1] "7.7%"

$Fillers [1] 0

$seed [1] 878.1893

Please, let me know if you can run it. Thanks

Prof-ThiagoOliveira commented 3 years ago

I tested it again using the Linux terminal, and the same problem has happened, as you can see in my log file. Some other problems arise from other examples, but I am still verifying what is happening. Could you, please, use the function devtools::check() to check your package dependencies and function, and leave here the logfile? (or R CMD check --as-cran package_name)

00check.log

DidierMurilloF commented 3 years ago

Actually, FielDHub passed all tests and ran the examples in win 10 and centos 7 using R Version 4.0. But let me check it in Linux and R 3.6 version. I am going to check the function getData(). Thank you!.

Prof-ThiagoOliveira commented 3 years ago

Ok. If the package is working using R version 4.0, I suggest you include Depends: R (>= 4.0) in your description file. When you have discovered what is happening in R 3.6, you can update the description file again (Depends: R (>= 3.6)). At least, this is a straightforward solution to the end-user. As this is also a workflow for a shiny app output, I suggest you include the shiny version. Ex.: shiny (>= 1.4.0.2), shinydashboard (>= 0.7.1), shinydashboardPlus (>= 0.7.0),...

DidierMurilloF commented 3 years ago

Thanks for the suggestions. I will do the changes about dependencies.

DidierMurilloF commented 3 years ago

I fixed some bugs of FielDHub at R Version 3.6. Now, all examples are running well and the R CRAN check is successful. Please, let me know anything that you need from me. Thank you!

Prof-ThiagoOliveira commented 3 years ago

I confirm all bugs were fixed. Thanks!