Re: [R] losing variable attributes when subsetting model.frame

2024-05-08 Thread Vito Muggeo via R-help
dear Duncan, Thank you very much for your quick reply. Very useful and also very elegant, I would add. Thanks again, kind regards, Vito Il 08/05/2024 14:06, Duncan Murdoch ha scritto: I would guess that subsetting uses [] indexing on each column, with a logical argument.  If that is true,

Re: [R] losing variable attributes when subsetting model.frame

2024-05-08 Thread Duncan Murdoch
On 08/05/2024 7:47 a.m., Vito Muggeo via R-help wrote: dear all, I have a simple function f() which, when included in model.frame() via the formula, returns the variable itself with some attributes. However when I specify the subset argument, the attributes get lost, apparently. I would like to

[R] losing variable attributes when subsetting model.frame

2024-05-08 Thread Vito Muggeo via R-help
dear all, I have a simple function f() which, when included in model.frame() via the formula, returns the variable itself with some attributes. However when I specify the subset argument, the attributes get lost, apparently. I would like to extract the attributes also when specifying the