Re: [R] R CMD check says no visible binding for global variable

2025-01-28 Thread Naresh Gurbuxani
While my problem is solved, if not elegantly, data.table is widely used in packages. Any package builders using data.table who have encountered and solved this problem? Sent from my iPhone > On Jan 28, 2025, at 4:52 PM, avi.e.gr...@gmail.com wrote: > > That is an interesting fix Duncan sug

Re: [R] R CMD check says no visible binding for global variable

2025-01-28 Thread Uwe Ligges
On 28.01.2025 22:52, avi.e.gr...@gmail.com wrote: That is an interesting fix Duncan suggested and it sounds now like everything WORKED as intended in data.table except that any checker being used externally is not able to del with things that look like a variable but are actually not a varia

Re: [R] R CMD check says no visible binding for global variable

2025-01-28 Thread avi.e.gross
That is an interesting fix Duncan suggested and it sounds now like everything WORKED as intended in data.table except that any checker being used externally is not able to del with things that look like a variable but are actually not a variable currently visible except within a function that is

Re: [R] R CMD check says no visible binding for global variable

2025-01-28 Thread avi.e.gross
Naresh, I think your details suggest your earlier request was not well defined. Your problem looks like this line of code was wrong and did something you did not expect. It should be easy to fix. But I note you changed Prices to use the data.table package. Mind you, I thought the function

Re: [R] R CMD check says no visible binding for global variable

2025-01-28 Thread Naresh Gurbuxani
This solution worked. Thanks Sent from my iPhone > On Jan 28, 2025, at 3:09 PM, Duncan Murdoch wrote: > > On 2025-01-28 1:55 p.m., Naresh Gurbuxani wrote: >> Data.frame is returned by SQL query. It does have column names. In the >> function, I make small changes to some columns. >> Somethin

Re: [R] R CMD check says no visible binding for global variable

2025-01-28 Thread Duncan Murdoch
On 2025-01-28 1:55 p.m., Naresh Gurbuxani wrote: Data.frame is returned by SQL query. It does have column names. In the function, I make small changes to some columns. Something like: Myquery <- “SELECT date, price, stock FROM stocktab WHERE stock = ‘ABC’ AND date > ‘2025-01-01’;” Prices <

Re: [R] R CMD check says no visible binding for global variable

2025-01-28 Thread Naresh Gurbuxani
Data.frame is returned by SQL query. It does have column names. In the function, I make small changes to some columns. Something like: Myquery <- “SELECT date, price, stock FROM stocktab WHERE stock = ‘ABC’ AND date > ‘2025-01-01’;” Prices <- dbGetQuery(con, myquery) SetDT(Prices) Prices[, d