ms609 / Ternary

Create ternary plots in R
https://ms609.github.io/Ternary/
32 stars 3 forks source link

Suggestion: repetitive error #88

Closed prophetsix0091 closed 3 months ago

prophetsix0091 commented 3 months ago

I keep getting this error when loading in data to the shiny app TernaryApp and when I cut and paste code into Rstudio from the app: "Error in if (x_deviation == 1) { : missing value where TRUE/FALSE needed"

I didn't see any mention of this on the info page on cran. The data format is pretty simple as explained in the app: 3 columns of numbers, with headers. I've checked for NAs and have none. ClAgZn-t.csv

What am I missing? The error is referring to an IF statement and there aren't any of those in the ternary plot specifics, so I'm assuming this is an app thing.

Thanks! Ben

ms609 commented 3 months ago

Thanks for the report, I'll take a look when I can.

ms609 commented 3 months ago

The issue arises in row 90 of your spreadsheet, which contains the measurement 0 0 0. I've updated TernaryToXY to handle this corner case, which should be drawn in the centre of the plot. Once the pull comes through on GitHub, you can update your local installation of Ternary with devtools::instalL_github('ms609/Ternary'), or perhaps more simply, replace this row with e.g. 1 1 1, whcih will plot in the equivalent place.