journalR0.6.0 package

Formatting Tools for Scientific Journal Writing

add_column

Add/overwrite a column in a data.frame or data.table, preserving class...

assert_clu_relationship

Assert CLU relationships

assert_data_type

Assert data type

assert_set_choice

Assert set choice

assert_style_schema

Assert style schema

assert_x_gte_y

Assert Greater Than or Equal To

assert_x_in_y

Assert all elements of x are in y

assert_x_not_in_y

Assert no elements of x are in y

df_strict

Strict data.frame constructor

drop_column

Drop a column from a data.frame or data.table, preserving class and mo...

drop_columns

Vectorized version of drop_column()

en_dash

En-dash

fmt_magnitude

Format magnitude

format_journal_clu

Format central, lower, upper value triplets for journal presentation

format_journal_df

Return a table with formatted central, lower, upper

format_lancet_clu

Format central, lower, upper value triplets for Lancet journal present...

format_lancet_df

Return a table with formatted central, lower, upper for Lancet journal

format_means_df

Format multiple data.frame 'mean_*' columns for presentation (by data ...

format_nature_clu

Format central, lower, upper value triplets for Nature journal present...

format_nature_df

Return a table with formatted central, lower, upper for Nature journal

format_oxford_comma

Format vector of items with Oxford comma

fround_clu_triplet

Format and round central/lower/upper value sets by magnitude without u...

fround_count

Format and round count-ish number

fround_dtype_lancet

Format and round with data-type suffix

fround_dtype

Format and round with data-type suffix

fround_props

Format and round proportion-ish number

fround

Format and round

get_data_type_labels

Get data type labels

get_data_types

Get data types

get_dict_format

Get dictionary by name

get_dict_formats_names

Get all pre-assigned .dict_formats names

get_dict_formats

Get the package environment

get_style_item_by_data_type

Helper for format_means_df(), perhaps others

get_style_schema

Get style schema

get_style

Get a style from the styles dictionary

lock_some_bindings

Lock select bindings in the global environment

mid_dot

Mid-dot

new_style

Make a new style by args

process_clu_triplet_negatives

Prepare central, lower, upper value triplets for journal presentation

set_dict_format

Set dictionary by name

set_magnitude

Define magnitude, magnitude label and denominator for a vector of nume...

set_style

Set a new style by list

style_lancet

Lancet style schema

style_nature

Nature style schema

switch_strict

Wrapper for switch that errors helpfully if no match is found

thin_space

Thin space

Scientific journal numeric formatting policies implemented in code. Emphasis on formatting mean/upper/lower sets of values to pasteable text for journal submission. For example c(2e6, 1e6, 3e6) becomes "2.00 million (1.00--3.00)". Lancet and Nature have built-in styles for rounding and punctuation marks. Users may extend journal styles arbitrarily. Four metrics are supported; proportions, percentage points, counts and rates. Magnitudes for all metrics are discovered automatically.

  • Maintainer: Sam Byrne
  • License: MIT + file LICENSE
  • Last published: 2025-12-19