MatthiasPucher / staRdom

staRdom is a package for R to analyse fluorescence and absorbance data of dissolved organic matter (DOM).
21 stars 2 forks source link

issues with correcting for dilution (eem_dilution) #8

Closed JJinNZ closed 4 years ago

JJinNZ commented 4 years ago

Hi,

I've run into some issues with correcting for dilution when using the column from the meta table (int values). When I try to plot the eem's afterwards there's a bunch of warning messages. When I just set it to dilution = 1 everything works fine though. The other day it was working without problems so perhaps there's an issue with the updated version in combination with R-3.6.1? (Uni computers doesn't let you update software)

Any help is much appreciated

`

dil51219 <- meta51219["dilution"] eem51219DIL <- eem_dilution(eem51219INT, dil51219) eem_overview_plot(eem51219DIL, spp = 7, contour = TRUE) [[1]] Error in seq.default(.limits[1], .limits[2], length.out = guide$nbin) : 'to' must be a finite number In addition: There were 16 warnings (use warnings() to see them) warnings() Warning messages: 1: In min(x) : no non-missing arguments to min; returning Inf 2: In max(x) : no non-missing arguments to max; returning -Inf 3: In min(x) : no non-missing arguments to min; returning Inf 4: In max(x) : no non-missing arguments to max; returning -Inf 5: In min(x) : no non-missing arguments to min; returning Inf 6: In max(x) : no non-missing arguments to max; returning -Inf 7: In min(x) : no non-missing arguments to min; returning Inf 8: In max(x) : no non-missing arguments to max; returning -Inf 9: In min(x) : no non-missing arguments to min; returning Inf 10: In max(x) : no non-missing arguments to max; returning -Inf 11: In min(x) : no non-missing arguments to min; returning Inf 12: In max(x) : no non-missing arguments to max; returning -Inf 13: In min(x) : no non-missing arguments to min; returning Inf 14: In max(x) : no non-missing arguments to max; returning -Inf 15: In min(., na.rm = TRUE) : no non-missing arguments to min; returning Inf 16: Removed 85365 rows containing non-finite values (stat_contour). `

MatthiasPucher commented 4 years ago

I just tried to follow the problem, but I could not. Is dil51219 a data.frame with row names similar to sample names? The row names could be the issue.

In the most recent version on GitHub, I included an error message in case of missing data. This might help you to find the problem.

JJinNZ commented 4 years ago

Hi, thanks for the quick answer and sorry for not getting back to you until there's a global pandemic.

I got the new error messages again until I tried setting the row.names to the sample IDs

this works:

> dilution51219 <- data.frame(dilution = c(1,1,1,1,1,1,2), row.names = c("N1_031219","R1_031219","R2_031219","R2p_031219","R3_031219","R3p_031219","R3p_11_031219"))
> print(dilution51219)
              dilution
N1_031219            1
R1_031219            1
R2_031219            1
R2p_031219           1
R3_031219            1
R3p_031219           1
R3p_11_031219        2

this does not work:

> dil51219 <- meta51219["dilution"]
> print(dil51219)
# A tibble: 7 x 1
  dilution
     <dbl>
1        1
2        1
3        1
4        1
5        1
6        1
7        2

Also, cheers for making and maintaining the staRdom package!