Skip to content

Commit 6f31343

Browse files
authored
Merge pull request #31 from tidymodels/update-contrib
Update contributing section
2 parents 9a14b1d + 95bdac4 commit 6f31343

File tree

4 files changed

+199
-27
lines changed

4 files changed

+199
-27
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ cran-comments.md
1616
^CRAN-RELEASE
1717
^\.httr-oauth$
1818
^\.github$
19+
^CODE_OF_CONDUCT\.md$

CODE_OF_CONDUCT.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity and
10+
orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the overall
26+
community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards
42+
of acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies
54+
when an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail
56+
address, posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at [INSERT CONTACT
63+
METHOD]. All complaints will be reviewed and investigated promptly and fairly.
64+
65+
All community leaders are obligated to respect the privacy and security of the
66+
reporter of any incident.
67+
68+
## Enforcement Guidelines
69+
70+
Community leaders will follow these Community Impact Guidelines in determining
71+
the consequences for any action they deem in violation of this Code of Conduct:
72+
73+
### 1. Correction
74+
75+
**Community Impact**: Use of inappropriate language or other behavior deemed
76+
unprofessional or unwelcome in the community.
77+
78+
**Consequence**: A private, written warning from community leaders, providing
79+
clarity around the nature of the violation and an explanation of why the
80+
behavior was inappropriate. A public apology may be requested.
81+
82+
### 2. Warning
83+
84+
**Community Impact**: A violation through a single incident or series of
85+
actions.
86+
87+
**Consequence**: A warning with consequences for continued behavior. No
88+
interaction with the people involved, including unsolicited interaction with
89+
those enforcing the Code of Conduct, for a specified period of time. This
90+
includes avoiding interactions in community spaces as well as external channels
91+
like social media. Violating these terms may lead to a temporary or permanent
92+
ban.
93+
94+
### 3. Temporary Ban
95+
96+
**Community Impact**: A serious violation of community standards, including
97+
sustained inappropriate behavior.
98+
99+
**Consequence**: A temporary ban from any sort of interaction or public
100+
communication with the community for a specified period of time. No public or
101+
private interaction with the people involved, including unsolicited interaction
102+
with those enforcing the Code of Conduct, is allowed during this period.
103+
Violating these terms may lead to a permanent ban.
104+
105+
### 4. Permanent Ban
106+
107+
**Community Impact**: Demonstrating a pattern of violation of community
108+
standards, including sustained inappropriate behavior, harassment of an
109+
individual, or aggression toward or disparagement of classes of individuals.
110+
111+
**Consequence**: A permanent ban from any sort of public interaction within the
112+
community.
113+
114+
## Attribution
115+
116+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
117+
version 2.0,
118+
available at https://www.contributor-covenant.org/version/2/0/
119+
code_of_conduct.html.
120+
121+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122+
enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
[homepage]: https://www.contributor-covenant.org
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
https://www.contributor-covenant.org/faq. Translations are available at https://
128+
www.contributor-covenant.org/translations.

README.Rmd

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ library(modeldb)
1414
[![Codecov test coverage](https://codecov.io/gh/tidymodels/modeldb/branch/master/graph/badge.svg)](https://codecov.io/gh/tidymodels/modeldb?branch=master)
1515
[![Downloads](http://cranlogs.r-pkg.org/badges/modeldb)](http://cran.rstudio.com/package=modeldb)
1616

17-
Fit models inside the database. **`modeldb` works with most databases back-ends** because it leverages `dplyr` and `dbplyr` for the final SQL translation of the algorithm. It currently supports:
17+
Fit models inside the database! **modeldb works with most database back-ends** because it leverages [dplyr](https://dplyr.tidyverse.org/) and [dbplyr](https://dbplyr.tidyverse.org/) for the final SQL translation of the algorithm. It currently supports:
1818

1919
- K-means clustering
2020

@@ -23,19 +23,21 @@ Fit models inside the database. **`modeldb` works with most databases back-ends*
2323
## Installation
2424

2525
Install the CRAN version with:
26+
2627
```{r, eval = FALSE}
27-
# install.packages("modeldb")
28+
install.packages("modeldb")
2829
```
2930

30-
The development version is available using `devtools` as follows:
31+
The development version is available from GitHub using remotes:
32+
3133
```{r, eval = FALSE}
3234
# install.packages("remotes")
33-
# remotes::install_github("tidymodels/modeldb")
35+
remotes::install_github("tidymodels/modeldb")
3436
```
3537

3638
## Linear regression
3739

38-
An easy way to try out the package is by creating a temporary SQLite database, and loading `mtcars` to it
40+
An easy way to try out the package is by creating a temporary SQLite database, and loading `mtcars` to it.
3941

4042
```{r}
4143
con <- DBI::dbConnect(RSQLite::SQLite(), path = ":memory:")
@@ -51,7 +53,7 @@ tbl(con, "mtcars") %>%
5153
linear_regression_db(wt)
5254
```
5355

54-
The model output can be parsed by `tidypredict` to run the predictions in the database. Please see the `Linear Regression` article to learn more about how to use `linear_regression_db()`
56+
The model output can be parsed by [tidypredict](https://tidypredict.tidymodels.org/) to run the predictions in the database. Please see the "Linear Regression" article to learn more about how to use `linear_regression_db()`
5557

5658
## K Means clustering
5759

@@ -67,8 +69,21 @@ km <- tbl(con, "mtcars") %>%
6769
colnames(km)
6870
```
6971

70-
The SQL statement from `tbl` can be extracted using `dbplyr`'s `remote_query()`
72+
The SQL statement from `tbl` can be extracted using dbplyr's `remote_query()`
7173

7274
```{r}
7375
dbplyr::remote_query(km)
7476
```
77+
78+
## Contributing
79+
80+
This project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.
81+
82+
- For questions and discussions about tidymodels packages, modeling, and machine learning, please [post on RStudio Community](https://rstd.io/tidymodels-community).
83+
84+
- If you think you have encountered a bug, please [submit an issue](https://github.com/tidymodels/modeldb/issues).
85+
86+
- Either way, learn how to create and share a [reprex](https://rstd.io/reprex) (a minimal, reproducible example), to clearly communicate about your code. Check out [this helpful article on how to create reprexes](https://dbplyr.tidyverse.org/articles/reprex.html) for problems involving a database.
87+
88+
- Check out further details on [contributing guidelines for tidymodels packages](https://www.tidymodels.org/contribute/) and [how to get help](https://www.tidymodels.org/help/).
89+

README.md

Lines changed: 48 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ status](https://github.com/tidymodels/modeldb/workflows/R-CMD-check/badge.svg)](
88
coverage](https://codecov.io/gh/tidymodels/modeldb/branch/master/graph/badge.svg)](https://codecov.io/gh/tidymodels/modeldb?branch=master)
99
[![Downloads](http://cranlogs.r-pkg.org/badges/modeldb)](http://cran.rstudio.com/package=modeldb)
1010

11-
Fit models inside the database. **`modeldb` works with most databases
12-
back-ends** because it leverages `dplyr` and `dbplyr` for the final SQL
11+
Fit models inside the database\! **modeldb works with most database
12+
back-ends** because it leverages [dplyr](https://dplyr.tidyverse.org/)
13+
and [dbplyr](https://dbplyr.tidyverse.org/) for the final SQL
1314
translation of the algorithm. It currently supports:
1415

1516
- K-means clustering
@@ -21,20 +22,20 @@ translation of the algorithm. It currently supports:
2122
Install the CRAN version with:
2223

2324
``` r
24-
# install.packages("modeldb")
25+
install.packages("modeldb")
2526
```
2627

27-
The development version is available using `devtools` as follows:
28+
The development version is available from GitHub using remotes:
2829

2930
``` r
3031
# install.packages("remotes")
31-
# remotes::install_github("tidymodels/modeldb")
32+
remotes::install_github("tidymodels/modeldb")
3233
```
3334

3435
## Linear regression
3536

3637
An easy way to try out the package is by creating a temporary SQLite
37-
database, and loading `mtcars` to it
38+
database, and loading `mtcars` to it.
3839

3940
``` r
4041
con <- DBI::dbConnect(RSQLite::SQLite(), path = ":memory:")
@@ -55,9 +56,10 @@ tbl(con, "mtcars") %>%
5556
## <dbl> <dbl> <dbl>
5657
## 1 4.12 -0.156 0.125
5758

58-
The model output can be parsed by `tidypredict` to run the predictions
59-
in the database. Please see the `Linear Regression` article to learn
60-
more about how to use `linear_regression_db()`
59+
The model output can be parsed by
60+
[tidypredict](https://tidypredict.tidymodels.org/) to run the
61+
predictions in the database. Please see the “Linear Regression” article
62+
to learn more about how to use `linear_regression_db()`
6163

6264
## K Means clustering
6365

@@ -81,34 +83,60 @@ colnames(km)
8183
## [7] "hp" "drat" "wt" "qsec" "vs" "am"
8284
## [13] "gear" "carb"
8385

84-
The SQL statement from `tbl` can be extracted using `dbplyr`’s
86+
The SQL statement from `tbl` can be extracted using dbplyr’s
8587
`remote_query()`
8688

8789
``` r
8890
dbplyr::remote_query(km)
8991
```
9092

91-
## <SQL> SELECT `RHS`.`center` AS `k_center`, `LHS`.`k_mpg` AS `k_mpg`, `LHS`.`k_wt` AS `k_wt`, `RHS`.`mpg` AS `mpg`, `RHS`.`cyl` AS `cyl`, `RHS`.`disp` AS `disp`, `RHS`.`hp` AS `hp`, `RHS`.`drat` AS `drat`, `RHS`.`wt` AS `wt`, `RHS`.`qsec` AS `qsec`, `RHS`.`vs` AS `vs`, `RHS`.`am` AS `am`, `RHS`.`gear` AS `gear`, `RHS`.`carb` AS `carb`
92-
## FROM (SELECT `center` AS `k_center`, `mpg` AS `k_mpg`, `wt` AS `k_wt`
93-
## FROM (SELECT `center`, AVG(`mpg`) AS `mpg`, AVG(`wt`) AS `wt`
94-
## FROM (SELECT `mpg`, `wt`, `center`
95-
## FROM (SELECT *
93+
## <SQL> SELECT `k_center`, `k_mpg`, `k_wt`, `mpg`, `cyl`, `disp`, `hp`, `drat`, `wt`, `qsec`, `vs`, `am`, `gear`, `carb`
94+
## FROM (SELECT `LHS`.`mpg` AS `mpg`, `LHS`.`cyl` AS `cyl`, `LHS`.`disp` AS `disp`, `LHS`.`hp` AS `hp`, `LHS`.`drat` AS `drat`, `LHS`.`wt` AS `wt`, `LHS`.`qsec` AS `qsec`, `LHS`.`vs` AS `vs`, `LHS`.`am` AS `am`, `LHS`.`gear` AS `gear`, `LHS`.`carb` AS `carb`, `LHS`.`k_center` AS `k_center`, `RHS`.`k_mpg` AS `k_mpg`, `RHS`.`k_wt` AS `k_wt`
95+
## FROM (SELECT `mpg`, `cyl`, `disp`, `hp`, `drat`, `wt`, `qsec`, `vs`, `am`, `gear`, `carb`, `center` AS `k_center`
9696
## FROM (SELECT `mpg`, `cyl`, `disp`, `hp`, `drat`, `wt`, `qsec`, `vs`, `am`, `gear`, `carb`, `center_1`, `center_2`, `center_3`, CASE
9797
## WHEN (`center_1` >= `center_1` AND `center_1` < `center_2` AND `center_1` < `center_3`) THEN ('center_1')
9898
## WHEN (`center_2` < `center_1` AND `center_2` >= `center_2` AND `center_2` < `center_3`) THEN ('center_2')
9999
## WHEN (`center_3` < `center_1` AND `center_3` < `center_2` AND `center_3` >= `center_3`) THEN ('center_3')
100100
## END AS `center`
101101
## FROM (SELECT `mpg`, `cyl`, `disp`, `hp`, `drat`, `wt`, `qsec`, `vs`, `am`, `gear`, `carb`, SQRT(((20.6428571428571 - `mpg`) * (20.6428571428571 - `mpg`)) + ((3.07214285714286 - `wt`) * (3.07214285714286 - `wt`))) AS `center_1`, SQRT(((14.4583333333333 - `mpg`) * (14.4583333333333 - `mpg`)) + ((4.05866666666667 - `wt`) * (4.05866666666667 - `wt`))) AS `center_2`, SQRT(((30.0666666666667 - `mpg`) * (30.0666666666667 - `mpg`)) + ((1.873 - `wt`) * (1.873 - `wt`))) AS `center_3`
102102
## FROM `mtcars`))
103-
## WHERE (NOT(((`center`) IS NULL)))))
104-
## GROUP BY `center`)) AS `LHS`
105-
## RIGHT JOIN (SELECT `mpg`, `cyl`, `disp`, `hp`, `drat`, `wt`, `qsec`, `vs`, `am`, `gear`, `carb`, `center`
103+
## WHERE (NOT(((`center`) IS NULL)))) AS `LHS`
104+
## LEFT JOIN (SELECT `center` AS `k_center`, `mpg` AS `k_mpg`, `wt` AS `k_wt`
105+
## FROM (SELECT `center`, AVG(`mpg`) AS `mpg`, AVG(`wt`) AS `wt`
106+
## FROM (SELECT `mpg`, `wt`, `center`
107+
## FROM (SELECT *
106108
## FROM (SELECT `mpg`, `cyl`, `disp`, `hp`, `drat`, `wt`, `qsec`, `vs`, `am`, `gear`, `carb`, `center_1`, `center_2`, `center_3`, CASE
107109
## WHEN (`center_1` >= `center_1` AND `center_1` < `center_2` AND `center_1` < `center_3`) THEN ('center_1')
108110
## WHEN (`center_2` < `center_1` AND `center_2` >= `center_2` AND `center_2` < `center_3`) THEN ('center_2')
109111
## WHEN (`center_3` < `center_1` AND `center_3` < `center_2` AND `center_3` >= `center_3`) THEN ('center_3')
110112
## END AS `center`
111113
## FROM (SELECT `mpg`, `cyl`, `disp`, `hp`, `drat`, `wt`, `qsec`, `vs`, `am`, `gear`, `carb`, SQRT(((20.6428571428571 - `mpg`) * (20.6428571428571 - `mpg`)) + ((3.07214285714286 - `wt`) * (3.07214285714286 - `wt`))) AS `center_1`, SQRT(((14.4583333333333 - `mpg`) * (14.4583333333333 - `mpg`)) + ((4.05866666666667 - `wt`) * (4.05866666666667 - `wt`))) AS `center_2`, SQRT(((30.0666666666667 - `mpg`) * (30.0666666666667 - `mpg`)) + ((1.873 - `wt`) * (1.873 - `wt`))) AS `center_3`
112114
## FROM `mtcars`))
113-
## WHERE (NOT(((`center`) IS NULL)))) AS `RHS`
114-
## ON (`LHS`.`k_center` = `RHS`.`center`)
115+
## WHERE (NOT(((`center`) IS NULL)))))
116+
## GROUP BY `center`)) AS `RHS`
117+
## ON (`LHS`.`k_center` = `RHS`.`k_center`)
118+
## )
119+
120+
## Contributing
121+
122+
This project is released with a [Contributor Code of
123+
Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html).
124+
By contributing to this project, you agree to abide by its terms.
125+
126+
- For questions and discussions about tidymodels packages, modeling,
127+
and machine learning, please [post on RStudio
128+
Community](https://rstd.io/tidymodels-community).
129+
130+
- If you think you have encountered a bug, please [submit an
131+
issue](https://github.com/tidymodels/modeldb/issues).
132+
133+
- Either way, learn how to create and share a
134+
[reprex](https://rstd.io/reprex) (a minimal, reproducible example),
135+
to clearly communicate about your code. Check out [this helpful
136+
article on how to create
137+
reprexes](https://dbplyr.tidyverse.org/articles/reprex.html) for
138+
problems involving a database.
139+
140+
- Check out further details on [contributing guidelines for tidymodels
141+
packages](https://www.tidymodels.org/contribute/) and [how to get
142+
help](https://www.tidymodels.org/help/).

0 commit comments

Comments
 (0)