This is an R
package with personal tools and functions.
Because this package is not available on CRAN, to install it, first install the devtools
package using install.packages("devtools")
, followed by the function devtools::install_github("jrosen48/jmRtools")
. After installing the package, use library(jmRtools)
to load it in each session.
convert_log_odds(vec)
wherevec
is a vector of values in log odds units, to be converted into oddsconvert_odds(vec)
wherevec
is a vector of values in odds units, to be converted into probabilitiesfix_missing(vec, missing_val)
wherevec
is avector
, andmissing_val
is acharacter
or number (i.e., a scalar of
numericor
integertype); this returns a
vectorwith
missing_valvalues replaced with
NA` (adapted from Wickham's Advanced R)l_unique(vec)
wherevec
is avector
; returns the number of unique valuescomposite_matrix_maker(df, ...)
wheredf
is adata.frame
, and...
are any number of columns evaluated using non-standard evaluation (so use unquoted column names); amatrix
with the columns specified is returnedcomposite_mean_maker(df, ...)
wheredf
is adata.frame
, and...
are any number of columns evaluated using non-standard evaluation (so use unquoted column names); avector
with the mean of the columns specified is returnedcomposite_stat_maker(df, ...)
wheredf
is adata.frame
, and...
are any number of columns evaluated using non-standard evaluation (so use unquoted column names); acharacter
scalar is returned with M(SD), Cronbach's alpha, and split-half reliability.to_compare(network1, network2, to_combine = F)
wherenetwork1
andnetwork2
aredata.frame
s withrow.names
andnames
for the two modes (or matrices withrow.names
andcol.names
for the two modes) representing two-mode adjacency matrices; modified networks with structural zeroes added for therow.names
ornames
not present in the other;to_combine
(optional) adds together the networkscenter_vector(v)
center the values in the vectorv
to have mean = 0scale_vector(v)
standardize the values in the vectorv
to have SD = 1center_and_scale_vector(v)
center and standardize the values in the vectorv
to have mean = 0 and SD = 1t_tester()
takes thedv
(for the dependent variable),fac
(for the factor), anddf
(for the data frame) using raw (unquoted) variable names. Returns the test statistic, p-value, and effect size.tidy_t_test()
a simple wrapper aroundt.test()
with thebroom::tidy()
function around it