R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

install.packages("tidyverse")
## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.3'
## (as 'lib' is unspecified)
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.3     ✔ readr     2.1.4
## ✔ forcats   1.0.0     ✔ stringr   1.5.0
## ✔ ggplot2   3.4.3     ✔ tibble    3.2.1
## ✔ lubridate 1.9.3     ✔ tidyr     1.3.0
## ✔ purrr     1.0.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors

###Plot environment

How many observation for each Producent

Let’s talk about costs

Total costs

Costs per month

## Warning: Removed 1 row containing missing values (`geom_line()`).

Costs per week

insert_observ_Producent_cost_week<-inserts_add_total_cost %>% 
  select(Producent, Total, week_num) %>% 
  group_by(Producent, week_num) %>% 
  summarize(Total_week=sum(Total),.groups = "keep")
ggplot(insert_observ_Producent_cost_week, aes(as.numeric(as.character(week_num)), Total_week, color=Producent))+
  geom_line()+
  plot_theme3+
  labs(title="Inserts for machining parts 2023", 
       subtitle="Costs per week",
       x="Number of week", 
       y="Total cost per week")

Most often used inserts

Scater plot

ggplot(inserts_popular_costs, aes(Total_ilosc,Total_costs, color=Typ_i_rozmiar))+
  geom_jitter(alpha=0.6)+
  coord_trans(x="log10", y="log10")+
  theme_minimal()+
  plot_theme3

Plot

pli_typ<-ggplot(inserts_popular_costs, aes(Typ_i_rozmiar, Total_ilosc, color=Typ_i_rozmiar))
pli_typ+
  geom_col()+
  coord_polar()+
  theme(plot.title=element_text(size=14, color="blue"), 
        plot.subtitle=element_text(size=12, color="red"), 
        legend.position = "none",
        axis.text.x=element_blank())+
  pl

Without outliers (wo)

One of the inserts we use in machining only one part. They not use in common machining (other parts or shapes)

Histograms

Quantity per year

ggplot(inserts_popular_costs_wo, aes(Total_ilosc, color="white"))+
  geom_histogram(binwidth=10)+
  theme(plot.title=element_text(size=14, color="blue"), 
        plot.subtitle=element_text(size=12, color="red"), 
        legend.position = "none",
        axis.text.x=element_blank())+
        labs(title="Inserts for machining parts 2023", subtitle="Histogram frequency of use - no outliers", x="Interval 10 pcs./year", y="Quantity")

Costs per year