Package: roperators 1.3.14

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, === equivalent, 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.3.14.tar.gz
roperators_1.3.14.zip(r-4.5)roperators_1.3.14.zip(r-4.4)roperators_1.3.14.zip(r-4.3)
roperators_1.3.14.tgz(r-4.5-any)roperators_1.3.14.tgz(r-4.4-any)roperators_1.3.14.tgz(r-4.3-any)
roperators_1.3.14.tar.gz(r-4.5-noble)roperators_1.3.14.tar.gz(r-4.4-noble)
roperators_1.3.14.tgz(r-4.4-emscripten)roperators_1.3.14.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'))

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

On CRAN:

5.77 score 4 stars 2 packages 49 scripts 716 downloads 119 exports 0 dependencies

Last updated 20 days agofrom:43834899ff. Checks:8 OK. Indexed: yes.

TargetResultLatest binary
Doc / VignettesOKJan 30 2025
R-4.5-winOKJan 30 2025
R-4.5-macOKJan 30 2025
R-4.5-linuxOKJan 30 2025
R-4.4-winOKJan 30 2025
R-4.4-macOKJan 30 2025
R-4.3-winOKJan 30 2025
R-4.3-macOKJan 30 2025

Exports:%-%%-=%%*=%%/=%%^=%%+%%+=%%<=%%<~%%==%%===%%><%%>=%%>=<%%>~%%~=%%aon%%C%%integrate%%log=%%na<-%%ni%%P%%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_latest_CRAN_versionget_most_frequentget_most_frequent_wordget_nthget_nth_wordget_osget_R_versionget_R_version_ageintIQR_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.http_availableis.irregular_listis.list_or_nullis.logical_or_nullis.null_or_nais.numeric_or_nullis.os_armis.os_lnxis.os_macis.os_unxis.os_winis.os_x64is.R_revois.R_x64is.RStudiois.scalaris.scalar_or_nulllength_cclibrary.forcemad_ccmax_ccmean_ccmedian_ccmin_ccn_uniquenumpaste_paste_oxfordpaste_seriesprod_ccquantile_ccrange_ccread.psvread.tsvrequire.forcerowMeans_ccrowSums_ccsd_ccseq_aroundsum_ccvar_ccweighted.mean_cc

Dependencies:

Make your R code nicer with roperators

Rendered fromnicer_roperators.Rmdusingknitr::rmarkdownon Jan 30 2025.

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
Choose and permute%C% %P% choose_permute
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 comparison operators%<~% %>~% %~=% floating_point_comparisons
Little functions to replace common minor functions. useful in apply sttementsget_1st get_1st_word get_last get_last_word get_most_frequent get_most_frequent_word get_nth get_nth_word n_unique seq_around
Inline integration%integrate% integrate
loads package if available, else tries to install it (from CRAN by default)library.force require.force
Logical operators%aon% %ni% %perl% %rlike% %xor% logicals
Operating system checksget_latest_CRAN_version get_os get_R_version get_R_version_age get_system_python is.http_available is.os_arm 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
like read.csv, but for tsv and default header = TRUEread.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