Hello,
I am looking for some advice on how to select subsets of variables for
imputing when using the mice package.
From Van Buuren's original mice paper, I see that selecting variables to be
'skipped' in an imputation can be written as:
ini <- mice(nhanes2, maxit = 0, print = FALSE)
pred <- ini$pred
pred[, "bmi"] <- 0
meth <- ini$meth
meth["bmi"] <- ""
With the last two lines specifying the the "bmi" variable gets skipped over
and not imputed.
And I have come across other examples, but all that I have seen lay out a
method of skipping variables where EVERY variable is named (as "bmi" is
named above). I am wondering if there is a reasonably easy way to select
out approximately 30 variables for imputation from a larger dataset with
around 2500 variables, without having to name all 2450+ other variables.
Thank you,
Ian
If I understand your query correctly, you can use negative indexing to
omit variables. See ?'[' for details.
dat <- data.frame (a = 1:3, b = letters[1:3], c = 4:6, d = letters[5:7])
dat
a b c d
1 1 a 4 e
2 2 b 5 f
3 3 c 6 g
dat[,-c(2,4)]
a c
1 1 4
2 2 5
3 3 6
Of course you have to know the numerical index of the columns you wish
to omit, but somethingh of the sort seems unavoidable in any case.
Cheers,
Bert
On Thu, Jul 14, 2022 at 11:00 AM Ian McPhail <ivmcphail at gmail.com> wrote:
Hello,
I am looking for some advice on how to select subsets of variables for
imputing when using the mice package.
From Van Buuren's original mice paper, I see that selecting variables to be
'skipped' in an imputation can be written as:
ini <- mice(nhanes2, maxit = 0, print = FALSE)
pred <- ini$pred
pred[, "bmi"] <- 0
meth <- ini$meth
meth["bmi"] <- ""
With the last two lines specifying the the "bmi" variable gets skipped over
and not imputed.
And I have come across other examples, but all that I have seen lay out a
method of skipping variables where EVERY variable is named (as "bmi" is
named above). I am wondering if there is a reasonably easy way to select
out approximately 30 variables for imputation from a larger dataset with
around 2500 variables, without having to name all 2450+ other variables.
Thank you,
Ian
[[alternative HTML version deleted]]
Maybe this is too simple but could you use the select() function from dplyr?
Tim
-----Original Message-----
From: R-help <r-help-bounces at r-project.org> On Behalf Of Bert Gunter
Sent: Thursday, July 14, 2022 2:10 PM
To: Ian McPhail <ivmcphail at gmail.com>
Cc: R-help <r-help at r-project.org>
Subject: Re: [R] mice: selecting small subset of variables to impute from dataset with many variables (> 2500)
[External Email]
If I understand your query correctly, you can use negative indexing to omit variables. See ?'[' for details.
dat <- data.frame (a = 1:3, b = letters[1:3], c = 4:6, d =
letters[5:7]) dat
a b c d
1 1 a 4 e
2 2 b 5 f
3 3 c 6 g
dat[,-c(2,4)]
a c
1 1 4
2 2 5
3 3 6
Of course you have to know the numerical index of the columns you wish to omit, but somethingh of the sort seems unavoidable in any case.
Cheers,
Bert
On Thu, Jul 14, 2022 at 11:00 AM Ian McPhail <ivmcphail at gmail.com> wrote:
Hello,
I am looking for some advice on how to select subsets of variables for
imputing when using the mice package.
From Van Buuren's original mice paper, I see that selecting variables
to be 'skipped' in an imputation can be written as:
ini <- mice(nhanes2, maxit = 0, print = FALSE) pred <- ini$pred pred[,
"bmi"] <- 0 meth <- ini$meth meth["bmi"] <- ""
With the last two lines specifying the the "bmi" variable gets skipped
over and not imputed.
And I have come across other examples, but all that I have seen lay
out a method of skipping variables where EVERY variable is named (as
"bmi" is named above). I am wondering if there is a reasonably easy
way to select out approximately 30 variables for imputation from a
larger dataset with around 2500 variables, without having to name all 2450+ other variables.
Thank you,
Ian
[[alternative HTML version deleted]]
______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mail
man_listinfo_r-2Dhelp&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAs
Rzsn7AkP-g&m=UxEz20f8LSF-iyVuq17UnoNVkEe6HoC3E6vHWssLjSBKtqLSrm7qs8v2e
wcXchwc&s=ABj_L_b515lhH7RIgTmmjylyWxJCbRWvzZDkxUkGw90&e=
PLEASE do read the posting guide
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.or
g_posting-2Dguide.html&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeA
sRzsn7AkP-g&m=UxEz20f8LSF-iyVuq17UnoNVkEe6HoC3E6vHWssLjSBKtqLSrm7qs8v2
ewcXchwc&s=LiocKPLYgq5olAT6tqGjr2xOLwDWw55DRzhuq7gcF5A&e=
and provide commented, minimal, self-contained, reproducible code.
______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dhelp&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAsRzsn7AkP-g&m=UxEz20f8LSF-iyVuq17UnoNVkEe6HoC3E6vHWssLjSBKtqLSrm7qs8v2ewcXchwc&s=ABj_L_b515lhH7RIgTmmjylyWxJCbRWvzZDkxUkGw90&e=
PLEASE do read the posting guide https://urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.org_posting-2Dguide.html&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAsRzsn7AkP-g&m=UxEz20f8LSF-iyVuq17UnoNVkEe6HoC3E6vHWssLjSBKtqLSrm7qs8v2ewcXchwc&s=LiocKPLYgq5olAT6tqGjr2xOLwDWw55DRzhuq7gcF5A&e=
and provide commented, minimal, self-contained, reproducible code.
Hello,
You can use mice() argument predictorMatrix to tell mice() which
variables/blocks are used when imputing which column. If the column
vector is set to zeros, no column or block will used in its imputation.
library(mice)
predmat <- matrix(1L, ncol(nhanes2), ncol(nhanes2),
dimnames = list(names(nhanes2), names(nhanes2)))
diag(predmat) <- 0L
predmat[, "bmi"] <- 0L
predmat
#> age bmi hyp chl
#> age 0 0 1 1
#> bmi 1 0 1 1
#> hyp 1 0 0 1
#> chl 1 0 1 0
Then use argument where to skip the variables you do not want imputed.
Note that this is not the same as not being imputed according to
variables shown above as rownames of predmat.
The default of where is the matrix is.na(nhanes2) so make a copy of this
matrix then set column "bmi" to FALSE. Then call mice().
predmat <- matrix(1L, ncol(nhanes2), ncol(nhanes2),
dimnames = list(names(nhanes2), names(nhanes2)))
diag(predmat) <- 0L
predmat[, "bmi"] <- 0L
predmat
#> age bmi hyp chl
#> age 0 0 1 1
#> bmi 1 0 1 1
#> hyp 1 0 0 1
#> chl 1 0 1 0
not_bmi <- is.na(nhanes2)
not_bmi[, "bmi"] <- FALSE
ini_all <- mice(nhanes2, print = FALSE)
ini_bmi <- mice(nhanes2,
predictorMatrix = predmat,
where = not_bmi,
print = FALSE)
cmpl_all <- complete(ini_all)
head(cmpl_all)
#> age bmi hyp chl
#> 1 20-39 28.7 no 187
#> 2 40-59 22.7 no 187
#> 3 20-39 30.1 no 187
#> 4 60-99 27.5 yes 284
#> 5 20-39 20.4 no 113
#> 6 60-99 20.4 no 184
cmpl_bmi <- complete(ini_bmi)
head(cmpl_bmi)
#> age bmi hyp chl
#> 1 20-39 NA no 187
#> 2 40-59 22.7 no 187
#> 3 20-39 NA no 187
#> 4 60-99 NA yes 206
#> 5 20-39 20.4 no 113
#> 6 60-99 NA yes 184
Hope this helps,
Rui Barradas
?s 18:59 de 14/07/2022, Ian McPhail escreveu:
Hello,
I am looking for some advice on how to select subsets of variables for
imputing when using the mice package.
From Van Buuren's original mice paper, I see that selecting variables to be
'skipped' in an imputation can be written as:
ini <- mice(nhanes2, maxit = 0, print = FALSE)
pred <- ini$pred
pred[, "bmi"] <- 0
meth <- ini$meth
meth["bmi"] <- ""
With the last two lines specifying the the "bmi" variable gets skipped over
and not imputed.
And I have come across other examples, but all that I have seen lay out a
method of skipping variables where EVERY variable is named (as "bmi" is
named above). I am wondering if there is a reasonably easy way to select
out approximately 30 variables for imputation from a larger dataset with
around 2500 variables, without having to name all 2450+ other variables.
Thank you,
Ian
[[alternative HTML version deleted]]
Tim,
Your reply is reasonable if you want to read in EVERYTHING and use various
nice features of the select() function in the dplyr package of the tidyverse
that let you exclude a bunch of columns based on names starting or ending or
containing various characters or not being of type integer and so on.
But another category wants to skip creating some columns in the first place.
Many reader functions that take in data from something like a .CSV file will
allow you to effectively ignore some of the columns of data and thus
hopefully cut down on some overhead.
I assume most of us have no real experience with the package called "mice"
and who is willing to read to page 72 or so in this document:
https://cran.r-project.org/web/packages/mice/mice.pdf
Anywho, the mice() function this person wants to use has arguments meant to
control what is brought in and stored in whatever internal format as in not
taking some rows. A cursory glance suggests no way to suppress columns other
than not including them before calling the function as it does not read the
data from a file and expects either a data.frame or a matrix.
So your answer is valid. The questioner can use any method they wish to
adjust the initial data.frame and create a partial copy to use. If they want
a small subset of 2500+ columns (and who wouldn't) then it may be easiest to
simply name them in base R or select as in:
New.df <- Old.df(, c("col36", "col89", "hike"))
On the other hand, if they merely want to exclude lots of columns that have
something in common, yes, select() allows things like:
New.df <- Select(Old.df, -ends_with(c("extra", "comment"))
The tidyverse keeps being rewritten so some new ways may be replacing old,
but there are variants like select_if() that allow arbitrary functions to
decide what columns to include/exclude such as based on what type they
contain
So the key is to trick before calling the function but leave in everything
needed.
Only the one asking the question knows what all the columns mean and what
rhyme or reasons decides which to keep or exclude. A more specific question
may get a more specific answer.
-----Original Message-----
From: R-help <r-help-bounces at r-project.org> On Behalf Of Ebert,Timothy Aaron
Sent: Thursday, July 14, 2022 2:12 PM
To: Bert Gunter <bgunter.4567 at gmail.com>; Ian McPhail <ivmcphail at gmail.com>
Cc: R-help <r-help at r-project.org>
Subject: Re: [R] mice: selecting small subset of variables to impute from
dataset with many variables (> 2500)
Maybe this is too simple but could you use the select() function from dplyr?
Tim
-----Original Message-----
From: R-help <r-help-bounces at r-project.org> On Behalf Of Bert Gunter
Sent: Thursday, July 14, 2022 2:10 PM
To: Ian McPhail <ivmcphail at gmail.com>
Cc: R-help <r-help at r-project.org>
Subject: Re: [R] mice: selecting small subset of variables to impute from
dataset with many variables (> 2500)
[External Email]
If I understand your query correctly, you can use negative indexing to omit
variables. See ?'[' for details.
dat <- data.frame (a = 1:3, b = letters[1:3], c = 4:6, d =
letters[5:7]) dat
a b c d
1 1 a 4 e
2 2 b 5 f
3 3 c 6 g
dat[,-c(2,4)]
a c
1 1 4
2 2 5
3 3 6
Of course you have to know the numerical index of the columns you wish to
omit, but somethingh of the sort seems unavoidable in any case.
Cheers,
Bert
On Thu, Jul 14, 2022 at 11:00 AM Ian McPhail <ivmcphail at gmail.com> wrote:
Hello,
I am looking for some advice on how to select subsets of variables for
imputing when using the mice package.
From Van Buuren's original mice paper, I see that selecting variables
to be 'skipped' in an imputation can be written as:
ini <- mice(nhanes2, maxit = 0, print = FALSE) pred <- ini$pred pred[,
"bmi"] <- 0 meth <- ini$meth meth["bmi"] <- ""
With the last two lines specifying the the "bmi" variable gets skipped
over and not imputed.
And I have come across other examples, but all that I have seen lay
out a method of skipping variables where EVERY variable is named (as
"bmi" is named above). I am wondering if there is a reasonably easy
way to select out approximately 30 variables for imputation from a
larger dataset with around 2500 variables, without having to name all
2450+ other variables.
Thank you,
Ian
[[alternative HTML version deleted]]
______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mail
man_listinfo_r-2Dhelp&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAs
Rzsn7AkP-g&m=UxEz20f8LSF-iyVuq17UnoNVkEe6HoC3E6vHWssLjSBKtqLSrm7qs8v2e
wcXchwc&s=ABj_L_b515lhH7RIgTmmjylyWxJCbRWvzZDkxUkGw90&e=
PLEASE do read the posting guide
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.or
g_posting-2Dguide.html&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeA
sRzsn7AkP-g&m=UxEz20f8LSF-iyVuq17UnoNVkEe6HoC3E6vHWssLjSBKtqLSrm7qs8v2
ewcXchwc&s=LiocKPLYgq5olAT6tqGjr2xOLwDWw55DRzhuq7gcF5A&e=
and provide commented, minimal, self-contained, reproducible code.
______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_li
stinfo_r-2Dhelp&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAsRzsn7AkP-g&m
=UxEz20f8LSF-iyVuq17UnoNVkEe6HoC3E6vHWssLjSBKtqLSrm7qs8v2ewcXchwc&s=ABj_L_b5
15lhH7RIgTmmjylyWxJCbRWvzZDkxUkGw90&e=
PLEASE do read the posting guide
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.org_post
ing-2Dguide.html&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAsRzsn7AkP-g&
m=UxEz20f8LSF-iyVuq17UnoNVkEe6HoC3E6vHWssLjSBKtqLSrm7qs8v2ewcXchwc&s=LiocKPL
Ygq5olAT6tqGjr2xOLwDWw55DRzhuq7gcF5A&e=
and provide commented, minimal, self-contained, reproducible code.
______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Hi Avi,
Thank you for your reply. I had not considered this possibility.
Tim
-----Original Message-----
From: R-help <r-help-bounces at r-project.org> On Behalf Of avi.e.gross at gmail.com
Sent: Thursday, July 14, 2022 9:38 PM
Cc: 'R-help' <r-help at r-project.org>
Subject: Re: [R] mice: selecting small subset of variables to impute from dataset with many variables (> 2500)
[External Email]
Tim,
Your reply is reasonable if you want to read in EVERYTHING and use various nice features of the select() function in the dplyr package of the tidyverse that let you exclude a bunch of columns based on names starting or ending or containing various characters or not being of type integer and so on.
But another category wants to skip creating some columns in the first place.
Many reader functions that take in data from something like a .CSV file will allow you to effectively ignore some of the columns of data and thus hopefully cut down on some overhead.
I assume most of us have no real experience with the package called "mice"
and who is willing to read to page 72 or so in this document:
https://urldefense.proofpoint.com/v2/url?u=https-3A__cran.r-2Dproject.org_web_packages_mice_mice.pdf&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAsRzsn7AkP-g&m=psSXddrLcHW_8Z0VJKPJxvJuaZU8I4WKwySj5LtvA0BlD-G_JUdDzhIpZARfoTfp&s=msOsrEeTuS5_sLcvCR2FvF3kC7_1rYCebqZiKOji5iY&e=
Anywho, the mice() function this person wants to use has arguments meant to control what is brought in and stored in whatever internal format as in not taking some rows. A cursory glance suggests no way to suppress columns other than not including them before calling the function as it does not read the data from a file and expects either a data.frame or a matrix.
So your answer is valid. The questioner can use any method they wish to adjust the initial data.frame and create a partial copy to use. If they want a small subset of 2500+ columns (and who wouldn't) then it may be easiest to simply name them in base R or select as in:
New.df <- Old.df(, c("col36", "col89", "hike"))
On the other hand, if they merely want to exclude lots of columns that have something in common, yes, select() allows things like:
New.df <- Select(Old.df, -ends_with(c("extra", "comment"))
The tidyverse keeps being rewritten so some new ways may be replacing old, but there are variants like select_if() that allow arbitrary functions to decide what columns to include/exclude such as based on what type they contain
So the key is to trick before calling the function but leave in everything needed.
Only the one asking the question knows what all the columns mean and what rhyme or reasons decides which to keep or exclude. A more specific question may get a more specific answer.
-----Original Message-----
From: R-help <r-help-bounces at r-project.org> On Behalf Of Ebert,Timothy Aaron
Sent: Thursday, July 14, 2022 2:12 PM
To: Bert Gunter <bgunter.4567 at gmail.com>; Ian McPhail <ivmcphail at gmail.com>
Cc: R-help <r-help at r-project.org>
Subject: Re: [R] mice: selecting small subset of variables to impute from dataset with many variables (> 2500)
Maybe this is too simple but could you use the select() function from dplyr?
Tim
-----Original Message-----
From: R-help <r-help-bounces at r-project.org> On Behalf Of Bert Gunter
Sent: Thursday, July 14, 2022 2:10 PM
To: Ian McPhail <ivmcphail at gmail.com>
Cc: R-help <r-help at r-project.org>
Subject: Re: [R] mice: selecting small subset of variables to impute from dataset with many variables (> 2500)
[External Email]
If I understand your query correctly, you can use negative indexing to omit variables. See ?'[' for details.
dat <- data.frame (a = 1:3, b = letters[1:3], c = 4:6, d =
letters[5:7]) dat
a b c d
1 1 a 4 e
2 2 b 5 f
3 3 c 6 g
dat[,-c(2,4)]
a c
1 1 4
2 2 5
3 3 6
Of course you have to know the numerical index of the columns you wish to omit, but somethingh of the sort seems unavoidable in any case.
Cheers,
Bert
On Thu, Jul 14, 2022 at 11:00 AM Ian McPhail <ivmcphail at gmail.com> wrote:
Hello,
I am looking for some advice on how to select subsets of variables for
imputing when using the mice package.
From Van Buuren's original mice paper, I see that selecting variables
to be 'skipped' in an imputation can be written as:
ini <- mice(nhanes2, maxit = 0, print = FALSE) pred <- ini$pred pred[,
"bmi"] <- 0 meth <- ini$meth meth["bmi"] <- ""
With the last two lines specifying the the "bmi" variable gets skipped
over and not imputed.
And I have come across other examples, but all that I have seen lay
out a method of skipping variables where EVERY variable is named (as
"bmi" is named above). I am wondering if there is a reasonably easy
way to select out approximately 30 variables for imputation from a
larger dataset with around 2500 variables, without having to name all
2450+ other variables.
Thank you,
Ian
[[alternative HTML version deleted]]
______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mail
man_listinfo_r-2Dhelp&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAs
Rzsn7AkP-g&m=UxEz20f8LSF-iyVuq17UnoNVkEe6HoC3E6vHWssLjSBKtqLSrm7qs8v2e
wcXchwc&s=ABj_L_b515lhH7RIgTmmjylyWxJCbRWvzZDkxUkGw90&e=
PLEASE do read the posting guide
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.or
g_posting-2Dguide.html&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeA
sRzsn7AkP-g&m=UxEz20f8LSF-iyVuq17UnoNVkEe6HoC3E6vHWssLjSBKtqLSrm7qs8v2
ewcXchwc&s=LiocKPLYgq5olAT6tqGjr2xOLwDWw55DRzhuq7gcF5A&e=
and provide commented, minimal, self-contained, reproducible code.
______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_li
stinfo_r-2Dhelp&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAsRzsn7AkP-g&m
=UxEz20f8LSF-iyVuq17UnoNVkEe6HoC3E6vHWssLjSBKtqLSrm7qs8v2ewcXchwc&s=ABj_L_b5
15lhH7RIgTmmjylyWxJCbRWvzZDkxUkGw90&e=
PLEASE do read the posting guide
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.org_post
ing-2Dguide.html&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAsRzsn7AkP-g&
m=UxEz20f8LSF-iyVuq17UnoNVkEe6HoC3E6vHWssLjSBKtqLSrm7qs8v2ewcXchwc&s=LiocKPL
Ygq5olAT6tqGjr2xOLwDWw55DRzhuq7gcF5A&e=
and provide commented, minimal, self-contained, reproducible code.
______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dhelp&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAsRzsn7AkP-g&m=psSXddrLcHW_8Z0VJKPJxvJuaZU8I4WKwySj5LtvA0BlD-G_JUdDzhIpZARfoTfp&s=jVxQsq0xD_WRFP8rsnPCCM2wXEiyQfz2-boRuanxLu0&e=
PLEASE do read the posting guide https://urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.org_posting-2Dguide.html&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAsRzsn7AkP-g&m=psSXddrLcHW_8Z0VJKPJxvJuaZU8I4WKwySj5LtvA0BlD-G_JUdDzhIpZARfoTfp&s=ZQkPsKDNoHIsIA8nLAK3MaKRcdB08PHd9ECPnrw23Rk&e=
and provide commented, minimal, self-contained, reproducible code.
______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dhelp&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAsRzsn7AkP-g&m=psSXddrLcHW_8Z0VJKPJxvJuaZU8I4WKwySj5LtvA0BlD-G_JUdDzhIpZARfoTfp&s=jVxQsq0xD_WRFP8rsnPCCM2wXEiyQfz2-boRuanxLu0&e=
PLEASE do read the posting guide https://urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.org_posting-2Dguide.html&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAsRzsn7AkP-g&m=psSXddrLcHW_8Z0VJKPJxvJuaZU8I4WKwySj5LtvA0BlD-G_JUdDzhIpZARfoTfp&s=ZQkPsKDNoHIsIA8nLAK3MaKRcdB08PHd9ECPnrw23Rk&e=
and provide commented, minimal, self-contained, reproducible code.