|
| 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 | +``` |
0 commit comments