All datasets and functions required for the examples and exercises of the book “Data Science for Psychologists” (by Hansjoerg Neth, Konstanz University, 2020), available at https://bookdown.org/hneth/ds4psy/. The book and course introduce principles and methods of data science to students of psychology and other biological or social sciences. The ‘ds4psy’ package primarily provides datasets, but also functions for data generation and manipulation (e.g., of text and time data) and graphics that are used in the book and its exercises. All functions included in ‘ds4psy’ are designed to be instructive and entertaining, rather than elegant or efficient.
The book and course Data Science for Psychologists includes the following resources:
The most recent release of ds4psy (0.4.0) is available from CRAN: https://CRAN.R-project.org/package=ds4psy.
The current development version of ds4psy (0.4.0.9001+) is hosted at https://github.com/hneth/ds4psy/.
The textbook Data Science for Psychologists is hosted at https://bookdown.org/hneth/ds4psy/.
Release of ds4psy (0.4.0) on CRAN: https://CRAN.R-project.org/package=ds4psy. [2020-07-06]
This version adds support for processing data with dates and times:
change_tz() and change_time() functions for changing the display of calendar times (“POSIXct”) to local times (“POSIXlt”) in different time zones tz, and vice versa (i.e., changing actual time, but preserving time display).is_leap_year() function checks dates and times (or integers denoting years in 4-digit “%Y” format) for falling within a leap year.dt_10 and exp_num_dt support exercises on dates and times.cur_date() and cur_time() now print date/time (as string) or return a “Date”/“POSIXct” object.what_date() and what_time() gain support for adding time zones tz (but no active conversion).sample_time(): Switch default to sampling “POSIXct” objects (making “POSIXlt” optional) and allow specifying time zones tz.cur_date(), what_date(), etc.) now use Sys.Date() (i.e., an object of class “Date”) rather than Sys.time() (i.e., a “POSIXct” calendar time) as default.is.wholenumber() from is.integer()\u... rather than \U... in Umlaut definitionsfruits and floweryRelease of ds4psy (0.3.0) on CRAN: https://CRAN.R-project.org/package=ds4psy. [2020-06-15]
This release adds support for processing text data.
text_to_sentences() and text_to_words() functions for text processingcount_words() (in analogy to count_chars()) function for text processingcclass (as a named character vector) for matching character classes in regular expressionsmetachar (as a character vector) for matching meta-characters in regular expressionsUmlaut (as a named character vector) for showing and selecting German Umlaut characterscountries, fruits, and flowery phrases (as character vectors)Bushisms and Trumpisms (as character vectors)sample_char() functionREADME.Rmdcount_char() to count_chars() (to use plural form)sample_date() and sample_time() (to use singular form)text functions to text objects and functionsrandom functions to sampling functionsRelease of ds4psy (0.2.1) on CRAN: https://CRAN.R-project.org/package=ds4psy. [2020-05-06]
This is a maintenance release to remove some dependencies, fix bugs on CRAN platforms, and add some datasets.
here and tibble packages (and removed these packages from declared Imports).t_1–t_4.what_day with a simpler version that omits unit and as_integer arguments (to avoid WARN on CRAN for r-devel-linux-x86_64-debian-clang).data$... elements from aes() in ggplot callsutils::globalVariables(...) to avoid Warning NOTE “Undefined global functions or variables”dplyr, and magrittr) from declared ImportsRelease of ds4psy (0.2.0) on CRAN: https://CRAN.R-project.org/package=ds4psy. [2020-04-20]
Changes involving new functionality include:
coin() flips and dice() throws)is.wholenumber() to test for integer values (mentioned in R oddities)plot_text() plotting functionread_ascii() and count_chars() functions for text processingcaseflip() and capitalize() functions for text processingsample_date() and sample_time())cur_date(), cur_time(), for Chapter 10: Time data)what_ functions for simple date and time queries (for Chapter 10: Time data)make_grid() for an exercise on visual illusions (Exercise 6 of Chapter 2)fame dataset to illustrate working with dates (Exercise 3 of Chapter 10)num_as_char() and num_as_ordinal() (to be used in Chapter 11: Functions)data.R)plot_fun.R)readr, stringr, tidyr, and tidyverse) from declared ImportsInitial release of ds4psy (0.1.0) on CRAN: https://CRAN.R-project.org/package=ds4psy. [2019-08-10]
The initial functionality is limited, as the package is designed to support the ds4psy book:
[File News.md updated on 2020-07-06.]