Issues Displaying Correct Values in ggstripchart (False values displayed)

36 Views Asked by At

I am having issues getting a stripchart to display correct values. I have a sample of a table below that includes two columns (Date, Resistance). The resistance column contains many observations that all have the same value (0.5). This dataset is updated often, and the values will not necessarily always be the same. I am using a stripchart as part of a dashboard that shows the daily range of values. The code below runs, but the output displays values ranging from 0.1 - 1.0. Any ideas what might be going on? Sample of output graphs is included as well.

Graph Output

Many thanks in advance.

lcl <- 0.2 ucl <- 0.6

res <- ggstripchart(df, x = "Date", y = "Resistance", color = "Date", jitter = 0, size = 3, add = "boxplot", add.params = list(width = .2, color = "black")) +
            geom_hline(yintercept = lcl, linetype = "longdash") +
            geom_hline(yintercept = ucl, linetype = "longdash") +
            labs(title = "Resistance", x = "Date", y = "Resistance (ohms)") +
            annotate("text", x= .8, y= ucl + .02, label = paste('USL:', ucl, 'ohms'), size = 3) +
            annotate("text", x= .8, y= lcl - .02, label = paste('LSL:', lcl, 'ohms'), size = 3)
            
res <- res + rremove("legend") 
res <- res + rremove("y.ticks")
res <- res + font("xy.text", size = 8, color = "black")
res <- res + scale_x_discrete(guide = guide_axis(n.dodge = 2))
res <- res + scale_colour_viridis_d(option="mako", begin = .5, end = .8)
res
0

There are 0 best solutions below