Package: roperators 1.4.0
roperators: Additional Operators to Help You Write Cleaner R Code
A set of additional operators and helper functions to make R code easier to read, write, and maintain. Includes string arithmetic (such as 'foo' + 'bar'), in-place reassignment operators (such as x += 1), logical operators that handle missing values, floating-point and strict ('JavaScript'-style) equality tests, 'between' operators, and 'SQL'-style pattern matching. Also provides convenience helpers for type conversion, operating-system checks, complete-cases statistics, and string manipulation, such as Oxford-comma pasting and extracting the first, last, n-th, or most common element of a vector or word in a string. The goal is to give R users, particularly those coming from other languages such as 'Python', a friendlier and more consistent syntax.
Authors:
roperators_1.4.0.tar.gz
roperators_1.4.0.zip(r-4.7)roperators_1.4.0.zip(r-4.6)roperators_1.4.0.zip(r-4.5)
roperators_1.4.0.tgz(r-4.6-any)roperators_1.4.0.tgz(r-4.5-any)
roperators_1.4.0.tar.gz(r-4.7-any)roperators_1.4.0.tar.gz(r-4.6-any)
roperators_1.4.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
card.svg |card.png
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
Pkgdown/docs site:https://benwiseman.github.io
Last updated from:c926a7e848. Checks:9 OK. Indexed: yes.
| Target | Result | Time | Files | Syslog |
|---|---|---|---|---|
| linux-devel-x86_64 | OK | 121 | ||
| source / vignettes | OK | 160 | ||
| linux-release-x86_64 | OK | 128 | ||
| macos-release-arm64 | OK | 90 | ||
| macos-oldrel-arm64 | OK | 117 | ||
| windows-devel | OK | 96 | ||
| windows-release | OK | 85 | ||
| windows-oldrel | OK | 110 | ||
| wasm-release | OK | 110 |
Exports:%-%%-=%%*=%%/=%%/0%%^=%%+-%%+%%+=%%<=%%<~%%==%%===%%><%%>=%%>=<%%>~%%~%%~=%%aon%%C%%else%%integrate%%log=%%na<-%%ni%%P%%perl%%regex<-%%regex=%%rlike%%root=%%s*%%s/%%xor%all_ccall_good_for_calcsany_bad_for_calcsany_ccas.classas.percentboolcat0catNcheck_ext_againstchrcolMeans_cccolSums_cccor_cccov_ccdblff.as.numericget_1stget_1st_wordget_lastget_last_wordget_latest_CRAN_versionget_most_frequentget_most_frequent_wordget_nthget_nth_wordget_osget_R_versionget_R_version_ageget_system_pythonintIQR_ccis_csv_fileis_excel_fileis_r_fileis_rda_fileis_rdata_fileis_rds_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:
Readme and manuals
Help Manual
| Help page | Topics |
|---|---|
| Fuzzy (case- and whitespace-insensitive) string equality | %~% |
| Inline fallback for expressions that might error | %else% |
| Assign a value to a vector's missing values | %na<-% |
| Assign to a vector only where a regular expression matches | %regex<-% |
| Modify an object in place by regular expression | %regex=% |
| Arithmetic convenience operators | %+-% %/0% arithmetic_sugar |
| Format a proportion as a percentage string | as.percent |
| Assignment (in-place modifier) operators | %*=% %+=% %-=% %/=% %log=% %root=% %^=% assign_ops |
| Choose and permute operators | %C% %P% choose_permute |
| Cleaner type-conversion functions | as.class bool chr dbl int num |
| Comparison operators with better missing-value handling | %<=% %==% %===% %><% %>=% %>=<% comparisons |
| Statistics/Summaries with (Only) Missing Data Removed | all_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 |
| Vector content checks | content_checks is.binary is.constant |
| String interpolation (f-strings for R) | f |
| Convert a factor with numeric labels into a numeric vector | f.as.numeric |
| File Extension Checks | check_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 |
| Get the first, last, n-th, or most frequent element or word | get_1st get_1st_word get_last get_last_word get_most_frequent get_most_frequent_word get_nth get_nth_word |
| Inline integration operator | %integrate% integrate |
| Load a package, installing it first if necessary | library.force require.force |
| Logical operators | %aon% %ni% %xor% logicals |
| Count the number of unique values | n_unique |
| Operating system and environment checks | get_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 |
| Paste and cat helpers | cat0 catN paste_ paste_and_cat paste_oxford paste_series |
| SQL-style pattern-matching operators | %perl% %rlike% pattern_matching |
| Read tab- or pipe-separated files | read.psv read.tsv |
| Sequence of evenly spaced points around an origin | seq_around |
| String arithmetic operators | %+% %-% %s*% %s/% string_arithmetic |
| Type checks | all_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 |
