Skip to content

Commit

Permalink
use tibble not data_frame
Browse files Browse the repository at this point in the history
  • Loading branch information
njtierney committed Jul 4, 2018
1 parent e43f180 commit 7051b8f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
6 changes: 3 additions & 3 deletions R/internals.R
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ label_col_missing_pct <- function(x,
#'
#' @param x is a dataframe passed from vis_miss(x).
#'
#' @return a data_frame with two columns `p_miss_lab` and `p_pres_lab`,
#' @return a tibble with two columns `p_miss_lab` and `p_pres_lab`,
#' containing the labels to use for present and missing. A dataframe is
#' returned because I think it is a good style habit compared to a list.
#'
Expand Down Expand Up @@ -239,8 +239,8 @@ miss_guide_label <- function(x) {
sep = "")
}

label_frame <- dplyr::data_frame(p_miss_lab = paste(p_miss_lab),
p_pres_lab = paste(p_pres_lab))
label_frame <- tibble::tibble(p_miss_lab = paste(p_miss_lab),
p_pres_lab = paste(p_pres_lab))

return(label_frame)

Expand Down
3 changes: 1 addition & 2 deletions R/vis-compare.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ vis_compare <- function(df1,

v_identical <- Vectorize(identical)

df_diff <- purrr::map2(df1, df2, v_identical) %>%
dplyr::as_data_frame()
df_diff <- purrr::map2_df(df1, df2, v_identical)

d <- df_diff %>%
as.data.frame() %>%
Expand Down
2 changes: 1 addition & 1 deletion man/miss_guide_label.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions tests/testthat/test_variable_spaces.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ context("Test names with spaces")

library(visdat)

messy_names <- dplyr::data_frame(`Sepal Width` = iris$Sepal.Width,
`Sepal Length` = iris$Sepal.Length,
`Petal Length` = iris$Petal.Length,
`Species Names` = iris$Species)
messy_names <- tibble::tibble(`Sepal Width` = iris$Sepal.Width,
`Sepal Length` = iris$Sepal.Length,
`Petal Length` = iris$Petal.Length,
`Species Names` = iris$Species)


test_that("vis_dat works on dataframes with irregular variable names", {
Expand Down

0 comments on commit 7051b8f

Please sign in to comment.