Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a54cf4b
start vignettes
jmbarbone Mar 30, 2022
6f6050f
start vignette on facts
jmbarbone Mar 30, 2022
2133dce
start table with differences
jmbarbone Apr 1, 2022
b6d96ef
mention s3 methods
jmbarbone Apr 1, 2022
e7aeba6
show some examples
jmbarbone Apr 1, 2022
48bf642
Merge branch 'main' into 91-facts
jmbarbone Apr 7, 2022
7e22f16
formatting and more notes
jmbarbone Apr 8, 2022
546f64e
add namespace checks to vignette
jmbarbone May 28, 2022
e323562
Merge branch 'main' into 91-facts
jmbarbone Jun 19, 2022
4cbbfe5
resolves #119
jmbarbone Jun 21, 2022
305301c
add notes on S3 methods
jmbarbone Jun 21, 2022
c21e2cc
[#91] Merge branch 'main' into 91-facts
jmbarbone Oct 17, 2022
b4d9f7f
[#91] facts as reexports
jmbarbone Oct 17, 2022
4600877
[#91] use remotes for dev
jmbarbone Oct 17, 2022
03834d6
[#91] redoc
jmbarbone Oct 17, 2022
9bdc317
[#91] reexport pseudo_id
jmbarbone Oct 17, 2022
e8e4f64
[#91] redoc
jmbarbone Oct 17, 2022
ba3dce7
[#91] actually reexport
jmbarbone Oct 17, 2022
4f351ee
[#91] redoc
jmbarbone Oct 17, 2022
1dd6044
[#91] move reexports to single file
jmbarbone Oct 17, 2022
92766f6
[#91] maybe actually reexport
jmbarbone Oct 17, 2022
10e98ce
[#91] remove tests for {facts}
jmbarbone Oct 31, 2022
753c105
[#91] uniques to values
jmbarbone Oct 31, 2022
5ba13cb
[#91] na_last() from {facts}
jmbarbone Oct 31, 2022
263f9fd
bring in updates (#91)
jmbarbone May 16, 2026
cf6cf43
Merge branch 'main' into 91-facts
jmbarbone May 16, 2026
dbf48e1
redocs (#91)
jmbarbone May 16, 2026
ebf9c4a
some updates (#91)
jmbarbone Jun 20, 2026
9cf5cc9
some updates (#91)
jmbarbone Jun 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ revdep
^\.lintr$
^\.git$
^air\.toml$
^\.positai$
^\.claude$
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ revdep/checks/libraries.csv
revdep/data.sqlite
tests/testthat/Rplots.pdf
docs
.positai
10 changes: 7 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ Depends:
Imports:
cli,
cnd,
facts,
fs (>= 0.2.0),
fuj,
generics,
magrittr (>= 2.0.1),
rlang,
stats (>= 3.6),
Expand All @@ -48,6 +50,7 @@ Suggests:
knitr (>= 1.30),
nanoparquet,
rcmdcheck (>= 1.3.3),
rmarkdown,
stringi (>= 1.5.3),
spelling (>= 2.2),
testthat (>= 3.0.0),
Expand All @@ -57,9 +60,9 @@ Suggests:
xopen,
yaml (>= 2.3.9),
Remotes:
github::jmbarbone/facts,
github::jmbarbone/cnd@v0.1.1.9002,
github::jmbarbone/fuj@v0.2.2.9010
RoxygenNote: 7.3.3
github::jmbarbone/fuj@105-defaults
Roxygen: list(markdown = TRUE)
Config/testthat/edition: 3
Config/testthat/parallel: true
Expand All @@ -86,7 +89,6 @@ Collate:
'directory.R'
'environments.R'
'expand.R'
'fact.R'
'fct-expand-seq.R'
'file.R'
'fizzbuzz.R'
Expand Down Expand Up @@ -122,6 +124,7 @@ Collate:
'recode.R'
'reexports-fuj.R'
'reexports-magrittr.R'
'rexports-facts.R'
'round-by.R'
'round.R'
'row-bind.R'
Expand All @@ -140,3 +143,4 @@ Collate:
'within.R'
'write.R'
'zzz.R'
Config/roxygen2/version: 8.0.0
26 changes: 1 addition & 25 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
# Generated by roxygen2: do not edit by hand

S3method("[",fact)
S3method(append0,data.frame)
S3method(append0,default)
S3method(append0,list)
S3method(as.Date,fact)
S3method(as.character,fact)
S3method(as.double,fact)
S3method(as.integer,fact)
S3method(as_ordered,default)
S3method(assign_labels,data.frame)
S3method(assign_labels,default)
S3method(char2fact,character)
Expand All @@ -23,20 +17,6 @@ S3method(depth,default)
S3method(depth,list)
S3method(detail,data.frame)
S3method(detail,default)
S3method(drop_levels,data.frame)
S3method(drop_levels,fact)
S3method(drop_levels,factor)
S3method(fact,Date)
S3method(fact,POSIXt)
S3method(fact,character)
S3method(fact,default)
S3method(fact,fact)
S3method(fact,factor)
S3method(fact,haven_labelled)
S3method(fact,integer)
S3method(fact,logical)
S3method(fact,numeric)
S3method(fact,pseudo_id)
S3method(get_labels,data.frame)
S3method(get_labels,default)
S3method(is_false,default)
Expand All @@ -46,7 +26,6 @@ S3method(is_true,logical)
S3method(normalize,data.frame)
S3method(normalize,default)
S3method(print,diff_time)
S3method(print,fact)
S3method(print,has_catch)
S3method(print,mark_bib_df)
S3method(print,mark_bib_entry)
Expand Down Expand Up @@ -74,7 +53,6 @@ S3method(to_boolean,factor)
S3method(to_boolean,integer)
S3method(to_boolean,logical)
S3method(to_boolean,numeric)
S3method(unique,fact)
S3method(write_clipboard,data.frame)
S3method(write_clipboard,default)
S3method(write_clipboard,list)
Expand Down Expand Up @@ -103,7 +81,6 @@ export(add_file_timestamp)
export(any_match)
export(are_identical)
export(array_extract)
export(as_ordered)
export(assign_labels)
export(base_alpha)
export(base_n)
Expand All @@ -130,15 +107,13 @@ export(diff_time_secs)
export(diff_time_weeks)
export(diff_time_wyears)
export(diff_time_years)
export(drop_levels)
export(either)
export(environments)
export(ept)
export(eval_named_chunk)
export(expand_by)
export(fact)
export(fact2char)
export(fact_na)
export(fct_expand_seq)
export(file_copy_md5)
export(file_name)
Expand Down Expand Up @@ -303,6 +278,7 @@ importFrom(cnd,input_error)
importFrom(cnd,input_warning)
importFrom(cnd,type_error)
importFrom(cnd,value_error)
importFrom(facts,fact)
importFrom(fuj,"%::%")
importFrom(fuj,"%:::%")
importFrom(fuj,"%colons%")
Expand Down
4 changes: 2 additions & 2 deletions R/char2fact.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
#' @rdname char2fact
#' @export
char2fact.character <- function(x, n = 5) {
id <- pseudo_id(x)
fct <- factor(x)

Check warning on line 23 in R/char2fact.R

View workflow job for this annotation

GitHub Actions / lint

file=R/char2fact.R,line=23,col=3,[object_usage_linter] local variable 'fct' assigned but may not be used

if (length(.uniques(id)) <= n) {
if (length(attr(id, "uniques")) <= n) {

Check warning on line 25 in R/char2fact.R

View workflow job for this annotation

GitHub Actions / lint

file=R/char2fact.R,line=25,col=19,[object_usage_linter] no visible binding for global variable 'id'
x <- fact(id)

Check warning on line 26 in R/char2fact.R

View workflow job for this annotation

GitHub Actions / lint

file=R/char2fact.R,line=26,col=15,[object_usage_linter] no visible binding for global variable 'id'
}

x
Expand Down
5 changes: 3 additions & 2 deletions R/counts.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ counts <- function(x, ...) {
#' @export
counts.default <- function(x, sort = FALSE, ...) {
x <- pseudo_id(x)
u <- .uniques(x)
u <- attr(x, "uniques")
out <- tabulate(x, length(u))
names(out) <- na_last(u)
nas <- is.na(u)
names(out) <- c(u[!nas], u[nas])

if (sort) {
return(sort_names(out, numeric = is.numeric(x)))
Expand Down
Loading
Loading