Browse Source

Insert tab in front of levels in the variables column

tags/0.1.0
Maxime Wack 8 years ago
parent
commit
0a6d0152d1
3 changed files with 5 additions and 3 deletions
  1. +2
    -1
      DESCRIPTION
  2. +1
    -0
      NAMESPACE
  3. +2
    -2
      R/build.R

+ 2
- 1
DESCRIPTION View File

@@ -14,7 +14,8 @@ Encoding: UTF-8
LazyData: true
Imports:
dplyr,
purrr
purrr,
stringr
Suggests:
datatable,
pander


+ 1
- 0
NAMESPACE View File

@@ -3,6 +3,7 @@
export("%>%")
importFrom(dplyr,"%>%")
importFrom(dplyr,as_data_frame)
importFrom(purrr,at_depth)
importFrom(purrr,flatten_dbl)
importFrom(purrr,map)
importFrom(purrr,map_lgl)

+ 2
- 2
R/build.R View File

@@ -39,7 +39,7 @@ statTable <- function(data, stats)
#' @param data The dataframe to get the names from
#' @param labels The optional named character vector containing the keypairs var = "Label"
#' @return A character vector of variable names/labels and levels
#' @importFrom purrr map map_lgl
#' @importFrom purrr map map_lgl at_depth
varColumn <- function(data, labels = NULL)
{
# Replace variable names by their labels, if they exist
@@ -53,7 +53,7 @@ varColumn <- function(data, labels = NULL)
map_lgl(is.factor) %>%
which %>%
insert(x = base_names,
y = select(data, .) %>% map(levels),
y = select(data, .) %>% map(levels) %>% at_depth(1, ~ stringr::str_c("\t", .)),
position = .)
} else
{


Loading…
Cancel
Save