-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from UBC-MDS/tzoght-milestone2_1
ready for review
- Loading branch information
Showing
13 changed files
with
371 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Contributing | ||
|
||
Contributions are welcome, and they are greatly appreciated! Every little bit | ||
helps, and credit will always be given. | ||
|
||
## Types of Contributions | ||
|
||
### Report Bugs | ||
|
||
If you are reporting a bug, please include: | ||
|
||
* Your operating system name and version. | ||
* Any details about your local setup that might be helpful in troubleshooting. | ||
* Detailed steps to reproduce the bug. | ||
|
||
### Fix Bugs | ||
|
||
Look through the GitHub issues for bugs and Project. Anything tagged with "bug" and "help | ||
wanted" is open to whoever wants to implement it. | ||
|
||
### Implement Features | ||
|
||
Look through the GitHub issues for features. Anything tagged with "enhancement" | ||
and "help wanted" is open to whoever wants to implement it. | ||
|
||
### Write Documentation | ||
|
||
You can never have enough documentation! Please feel free to contribute to any | ||
part of the documentation, such as the official docs, docstrings, or even | ||
on the web in blog posts, articles, and such. | ||
|
||
### Submit Feedback | ||
|
||
If you are proposing a feature: | ||
|
||
* Explain in detail how it would work. | ||
* Keep the scope as narrow as possible, to make it easier to implement. | ||
* Remember that this is a volunteer-driven project, and that contributions | ||
are welcome | ||
|
||
## Get Started! | ||
|
||
Ready to contribute? Here's how to set up `sanityzeR` for local development. | ||
|
||
1. Fork and Clone a copy of `sanityzeR` locally. | ||
2. Install locally in R studio | ||
|
||
```console | ||
library(devtools) | ||
library(usethis) | ||
load_all() | ||
``` | ||
|
||
3. Use `git` (or similar) to create a branch for local development and make your changes: | ||
|
||
```console | ||
$ git checkout -b name-of-your-bugfix-or-feature | ||
``` | ||
|
||
4. When you're done making changes, check that your changes conform to any code formatting requirements and pass any tests. | ||
|
||
5. Commit your changes and open a pull request. | ||
|
||
## Pull Request Guidelines | ||
|
||
Before you submit a pull request, check that it meets these guidelines: | ||
|
||
1. The pull request should include additional tests if appropriate. | ||
2. If the pull request adds functionality, the docs should be updated. | ||
3. The pull request should work for all currently supported operating systems and versions of R. | ||
|
||
## Code of Conduct | ||
|
||
Please note that the `sanityzeR` project is released with a | ||
Code of Conduct. By contributing to this project you agree to abide by its terms. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Contributors | ||
|
||
## Special thanks for all the people who had helped this project so far: | ||
|
||
- [Tony Zoght](https://github.com/tzoght) | ||
- [Caesar Wong](https://github.com/caesarw0) | ||
- [Jonah Hamilton](https://github.com/xXJohamXx) | ||
|
||
## I would like to join this list. How can I help the project? | ||
|
||
For more information, please refer to our [CONTRIBUTING](CONTRIBUTING.md) guide. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
export(clean_data_frame) | ||
export(redact_creditcardnumber) | ||
export(redact_email) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#' Cleans a data.frame by redacting PII information from character vector columns | ||
#' | ||
#' @param df A data.frame to clean | ||
#' @param spotters_list A list containing lists of 3 elements each: | ||
#' 1. the redact function | ||
#' 2. hash_spotted value to pass or 0 to keep the default | ||
#' 3. the replace_with value or 0 to keep the default | ||
#' | ||
#' | ||
#' @return A deep copy of the cleaned data.frame. | ||
#' @export | ||
#' | ||
#' @examples | ||
#' df <- data.frame() | ||
#' spotters <- list() | ||
#' spotter_1 <- list(redact_email,TRUE,0) | ||
#' spotters <- append(spotters,spotter_1) | ||
#' df_cleaned <- clean_data_frame(df, spotters) | ||
clean_data_frame <- function(df, spotters_list) { | ||
# to be implemented in the next milestone | ||
print(df) | ||
print(spotters_list) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#' Redacts credit card numbers from a given string | ||
#' | ||
#' @param string A character vector with, at most, one element. The input string to redact credit card numbers from | ||
#' @param hash_spotted When TRUE, the redaction of the credit cards will be a hash of the redacted (Default False) | ||
#' @param replace_with A character vector with, at most, one element. When hash_spotted is FALSE, this character vector will be the replacement redacted credit card numbers. | ||
#' | ||
#' | ||
#' @return A character vector. | ||
#' @export | ||
#' | ||
#' @examples | ||
#' x <- "You can use my 5567554868135971 here" | ||
#' redact_creditcardnumber(x) | ||
redact_creditcardnumber <- function(string, hash_spotted=FALSE, replace_with="CREDITCARD") { | ||
# to be implemented in the next milestone | ||
print(string) | ||
print(hash_spotted) | ||
print(replace_with) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#' Redacts an email addresses from a given string | ||
#' | ||
#' @param string A character vector with, at most, one element. The input string to redact email addresses from | ||
#' @param hash_spotted When TRUE, the redaction of the email addresses will be a hash of the redacted (Default False) | ||
#' @param replace_with A character vector with, at most, one element. When hash_spotted is FALSE, this character vector will be the replacement redacted email addresses. | ||
#' | ||
#' | ||
#' @return A character vector. | ||
#' @export | ||
#' | ||
#' @examples | ||
#' x <- "my email address is foo@gaga.com" | ||
#' redact_email(x) | ||
redact_email <- function(string, hash_spotted=FALSE, replace_with="EMAILADDRS") { | ||
# to be implemented in the next milestone | ||
print(string) | ||
print(hash_spotted) | ||
print(replace_with) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.