Learn R Programming

⚠️There's a newer version (0.5.2) of this package.Take me there.

usefun

A set of miscellaneous functions that I have used in various projects and in other R packages. Some of the most important are:

  • get_roc_stats: the ROC statistics the way you want it!
  • normalize_to_range: normalize a vector to a specified range
  • get_percentage_of_matches: find the percentage of common elements between two vectors
  • pretty_print_*: pretty printing of vector names and values in an R Markdown document (as quotes)
  • outersect: find the non-common elements between two vectors (outer-section!)
  • ldf_arrange_by_rownames: rearrange a list of data frames by rownames
  • make_multiple_density_plot: plotting multiple density estimations in one plot

Install

CRAN version:

install.packages("usefun")

Development version:

devtools::install_github("bblodfon/usefun")

Examples

See examples in the functions documentation and in the respective tests. Also various functions from this package have been used in this biomarker analysis.

Copy Link

Version

Install

install.packages('usefun')

Monthly Downloads

346

Version

0.4.5

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

John Zobolas

Last Published

April 22nd, 2020

Functions in usefun (0.4.5)

get_percentage_of_matches

Get percentage of matches between two vectors
is_between

Is value between two others?
pretty_print_vector_values

Pretty printing of a vector's values
make_color_bar_plot

Make a color bar plot
print_empty_line

Print an empty line
get_roc_stats

Generate ROC statistics
ldf_arrange_by_rownames

Rearrange a list of data frames by rownames
get_stats_for_unique_values

Get stats for unique values
specify_decimal

Specify decimal
is_empty

Is object empty?
pretty_print_string

Pretty print a string
pretty_print_name_and_value

Pretty print a name and value
save_df_to_file

Save data frame to a specified file
save_mat_to_file

Save matrix to a specified file
save_vector_to_file

Save vector to a specified file
prune_columns_from_df

Prune single-value columns from a data frame
get_common_values

Get the common values of two vectors
get_parent_dir

Retrieve the parent directory
make_multiple_density_plot

Multiple densities plot
prune_rows_from_df

Prune single-value rows from a data frame
get_ternary_class_id

Get ternary class id
usefun

usefun
remove_commented_and_empty_lines

Remove commented and empty lines
mat_equal

Matrix equality
pretty_print_bold_string

Pretty print a bold string
plot_string_to_file

Plot string to output format
pretty_print_vector_names

Pretty printing of a vector's names attribute
pretty_print_vector_names_and_values

Pretty printing of a vector's names and values
get_common_names

Get the common names of two vectors
add_row_to_ternary_df

Add a row to a 3-valued (ternary) data.frame
add_vector_to_df

Add vector to a (n x 2) data frame
binarize_to_thres

Binarize matrix to given threshold
normalize_to_range

Range normalization
outersect

Outersect
prune_and_reorder_vector

Prune and reorder vector elements