Skip to content

Commit

Permalink
added test screenshots to readme and changed boolean to logical
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelkriggs committed Mar 9, 2019
1 parent 52c0af4 commit 1f0a1d4
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 12 deletions.
Binary file modified .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion R/variable_summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ variable_summary <- function(x){
}, error=function(e) print("We encountered an error that was not related to x being a dataframe or counts"))

# return a data frame of the summary results
data.frame("variable_type" = c("numeric", "character", "boolean", "date", "other"),
data.frame("variable_type" = c("numeric", "character", "logical", "date", "other"),
"count" = c(num_count, char_count, bool_count, date_count, other_count),
stringsAsFactors = FALSE)
}
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

### A Collaborative Software Development Project

February 2019
March 2019

### Overview

Expand Down Expand Up @@ -40,7 +40,7 @@ example usage of `variable_summary`:
```
toy_data <- data.frame("letters" = c("a", "b", NA, "d"),
"numbers" = c(1, 4, 6, NA),
"booleans" = c(NA, FALSE, NA, TRUE),
"logical" = c(NA, FALSE, NA, TRUE),
"dates" = as.Date(c("2003-01-02", "2002-02-02", "2004-03-03", "2005-04-04")),
"integers" = c(2L, 3L, 4L, 5L),
stringsAsFactors = FALSE)
Expand All @@ -54,7 +54,7 @@ example output of `variable_summary`:
| ------------- | ----- |
| numeric | 1 |
| character | 1 |
| boolean | 1 |
| logical | 1 |
| date | 1 |
| other | 1 |

Expand All @@ -66,7 +66,7 @@ example usage of `missing_values`:
```
toy_data <- data.frame("letters" = c("a", "b", NA, "d"),
"numbers" = c(1, 4, 6, NA),
"booleans" = c(NA, FALSE, NA, TRUE),
"logical" = c(NA, FALSE, NA, TRUE),
"dates" = as.Date(c("2003-01-02", "2002-02-02", "2004-03-03", "2005-04-04")),
"integers" = c(2L, 3L, 4L, 5L),
stringsAsFactors = FALSE)
Expand All @@ -80,19 +80,19 @@ example output of `missing_values`:
| ------------- | ----- | ------ |
| letters | 1 | 0.25 |
| numbers | 1 | 0.25 |
| booleans | 2 | 0.50 |
| logical | 2 | 0.50 |
| dates | 0 | 0.00 |
| integers | 0 | 0.00 |

#### Function3 | Dataset Size/Info
The function `size` will take in a dataframe and print the shape and size of the dataframe. For the size, the function will print how much memory the dataframe consumes in Bytes or Megabytes. The output of the function will be a dataframe of size 1 x 3.
The function `size` will take in a dataframe and print the shape and size of the dataframe. For the size, the function will print how much memory the dataframe consumes in bytes. The output of the function will be a dataframe of size 1 x 3.

example usage of `size`:

```
toy_data <- data.frame("letters" = c("a", "b", NA, "d"),
"numbers" = c(1, 4, 6, NA),
"booleans" = c(NA, FALSE, NA, TRUE),
"logical" = c(NA, FALSE, NA, TRUE),
"dates" = as.Date(c("2003-01-02", "2002-02-02", "2004-03-03", "2005-04-04")),
"integers" = c(2L, 3L, 4L, 5L),
stringsAsFactors = FALSE)
Expand Down Expand Up @@ -130,3 +130,9 @@ The following are existing functions in R that are similar to those developed wi
| Milos Milic | [@milicmil](https://github.com/milicmil) |
| Arzan Irani | [@nazra-inari](https://github.com/nazra-inari) |
| James Pushor | [@jpush1773](https://github.com/jpush1773)

### Test Results

![](imgs/exploreR_test.png)

![](imgs/Rtest.png)
Binary file added imgs/Rtest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgs/exploreR_test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/test_missing_values.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ context("testing missing values")
# input: a data frame
toy_data <- data.frame("letters" = c("a", "b", NA, "d"),
"numbers" = c(1, 4, 6, NA),
"booleans" = c(NA, FALSE, NA, TRUE),
"logical" = c(NA, FALSE, NA, TRUE),
stringsAsFactors = FALSE)

test_that("input to missing_values is a dataframe", {
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test_size.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ context("testing size")
# input: a data frame
toy_data <- data.frame("letters" = c("a", "b", NA, "d"),
"numbers" = c(1, 4, 6, NA),
"booleans" = c(NA, FALSE, NA, TRUE),
"logical" = c(NA, FALSE, NA, TRUE),
stringsAsFactors = FALSE)

test_that("input to size is a dataframe", {
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test_variable_summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ context("testing variable summary")
# input: a data frame
toy_data <- data.frame("letters" = c("a", "b", NA, "d"),
"numbers" = c(1, 4, 6, NA),
"booleans" = c(NA, FALSE, NA, TRUE),
"logical" = c(NA, FALSE, NA, TRUE),
"dates" = as.Date(c("2003-01-02", "2002-02-02", "2004-03-03", "2005-04-04")),
"integers" = c(2L, 3L, 4L, 5L),
stringsAsFactors = FALSE)
Expand Down
2 changes: 1 addition & 1 deletion vignettes/explorer.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ You can use this toy data frame to see how the functions work.
```{r}
toy_data <- data.frame("letters" = c("a", "b", NA, "d"),
"numbers" = c(1, 4, 6, NA),
"booleans" = c(NA, FALSE, NA, TRUE),
"logical" = c(NA, FALSE, NA, TRUE),
"dates" = as.Date(c("2003-01-02", "2002-02-02", "2004-03-03", "2005-04-04")),
"integers" = c(2L, 3L, 4L, 5L),
stringsAsFactors = FALSE)
Expand Down

0 comments on commit 1f0a1d4

Please sign in to comment.