Skip to content

Commit 9896ce6

Browse files
committed
bugRzilla_review Markdown and Script file
0 parents  commit 9896ce6

4 files changed

+232
-0
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.Rproj.user
2+
.Rhistory
3+
.RData
4+
.Ruserdata

bugRzilla_review.Rmd

+137
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
---
2+
title: "bugRzilla review"
3+
author: "Piyush Kumar"
4+
date: "04/07/2021"
5+
output: html_document
6+
runtime: shiny
7+
---
8+
9+
```{r setup, include=FALSE}
10+
knitr::opts_chunk$set(echo = TRUE)
11+
```
12+
13+
<style>
14+
body {
15+
text-align: justify}
16+
</style>
17+
18+
> # What is bugRzilla?
19+
20+
<font size="4">The project bugRzilla is an issue tracker for the R-core members. The motive to develop this project as many issues came under the Resolution section i.e. not properly documented, reported, spam, and so on. So to find efficiency, issues can be tracked down without much effort which can increase the production rate of R-Core members for solving high-quality issues like whose Severity is major, critical, and new contributors who want to contribute can start either with less Priority and Severity i.e. minor, normal.
21+
</font>
22+
23+
<font size="3">To learn more, see [bugRzilla](https://github.com/llrs/bugRzilla).</font>
24+
25+
> # Download SQL Data and dumping Data in the SQL Workbench.
26+
27+
```
28+
29+
```
30+
31+
32+
> # Connect bugRzilla SQL Database with R
33+
34+
<font size="4">
35+
To connect bugRzilla SQL Database with R, I've used `dplyr package`, this will allow to interact with our data in the form of quarries.
36+
</font>
37+
38+
```{r, warning = FALSE}
39+
# loading packages
40+
library(dplyr)
41+
library(ggplot2)
42+
library(dbplyr)
43+
library(DBI)
44+
library(tidyverse)
45+
library(lubridate)
46+
library(tibble)
47+
```
48+
```{r, warning = FALSE}
49+
# connecting MySQL with R
50+
con <- dbConnect(
51+
RMySQL::MySQL(),
52+
dbname='bugRzilla',
53+
username='root',
54+
password='1204',
55+
host='localhost',
56+
port=3306)
57+
# Accessing Tables names from the Database
58+
src_dbi(con)
59+
```
60+
61+
> # "bugs" table from the SQL Database
62+
63+
```{r, warning = FALSE}
64+
# View the "bugs" tables from the bugRzilla database
65+
bugs_db <- tbl(con, "bugs")
66+
bugs_db %>%
67+
select(everything())
68+
```
69+
70+
### Data Wrangling on the "bugs" Table
71+
```{r, warning = FALSE}
72+
bugs <- bugs_db %>%
73+
mutate_all(as.character) %>% # converting all columns data types to "char"
74+
as_tibble %>% # must be a data frame for na_if to work
75+
na_if("") %>% #replace empty strings with NA
76+
# converting all "char" data types to int leaving the "char" datatype
77+
mutate_at(vars(-one_of(c("bug_severity", "bug_status", "short_desc",
78+
"priority", "rep_platform", "bug_file_loc",
79+
"lastdiffed", "op_sys", "version",
80+
"resolution", "target_milestone", "creation_ts",
81+
"delta_ts", "status_whiteboard"))), as.integer) %>%
82+
# converting all columns data types to "Date" leaving the "char" and "int" datatype
83+
mutate_at(vars(-one_of(c("bug_severity", "bug_status", "short_desc",
84+
"bug_file_loc", "priority", "rep_platform",
85+
"version", "resolution", "target_milestone",
86+
"bug_id", "assigned_to", "op_sys",
87+
"status_whiteboard", "product_id", "reporter",
88+
"component_id", "qa_contact", "votes",
89+
"everconfirmed", "reporter_accessible",
90+
"cclist_accessible", "estimated_time",
91+
"remaining_time"))), as.Date)
92+
93+
head(bugs)
94+
```
95+
96+
> #"attachments" table from the SQL Database
97+
98+
```{r, warning = FALSE}
99+
# View the "attachments" Table from the database
100+
attachments_db <- tbl(con, "attachments")
101+
attachments_db %>%
102+
select(everything())
103+
```
104+
105+
### Data Wrangling on "attachments" Table
106+
```{r, warning = FALSE}
107+
# Data Wrangling
108+
attach_df <- attachments_db %>%
109+
as_tibble %>% # must be a data frame for na_if to work
110+
na_if("") %>% #replace empty strings with NA
111+
# converting all columns data types to "Date" leaving the "char" and "int" datatype
112+
mutate_at(vars(-one_of(c("attach_id", "bug_id", "description", "mimetype",
113+
"ispatch", "filename", "submitter_id",
114+
"isobsolete", "isprivate"))), as.Date)
115+
116+
head(attach_df)
117+
```
118+
119+
> #"bugs_activity" table from the SQL Database
120+
121+
```{r, warning = FALSE}
122+
# View the "bugs_activity" Table from the database
123+
bugs_activity_db <- tbl(con, "bugs_activity")
124+
bugs_activity_db %>%
125+
select(everything())
126+
```
127+
128+
### Data Wrangling on "bugs_activity" Table
129+
```{r, warning = FALSE}
130+
# Data Wrangling
131+
bugs_act <- bugs_activity_db %>%
132+
as_tibble %>% # must be a data frame for na_if to work
133+
na_if("") %>% #replace empty strings with NA
134+
mutate_at(vars(-one_of(c("attach_id", "bug_id", "who", "fieldid", "added", "comment_id", "removed", "id"))), as.Date)
135+
136+
head(bugs_act)
137+
```

bugRzilla_review_script.R

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
options(warn=-1)
2+
# loading packages
3+
library(dplyr)
4+
library(ggplot2)
5+
library(dbplyr)
6+
library(DBI)
7+
library(tidyverse)
8+
library(lubridate)
9+
library(tibble)
10+
11+
# Connect bugRzilla SQL Database with R
12+
# connecting MySQL with R
13+
con <- dbConnect(
14+
RMySQL::MySQL(),
15+
dbname='bugRzilla',
16+
username='root',
17+
password='1204',
18+
host='localhost',
19+
port=3306)
20+
# Accessing Tables from the Database
21+
src_dbi(con)
22+
23+
24+
# View the "bugs" tables from the database
25+
bugs_db <- tbl(con, "bugs")
26+
bugs_db %>%
27+
select(everything())
28+
29+
# Data Wrangling
30+
bugs <- bugs_db %>%
31+
mutate_all(as.character) %>%
32+
as_tibble %>% # must be a data frame for na_if to work
33+
na_if("") %>% #replace empty strings with NA
34+
# converting all "char" data types to required data types
35+
mutate_at(vars(-one_of(c("bug_severity", "bug_status", "short_desc",
36+
"priority", "rep_platform", "bug_file_loc", "lastdiffed",
37+
"op_sys", "version", "resolution", "target_milestone",
38+
"creation_ts", "delta_ts", "status_whiteboard"))), as.integer) %>%
39+
mutate_at(vars(-one_of(c("bug_severity", "bug_status", "short_desc",
40+
"bug_file_loc", "priority", "rep_platform", "version", "resolution",
41+
"target_milestone", "bug_id", "assigned_to", "op_sys", "status_whiteboard",
42+
"product_id", "reporter", "component_id", "qa_contact",
43+
"votes","everconfirmed", "reporter_accessible",
44+
"cclist_accessible", "estimated_time",
45+
"remaining_time"))), as.Date)
46+
47+
head(bugs)
48+
49+
50+
# View the "attachments" Table from the database
51+
attachments_db <- tbl(con, "attachments")
52+
attachments_db %>%
53+
select(everything())
54+
55+
# Data Wrangling
56+
attach_df <- attachments_db %>%
57+
as_tibble %>% # must be a data frame for na_if to work
58+
na_if("") %>% #replace empty strings with NA
59+
mutate_at(vars(-one_of(c("attach_id", "bug_id", "description", "mimetype", "ispatch", "filename", "submitter_id", "isobsolete", "isprivate"))), as.Date)
60+
61+
head(attach_df)
62+
63+
64+
# View the "bugs_activity" Table from the database
65+
bugs_activity_db <- tbl(con, "bugs_activity")
66+
bugs_activity_db %>%
67+
select(everything())
68+
69+
# Data Wrangling
70+
bugs_act <- bugs_activity_db %>%
71+
as_tibble %>% # must be a data frame for na_if to work
72+
na_if("") %>% #replace empty strings with NA
73+
mutate_at(vars(-one_of(c("attach_id", "bug_id", "who", "fieldid", "added", "comment_id", "removed", "id"))), as.Date)
74+
75+
head(bugs_act)

bugzilla_viz.Rproj

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Version: 1.0
2+
3+
RestoreWorkspace: Default
4+
SaveWorkspace: Default
5+
AlwaysSaveHistory: Default
6+
7+
EnableCodeIndexing: Yes
8+
UseSpacesForTab: Yes
9+
NumSpacesForTab: 4
10+
Encoding: UTF-8
11+
12+
RnwWeave: Sweave
13+
LaTeX: pdfLaTeX
14+
15+
AutoAppendNewline: Yes
16+
StripTrailingWhitespace: Yes

0 commit comments

Comments
 (0)