Skip to content

Commit

Permalink
Remove startup message
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobkap committed Aug 3, 2024
1 parent f4ae079 commit 99c87fb
Show file tree
Hide file tree
Showing 16 changed files with 384 additions and 847 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: fastDummies
Type: Package
Title: Fast Creation of Dummy (Binary) Columns and Rows from Categorical Variables
Version: 1.7.3
Version: 1.7.4
Authors@R: c(
person("Jacob", "Kaplan", email = "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-0601-0387")),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# fastDummies 1.7.4

* Remove .onAttach message.

# fastDummies 1.7.3

* Fix .onAttach message.
Expand Down
7 changes: 0 additions & 7 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,3 @@ fix_data_type <- function(.data, data_type) {

return(.data)
}

.onAttach <- function(libname, pkgname) {
package_citation <- "Kaplan, J. & Schlegel, B. (2023). fastDummies: Fast Creation of Dummy (Binary) Columns and Rows from Categorical Variables. Version 1.7.1. URL: https://github.com/jacobkap/fastDummies, https://jacobkap.github.io/fastDummies/."
packageStartupMessage("Thank you for using fastDummies!")
packageStartupMessage("To acknowledge our work, please cite the package:")
packageStartupMessage(package_citation)
}
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ output: github_document

[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/fastDummies)](https://cran.r-project.org/package=fastDummies)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/jacobkap/fastDummies?branch=master&svg=true)](https://ci.appveyor.com/project/jacobkap/fastDummies)
[![Build Status](https://travis-ci.org/jacobkap/fastDummies.svg?branch=master)](https://travis-ci.org/jacobkap/fastDummies)
[![Coverage status](https://codecov.io/gh/jacobkap/fastDummies/branch/master/graph/badge.svg)](https://codecov.io/github/jacobkap/fastDummies?branch=master)
[![Build Status](https://travis-ci.org/jacobkap/fastDummies.svg?branch=master)](https://app.travis-ci.com/jacobkap/fastDummies)
[![Coverage status](https://codecov.io/gh/jacobkap/fastDummies/branch/master/graph/badge.svg)](https://app.codecov.io/github/jacobkap/fastDummies?branch=master)
[![](http://cranlogs.r-pkg.org/badges/grand-total/fastDummies?color=blue)](https://cran.r-project.org/package=fastDummies)

## Overview
Expand Down
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/fastDummies)](https://cran.r-project.org/package=fastDummies)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/fastDummies)](https://cran.r-project.org/package=fastDummies)
[![AppVeyor Build
Status](https://ci.appveyor.com/api/projects/status/github/jacobkap/fastDummies?branch=master&svg=true)](https://ci.appveyor.com/project/jacobkap/fastDummies)
[![Build
Status](https://travis-ci.org/jacobkap/fastDummies.svg?branch=master)](https://travis-ci.org/jacobkap/fastDummies)
Status](https://travis-ci.org/jacobkap/fastDummies.svg?branch=master)](https://app.travis-ci.com/jacobkap/fastDummies)
[![Coverage
status](https://codecov.io/gh/jacobkap/fastDummies/branch/master/graph/badge.svg)](https://codecov.io/github/jacobkap/fastDummies?branch=master)
status](https://codecov.io/gh/jacobkap/fastDummies/branch/master/graph/badge.svg)](https://app.codecov.io/github/jacobkap/fastDummies?branch=master)
[![](http://cranlogs.r-pkg.org/badges/grand-total/fastDummies?color=blue)](https://cran.r-project.org/package=fastDummies)

## Overview
Expand Down Expand Up @@ -34,9 +34,9 @@ library(fastDummies)

There are two functions in this package:

- `dummy_cols()` lets you make dummy variables (`dummy_columns()` is a
clone of `dummy_cols()`)
- `dummy_rows()` which lets you make dummy rows.
- `dummy_cols()` lets you make dummy variables (`dummy_columns()` is a
clone of `dummy_cols()`)
- `dummy_rows()` which lets you make dummy rows.

# Dummy Columns

Expand All @@ -57,7 +57,7 @@ Imagine you have a data set about animals in a local shelter. One of the
columns in your data is what animal it is: dog or cat.

| animals |
| :------ |
|:--------|
| dog |
| dog |
| cat |
Expand All @@ -68,19 +68,19 @@ indicate if the animal is a cat. Each row would get a value of 1 in the
column indicating which animal they are, and 0 in the other column.

| animals | dog | cat |
| ------- | --- | --- |
|---------|-----|-----|
| dog | 1 | 0 |
| dog | 1 | 0 |
| cat | 0 | 1 |

In the function dummy\_cols, the names of these new columns are
In the function dummy_cols, the names of these new columns are
concatenated to the original column and separated by an underscore.

| animals | animals\_dog | animals\_cat |
| ------- | ------------ | ------------ |
| dog | 1 | 0 |
| dog | 1 | 0 |
| cat | 0 | 1 |
| animals | animals_dog | animals_cat |
|---------|-------------|-------------|
| dog | 1 | 0 |
| dog | 1 | 0 |
| cat | 0 | 1 |

With an example like this, it is fairly easy to make the dummy columns
yourself. `dummy_cols()` automates the process, and is useful when you
Expand All @@ -98,12 +98,12 @@ knitr::kable(fastDummies_example)
```

| numbers | gender | animals | dates |
| ------: | :----- | :------ | :--------- |
|--------:|:-------|:--------|:-----------|
| 1 | male | dog | 2012-01-01 |
| 2 | male | dog | 2011-12-31 |
| 3 | female | cat | 2012-01-01 |

The object **fastDummies\_example** has two character type columns, one
The object **fastDummies_example** has two character type columns, one
integer column, and a Date column. By default, `dummy_cols()` will make
dummy variables from factor or character columns only. This is because
in most cases those are the only types of data you want dummy variables
Expand All @@ -116,11 +116,11 @@ results <- fastDummies::dummy_cols(fastDummies_example)
knitr::kable(results)
```

| numbers | gender | animals | dates | gender\_female | gender\_male | animals\_cat | animals\_dog |
| ------: | :----- | :------ | :--------- | -------------: | -----------: | -----------: | -----------: |
| 1 | male | dog | 2012-01-01 | 0 | 1 | 0 | 1 |
| 2 | male | dog | 2011-12-31 | 0 | 1 | 0 | 1 |
| 3 | female | cat | 2012-01-01 | 1 | 0 | 1 | 0 |
| numbers | gender | animals | dates | gender_female | gender_male | animals_cat | animals_dog |
|--------:|:-------|:--------|:-----------|--------------:|------------:|------------:|------------:|
| 1 | male | dog | 2012-01-01 | 0 | 1 | 0 | 1 |
| 2 | male | dog | 2011-12-31 | 0 | 1 | 0 | 1 |
| 3 | female | cat | 2012-01-01 | 1 | 0 | 1 | 0 |

# Dummy Rows

Expand All @@ -133,7 +133,7 @@ The function takes all character, factor, and Date columns, finds all
possible combinations of their values, and adds the rows that are not in
the original data set. Any columns not used in creating the combinations
(e.g. numeric) are given a value of NA (unless otherwise specified with
*dummy\_value*).
*dummy_value*).

Lets start with a simple example.

Expand All @@ -148,7 +148,7 @@ knitr::kable(fastDummies_example)
```

| numbers | gender | animals | dates |
| ------: | :----- | :------ | :--------- |
|--------:|:-------|:--------|:-----------|
| 1 | male | dog | 2012-01-01 |
| 2 | male | dog | 2011-12-31 |
| 3 | female | cat | 2012-01-01 |
Expand All @@ -167,7 +167,7 @@ knitr::kable(results)
```

| numbers | gender | animals | dates |
| ------: | :----- | :------ | :--------- |
|--------:|:-------|:--------|:-----------|
| 1 | male | dog | 2012-01-01 |
| 2 | male | dog | 2011-12-31 |
| 3 | female | cat | 2012-01-01 |
Expand Down
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Test environments

* local Windows install, R 4.3.1
* local Windows install, R 4.3.2
* AppVeyor, R 4.3.1
* Rhub
+ Windows Server 2022, R-devel, 64 bit
Expand Down
123 changes: 39 additions & 84 deletions docs/404.html

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

Loading

0 comments on commit 99c87fb

Please sign in to comment.