Package: roperators 1.2.0.9000

Ben Wiseman

roperators: Additional Operators to Help you Write Cleaner R Code

Provides string arithmetic, reassignment operators, logical operators that handle missing values, and extra logical operators such as floating point equality and all or nothing. The intent is to allow R users to write code that is easier to read, write, and maintain while providing a friendlier experience to new R users from other language backgrounds (such as 'Python') who are used to concepts such as x += 1 and 'foo' + 'bar'. Includes operators for not in, easy floating point comparisons, === equivilent, and SQL-like like operations (), etc. We also added in some extra helper functions, such as OS checks, pasting in Oxford comma format, and functions to get the first, last, nth, or most common element of a vector or word in a string.

Authors:Ben Wiseman [cre, aut, ccp], Steven Nydick [aut, ccp], Jeff Jones [aut, led]

roperators_1.2.0.9000.tar.gz
roperators_1.2.0.9000.zip(r-4.5)roperators_1.2.0.9000.zip(r-4.4)roperators_1.2.0.9000.zip(r-4.3)
roperators_1.2.0.9000.tgz(r-4.4-any)roperators_1.2.0.9000.tgz(r-4.3-any)
roperators_1.2.0.9000.tar.gz(r-4.5-noble)roperators_1.2.0.9000.tar.gz(r-4.4-noble)
roperators_1.2.0.9000.tgz(r-4.4-emscripten)roperators_1.2.0.9000.tgz(r-4.3-emscripten)
roperators.pdf |roperators.html
roperators/json (API)
NEWS

# Install 'roperators' in R:
install.packages('roperators', repos = c('https://benwiseman.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/benwiseman/roperators/issues

On CRAN:

109 exports 4 stars 1.72 score 0 dependencies 3 dependents 52 scripts 561 downloads

Last updated 2 years agofrom:316e58b07f. Checks:OK: 1 WARNING: 6. Indexed: yes.

TargetResultDate
Doc / VignettesOKAug 23 2024
R-4.5-winWARNINGAug 23 2024
R-4.5-linuxWARNINGAug 23 2024
R-4.4-winWARNINGAug 23 2024
R-4.4-macWARNINGAug 23 2024
R-4.3-winWARNINGAug 23 2024
R-4.3-macWARNINGAug 23 2024

Exports:%-%%-=%%*=%%/=%%^=%%+%%+=%%<=%%<~%%==%%===%%><%%>=%%>=<%%>~%%~=%%aon%%log=%%na<-%%ni%%perl%%regex<-%%regex=%%rlike%%root=%%s*%%s/%%xor%all_ccall_good_for_calcsany_bad_for_calcsany_ccas.classboolcat0catNcheck_ext_againstchrcolMeans_cccolSums_cccor_cccov_ccdblf.as.numericget_1stget_1st_wordget_lastget_last_wordget_most_frequentget_most_frequent_wordget_nthget_nth_wordget_osintIQR_ccis_csv_fileis_excel_fileis_r_fileis_rdata_fileis_spss_fileis_txt_fileis.atomic_nanis.bad_and_equalis.bad_for_calcsis.bad_for_indexingis.binaryis.character_or_nullis.constantis.df_or_nullis.good_for_calcsis.good_for_indexingis.irregular_listis.list_or_nullis.logical_or_nullis.null_or_nais.numeric_or_nullis.os_lnxis.os_macis.os_unxis.os_winis.os_x64is.R_revois.R_x64is.RStudiois.scalaris.scalar_or_nulllength_ccmad_ccmax_ccmean_ccmedian_ccmin_ccn_uniquenumpaste_paste_oxfordpaste_seriesprod_ccquantile_ccrange_ccread.psvread.tsvrowMeans_ccrowSums_ccsd_ccsort_factorsum_ccvar_ccweighted.mean_cc

Dependencies:

Make your R code nicer with roperators

Rendered fromnicer_roperators.Rmdusingknitr::rmarkdownon Aug 23 2024.

Last update: 2022-02-10
Started: 2022-02-10

Readme and manuals

Help Manual

Help pageTopics
Assign Value to a Vector's Missing Values%na<-%
Assign to Vector Only Where Regular Expression is Matched%regex<-%
Modify Existing Object by Regular Expression%regex=%
Assignment Operators%*=% %+=% %-=% %/=% %log=% %root=% %^=% assign_ops
Cleaner Conversion Functionsas.class bool chr dbl int num
Enhanced Comparisons%<=% %==% %===% %><% %>=% %>=<% comparisons
Statistics/Summaries with (Only) Missing Data Removedall_cc any_cc colMeans_cc colSums_cc complete_cases cor_cc cov_cc IQR_cc length_cc mad_cc max_cc mean_cc median_cc min_cc n_unique_cc prod_cc quantile_cc range_cc rowMeans_cc rowSums_cc sd_cc sum_cc var_cc weighted.mean_cc
Contents of Vector Checkscontent_checks is.binary is.constant
Convert Factor with Numeric Labels into Numeric Vectorf.as.numeric
File Extension Checkscheck_ext_against file_checks is_csv_file is_excel_file is_rdata_file is_rda_file is_rds_file is_r_file is_spss_file is_txt_file
Floating Point Comparisons%<~% %>~% %~=% floating_point_comparisons
Get Parts from Vectorsget_1st get_1st_word get_last get_last_word get_most_frequent get_most_frequent_word get_nth get_nth_word n_unique
Logical Operators%aon% %ni% %perl% %rlike% %xor% logicals
Operating System Checksget_os is.os_lnx is.os_mac is.os_unx is.os_win is.os_x64 is.RStudio is.R_revo is.R_x64 os
New Paste and Cat Rulescat0 catN paste_ paste_and_cat paste_oxford paste_series
Read TSV Filesread.psv read.tsv
String Operators%+% %-% %s*% %s/% string_arithmetic
Type Checksall_good_for_calcs any_bad_for_calcs is.atomic_nan is.bad_and_equal is.bad_for_calcs is.bad_for_indexing is.character_or_null is.df_or_null is.good_for_calcs is.good_for_indexing is.irregular_list is.list_or_null is.logical_or_null is.null_or_na is.numeric_or_null is.scalar is.scalar_or_null type_checks