0

I hope this finds you safe and well. I am having an issue with my graphs. Yesterday I created waveforms (or a linegraph of means over the course of a time series). I created the graphs and saved the datasets as csvs (note these are relatively large files) - everything looked fine and great. Today, when I opened the files I saved it now has an oscillating mean (which was not their yesterday). Is it possible that the dataset saved in a strange way (note I used write.csv using the default settings)?

Any help would be greatly appreciated.

q <- ggplot(Data, aes(x=time, y=Value, color=Condition,linetype=Chromophore)) + 
  facet_wrap(~Channel, scales='free') +
  geom_vline(xintercept = 0, linetype = "dotted", color="black", alpha = .2) + #accentuate origin
  geom_hline(yintercept = 0, linetype = "dotted", color="black", alpha = .2) + #accentuate origin
  geom_line(stat = "summary", fun.y = "mean") + #show group means   
  labs(x = "Time (s)", y = "Mean Oxy-Hb (uM)") + #label axes
  theme(text=element_text(size=12)) + #set label font size
  scale_linetype_manual(values=c("dotted", "solid"))+
  theme_minimal() #set theme

plot(q)

Example of new graphs

Example of new graph

Caroline
  • 37
  • 6
  • I believe I figured out the issue with the graph - there are now two values for a given entry in that region of time. However, I'm still wondering what could have happened to introduce this issue. – Caroline Jan 06 '21 at 17:20
  • 1
    Unfortunately we can only guess what you did yesterday and what maybe went wrong when saving the data. However, from your plots I would guess that you have some duplicated observations in your dataset, i.e. in the range where curves oscillate you there are (at least) two values per time. But without any knowledge about the reason for this it's hard to come up with a solution. – stefan Jan 06 '21 at 17:23
  • I agree with stefan that ot will be extremely challenging to answer your question without a sample of your data. Please [edit] your question with the output of `dput(data)`; it seems very large, so you'll need to subset it somehow to make a reproducible example. See [How to make a great R reproducible example](https://stackoverflow.com/a/5963610/) for more hints. – Ian Campbell Jan 06 '21 at 18:06
  • I am still not exactly sure what the issue is but when I save and load as a csv I have this issue but not when I save and re-load as a .rds. I would like to have it as a csv or .txt file. If there is something that can be specified - I'd greatly appreciate it. – Caroline Jan 06 '21 at 21:34

0 Answers0