ds4psy1.0.0 package

Data Science for Psychologists

base_digits

Base digits: Sequence of numeric symbols (as named vector)

base2dec

Convert a string of numeral digits from some base into decimal notatio...

capitalize

Capitalize initial characters in strings of text x.

caseflip

Flip the case of characters in a string of text x.

cclass

cclass provides character classes (as a named vector).

change_time

Change time and time zone (without changing time display).

change_tz

Change time zone (without changing represented time).

chars_to_text

Combine character inputs x into a single string of text.

coin

Flip a fair coin (with 2 sides "H" and "T") n times.

collapse_chars

Collapse character inputs x into a single string.

count_chars

Count the frequency of characters in a string of text x.

count_chars_words

Count the frequency of characters and words in a string of text x.

count_words

Count the frequency of words in a string of text x.

cur_date

Current date (in yyyy-mm-dd or dd-mm-yyyy format).

cur_time

Current time (in hh:mm or hh:mm:ss format).

days_in_month

How many days are in a month (of given date)?

dec2base

Convert an integer from decimal notation into a string of numeric digi...

dice

Throw a fair dice (with a given number of sides) n times.

dice_2

Throw a questionable dice (with a given number of sides) n times.

diff_dates

Get the difference between two dates (in human units).

diff_times

Get the difference between two times (in human units).

diff_tz

Get the time zone difference between two times.

ds4psy.guide

Opens user guide of the ds4psy package.

get_set

Get a set of x-y coordinates.

invert_rules

invert_rules inverts a set of encoding rules.

is_equal

Test two vectors for pairwise (near) equality.

is_leap_year

Is some year a so-called leap year?

is_vect

Test for a vector (i.e., atomic vector or list).

is_wholenumber

Test for whole numbers (i.e., integers).

l33t_rul35

l33t_rul35 provides rules for translating text into leet/l33t slang.

make_grid

Generate a grid of x-y coordinates.

map_text_chars

map_text_chars maps the characters of a text string into a table (with...

map_text_coord

map_text_coord maps the characters of a text string into a table (with...

map_text_regex

Map text to character table (allowing for matching patterns).

metachar

metachar provides metacharacters (as a character vector).

num_as_char

Convert a number into a character sequence.

num_as_ordinal

Convert a number into an ordinal character sequence.

num_equal

Test two numeric vectors for pairwise (near) equality.

pal_ds4psy

ds4psy default color palette.

pal_n_sq

Get n-by-n dedicated colors of a color palette.

plot_charmap

Plot a character map as a tile plot with text labels.

plot_chars

Plot text characters (from file or user input) and match patterns.

plot_fn

A function to plot a plot.

plot_fun

Another function to plot some plot.

plot_n

Plot n tiles.

plot_text

Plot text characters (from file or user input).

plot_tiles

Plot n-by-n tiles.

read_ascii

read_ascii parses text (from file or user input) into string(s) of tex...

sample_char

Draw a sample of n random characters (from given characters).

sample_date

Draw a sample of n random dates (from a given range).

sample_time

Draw a sample of n random times (from a given range).

text_to_chars

Split string(s) of text x into its characters.

text_to_sentences

Split strings of text x into sentences.

text_to_words

Split string(s) of text x into words.

theme_clean

A clean alternative theme for ggplot2.

theme_ds4psy

A basic and flexible plot theme (using ggplot2 and unikn).

theme_empty

A basic and flexible plot theme (using ggplot2 and unikn).

transl33t

transl33t translates text into leet slang.

Umlaut

Umlaut provides German Umlaut letters (as Unicode characters).

what_date

What date is it?

what_month

What month is it?

what_time

What time is it?

what_wday

What day of the week is it?

what_week

What week is it?

what_year

What year is it?

words_to_text

Paste or collapse words x into a text.

zodiac

Get zodiac (corresponding to date x).

All datasets and functions required for the examples and exercises of the book "Data Science for Psychologists" (by Hansjoerg Neth, Konstanz University, 2022), 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 explicit and instructive, rather than efficient or elegant.

  • Maintainer: Hansjoerg Neth
  • License: CC BY-SA 4.0
  • Last published: 2023-09-15