Learn R Programming

pcutils

pcutils is a package that contains some useful functions for me, it offers a range of utilities and functions for everyday programming tasks.

The HTML documentation of the latest version is available at Github page.

Installation

The stable version is available on CRAN:

install.packages("pcutils")

Or you can install the development version of pcutils from GitHub with:

# install.packages("devtools")
devtools::install_github("Asa12138/pcutils")

Little tools

  • lib_ps, del_ps can library or detach packages gracefully

  • dabiao print a message `dabiao("Message",char = "

Copy Link

Version

Install

install.packages('pcutils')

Monthly Downloads

495

Version

0.2.8

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Peng Chen

Last Published

March 27th, 2025

Functions in pcutils (0.2.8)

hebing

Group your data
generate_labels

Generate labels position
is.ggplot.color

Judge if a characteristic is Rcolor
my_circo

My circo plot
gghist

gg histogram
legend_size

Scale a legend size
get_legend2

Get a legend from a ggplot object
my_lm

Fit a linear model and plot
how_to_set_options

How to set options in a package
grepl.data.frame

Grepl applied on a data.frame
how_to_set_font_for_plot

How to set font for ggplot
little_guodong

My cat
lm_coefficients

Get coefficients of linear regression model
multireg

Multiple regression/ variance decomposition analysis
multitest

Multi-groups test
how_to_update_parameters

How to update parameters
how_to_use_parallel

How to use parallel
pcutils-package

pcutils: Some Useful Functions for Statistics and Visualization
distance2df

Convert a distance matrix to a data frame
df2link

df to link table
ggmosaic

ggmosaic for mosaic plot
make_py_pkg

Make a new python package
hebing2

Group your data
get_cols

Get n colors
plotpdf

Plot a multi-pages pdf
how_to_use_sbatch

How to use sbatch
gghuan

Plot a doughnut chart
prepare_package

Prepare a package
gghuan2

gghuan2 for multi-doughnut chart
igraph_translator

Translate text of igraph
my_sunburst

My Sunburst plot
my_treemap

My Treemap plot
read.file

Read some special format file
search_browse

Search and browse the web for specified terms
lib_ps

Attach packages or install packages have not benn installed
my_circle_packing

My Circle packing plot
my_cat

Show my little cat named Guo Dong which drawn by my girlfriend.
list_to_dataframe

Trans list (with NULL) to data.frame
gsub.data.frame

Gsub applied on a data.frame
guolv

Filter your data
read_fasta

Read fasta file
pre_number_str

Prepare a numeric string
ggplot_lim

Get a ggplot xlim and ylim
tax_pie

Pie plot
match_df

Match otutab and metadata
%>%

Pipe operator
trans

Trans format your data
tidai

Replace a vector by named vector
set_pcutils_config

Set config
venn

Plot a general venn (upset, flower)
update_param

Update the parameters
plotgif

Plot a gif
plot.coefficients

Plot coefficients as a bar chart or lollipop chart
rm_low

Remove the low relative items in each column
squash

Squash one column in a data.frame using other columns as id.
rgb2code

Transform a rgb vector to a Rcolor code
stackplot

Plot a stack plot
make_project

Make a R-analysis project
make_gitbook

Make a Gitbook using bookdown
metadata

test data for pcutils package
mmscale

Min_Max scale
taxonomy

test data for pcutils package
twotest

Two-group test
update_NEWS_md

Update the NEW.md for a package
remove.outliers

Remove outliers
show_pcutils_config

Show config
scale_color_pc

Scale a fill color
my_voronoi_treemap

My Voronoi treemap plot
otutab

test data for pcutils package
sample_map

Plot the sampling map
split_text

Split text into parts, each not exceeding a specified character count
sanxian

Three-line table
scale_fill_pc

Scale a fill color
t2

Transpose data.frame
strsplit2

Split Composite Names
write_fasta

Write a data.frame to fasta
trans_format

Transfer the format of file
translator

Translator
add_analysis

Add an analysis for a project
count2

Like uniq -c in shell to count a vector
add_theme

Add a global gg_theme and colors for plots
add_alpha

Add alpha for a Rcolor
copy_df

Copy a data.frame
copy_vector

Copy a vector
change_fac_lev

Change factor levels
china_map

Plot china map
dabiao

Print some message with =
check_directory_structure

Check if a directory structure matches the expected structure
download_ncbi_genome_file

Download genome files from NCBI based on accession number
del_ps

Detach packages
fittest

Fit a distribution
download2

Download File
explode

Explode a data.frame if there are split charter in one column
df2distance

Convert Three-column Data to Distance Matrix
group_box

Plot a boxplot
ggplot_translator

Translate axis label of a ggplot
group_test

Performs multiple mean comparisons for a data.frame