I want to plot an indicator into the price chart and another one into a separate "box" (like the rsi), but I want it in the same script - plot

I made a simple script (I am a beginer) with 10 SMA + an RSI, all in the same script, when a run it, the 10 SMA are shown perfectly but the RSI I made plots in the price chart with the SMAs, not in the box bellow the chart.
I searched in the official documentation and in forums but I couldnĀ“t find anything

Related

Is there a function that plots your breakpoint in R?

I have found my breakpoints in my data using the strucchange and tidyverse library then using the plot.ts() and then breakpoints() function. I have 3 breakpoints in my data and would like to have them show up on my graph as breaks in my trend line. I have done this manually but would like to find an automated way to create these breaks at my break points. enter image description here
My breakdates that correlate with my breakpoints also do not show up as dates. enter image description here

R Highcharter - Navigator as input

I am using the Highcharter library in my R Shiny apps to build some dashboards and I was wondering if it would be possible to use the navigator (hc_navigator) as an input.
For example: by adjusting the time window of the chart in my graph, I'd like to calculate the avg or the sum of the displayed data point in the chart. Of course, I'd like this to be dynamic (i.e. any time that I adjust the time window with the navigator, I want the calculated value to update)
Example - This is my baseline chart: Baseline chart. I want to add a box which calculates the avg of the data points displayed in it. But, whenever I adjust the navigator (pls see here: nav-adjusted chart), I want the avg to change according to the data points which remain in the chart.
Does anybody have any idea on how to achieve something like this? Hope I was clear enough :)
Thanks,
Lorenzo

How to stack a timeline/timeline events/and graphs in R

I want to create a timeline to show all the results of one of my studies. I just want to display a timeline, event by group, and line charts of some data I obtained.
I've tried doing it in illustrator/photoshop but it's just time consuming and not what I aiming for.
Here is the thing I've tried in illustrator, just to show you the type of diagram I'm aiming for:
So the figure I want to be able to do have this structure:
Timeline
Timeline events grouped by type
Line charts of my data
and so on...
Have you some suggestion to do it in R? Maybe a package? Or another tool?

Overlay Plots : Time Series - Different Frequencies (Lines over Bars) [ggplot2]

My question is about overlaying plots of different x and y scales .The raw data is out of a public weather database in New Zealand called CliFlo, managed by NIWA. I'm not prepared to copy the data for an example because of copyright protections.
I want to reproduce the types of graphs they offer at a fee, shown on this web page. Take the Rainfall graph. There is a cumulative rainfall line graph overlayed on top of a monthly rainfall bar graph. I can generate each graph separately using ggplot2, but I can't find a good way to overlay them like in the example. I've found the gridExtra package to let me print them side-by-side, and I've come across the magick package that might let me do the job, but I'm not sure on how to get the plots lined up properly and how to use the magick package properly. Can anybody help me out on this?
Should I try to scale the month bars to fit the daily line graph but make them spaced out and thicker so they look like months, or would it be easier to use the magick package somehow?
I'd attach an image of what I have so far, but I'm new to this website and it won't let me yet.

LocusZoom standalone change x-axis and use the plots in a script

I am using the standalone LocusZoom software,but I am having two problems:
I have to create a plot showing only position on the x-axis (not showing the genes). If I just use showGenes=FALSE with nothing else the genes still appear, but if I use rfrows=0 then the genes are not shown, but the problem is that also the x-axis label with the positions disappears. Is there a way to only show the position label? It looks like the only way to do this is to modify the original script...
Is there a way to use several plots created using LocusZoom in an R script to position many plots into one unique figure? (output is a pdf for now) There is an option listed in the LocusZoom webpage (http://genome.sph.umich.edu/wiki/LocusZoom_Standalone) called "prelude" but I cannot get more info on how to use it.
If you have any suggestions for either of these two issues it would be very helpful! Thanks!!

Resources