Issue changing month to days in month in Jupyter Notebook - r

I have a dataset with dates from 2011-01-01 to 2018-08-01, showing data for every 1st day of the month. I would like to create a control chart (c-chart) accounting for the number of days in each month.
I will freeze the control limits at the last month of the baseline period (February 2015) and extend these limits across the intervention period (i.e. the rest of the period covered by the data). Then i will draw a vertical line to separate the baseline and intervention periods, using the format_spc_chart function to format the chart so that the rule breaks are highlighted.
I tried to look at the help for the lubridate function days_in_month but I am stuck to create this chart. Here is my code:
enter image description here
Although it gives me the qic chart (but not in days in month which I would need), I have nothing for the ggplot chart.
thank you for your support.
regards
Ellie

Related

How to multi-criteria plot with porpotion and stack table under axis?

I'm new to R and I'm stuck with this data.
The data provides genders, sleep duration on weekend and on weekday ( 3 columns) and I want to make a plot like this
I could draw it separately for weekend and weekday. I've tried to use the same x-axis and make another dataframe to calculate porpotion to fill on y-axis, but it doesn't seem to work.
And I donot know how to stack another table at the bottom like that.
I need some help, thanks you all!
And here is the data I've collected with rstwd presents sleep duration on weekday and rstwk presents sleep duration on weekend etc ...

PowerBI skipping month in bar chart

I have created the attached dashboard in powerBI. It is a monthly report. That shows the count of item each month. The dates are in this format 1/1/18, 1/2/18, 1/3/18 that the first day of every month
When I created the report powerBI are skiping one month at interval. See Pix attached.
how can i show all months?
Desired
I believe you'll need to change the "X-Axis" type to "Categorical". It looks like it's defaulting to Scalar, which makes a continuous axis and picks tick marks based on available space.
You could try decreasing the font size of the month labels since Power BI might be avoiding overlap. You could also try shortening the length of the label from MMM-YYYY to MMM-YY.

How can I plot a 24 hour time series on the x-axis in ggplot2

I realize there have been previous questions on how to plot time on the x-axis in ggplot2 but I have looked at those threads and still cannot fix my problem. I have a data set where I measured body temperature of a bird at the same times over several months. I have averaged the body temp at each time to get one 24 hour trace of body temperature.
I have converted my time vector to POSIXct using this code:
rcnj.tb$Time=as.POSIXct(rcnj.tb$Time,format="%H:%M:%S",tz="Africa/Johannesburg")
I then plotted my figure using this code:
ggplot(bird550,aes(Time,Tb)) + geom_line()
to get this figure.Tb trace averaged across time
However, I do not want the date shown but just the time. The time shown is correct although I would like it on a different scale. So I tried this code to get rid of the date and change the scale
last_plot()+scale_x_datetime(labels=date_format("%H:%M")),
breaks = date_breaks("2 hour"),
minor_breaks=date_breaks("1 hour"))
This resulted in this figureTb trace with date removed
However, the scale is wrong now because it should go from 00:00 to 00:00, like in the first graph. So, for my actual question, how can I remove the date component from my first graph to get an x-axis with just time starting at 00:00 and ending at 00:00.
It would appear that ggplot2 is shifting my scale by two hours so I've tried using different time zones because I saw one post mention that. I've also messed around with strftime. I'm wondering if it isn't a limits issue where I need to set a specific limit?
Thanks for any advice

How to show monthly data on diagram in Power BI from datetime

I have historical daily gold prices in excel and I load them to the Power BI. But in default, Power BI shows me only year based value, but for year 2016 i have values only for January and February and therefore diagram is distorted as you can see below.
Base data looks like (can be downloaded here in .csv)
Visual setting is
And i want to see diagram curve to be done by months to prevent distortion.
Curve should be similar to this diagram
There are years only as a description
Thank you for help
PBI is has generated a Date Hierarchy with only a Year level. I can tell that from the word "Year" appearing under on the Visualizations pane, under "Date" (in the Axis Section).
I would click the small down-arrow to the right of "Date", in the Axis section. I would change that setting from "Date Hierarchy" to "Date". This will plot every daily value on the chart.
Unfortunately you cant control the date format used in the X-Axis labels - hopefully they will add that in some future release. Their automatic labeling is usually OK.

Highcharts Plot two datetime series on top of each other

I'm trying to draw two datetime series each with different timestamp ranges on top of each other instead next to teach other. For example if I have two chunks of data, one for last week, another for current week (divided per days) and all I want is to draw them both on top of each other. With the default options both charts are drawn next to each other which does not offer the possibility to compare the value for today (Ex: Tuesday) with the value from Tuesday last week.
Thank you.
In this case I would recommend that you not make the xAxis a datetime series. Instead, if your data is recorded daily make the xAxis.type: 'category' with the days of the week. Then make your 2 series be one for week1 and the other for week2.

Resources