Skip to content

Commit 7d850a7

Browse files
committed
fix for CRAN checks
1 parent 9648d1f commit 7d850a7

File tree

4 files changed

+83
-180
lines changed

4 files changed

+83
-180
lines changed

NEWS.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
- Bug fix: addressed [#251](https://github.com/ices-tools-dev/RDBEScore/issues/251).
44
- Docs/params: expanded docs for `combineRDBESDataObjects()` and `createRDBESDataObject()`; clarified hierarchy behavior and `...` options (strict, verbose, hierarchy).
55
- Mixed hierarchies: `combineRDBESDataObjects()` now warns/errors when objects use different hierarchies (`strict=TRUE` for error).
6-
- Estimation: major refactor of `doEstimationRatio()` — stronger validation, hierarchy‑specific logic (A/B/C), standardized names (e.g., `BVweight`), clearer messages; uses `data.table`.
76
- ID tables: `createTableOfRDBESIds()` merging more robust by hierarchy; clearer BV handling and console output.
87

98
# RDBEScore 0.3.4

R/createTableOfRDBESIds.r

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@
2121

2222
createTableOfRDBESIds<-function(x, addSAseqNums=TRUE){
2323

24+
# Avoid R CMD check notes for data.table's NSE column references
25+
SAlowHierarchy <- SAid <- NULL
26+
2427
# note: needs developments for different lower hierarchies
2528

2629
# x is x
2730
# hierarchy is hierarchy (integer)
2831
# outputs a table with ids for matching
2932

30-
#libraries
31-
require(data.table)
33+
# data.table is listed in Imports and loaded via NAMESPACE; avoid require/library in package code
3234

3335
CStableNames<- getTablesInRDBESHierarchy(hierarchy = x$DE$DEhierarchy[1],
3436
includeOptTables = FALSE,
@@ -46,7 +48,7 @@ createTableOfRDBESIds<-function(x, addSAseqNums=TRUE){
4648
df_1<-data.frame(x[[CStableNames[i]]][,list(get(id_1))]); colnames(df_1)<-id_1
4749
}
4850

49-
if((CStableNames[i+1] == "SA" & addSAseqNums == TRUE) | CStableNames[i+1] %in% c("BV")){
51+
if(((CStableNames[i+1] == "SA" && addSAseqNums == TRUE) || CStableNames[i+1] %in% c("BV"))){
5052

5153
if(CStableNames[i+1]=="SA"){
5254

@@ -84,10 +86,10 @@ createTableOfRDBESIds<-function(x, addSAseqNums=TRUE){
8486
outTmp = merge(out, x$SA[,c("SAid","SAlowHierarchy")])
8587

8688
# Convert to data.table if not already
87-
setDT(outTmp)
88-
setDT(out)
89-
setDT(df_2)
90-
setDT(df_2C)
89+
data.table::setDT(outTmp)
90+
data.table::setDT(out)
91+
data.table::setDT(df_2)
92+
data.table::setDT(df_2C)
9193

9294
# Filter and get SAid groups
9395
keepA <- outTmp[SAlowHierarchy == "A", SAid]
@@ -108,7 +110,7 @@ createTableOfRDBESIds<-function(x, addSAseqNums=TRUE){
108110
mergedD <- toMergeD # unchanged group D
109111

110112
# Combine back
111-
out <- rbindlist(list(mergedA, mergedB, mergedC, mergedD), use.names = TRUE, fill = TRUE)
113+
out <- data.table::rbindlist(list(mergedA, mergedB, mergedC, mergedD), use.names = TRUE, fill = TRUE)
112114

113115
}else{
114116

0 commit comments

Comments
 (0)