Closed tchakravarty closed 8 years ago
Hi @tchakravarty Thanks for posting.
Can I ask did you read though the README? I would have thought r_series
would have been clear to the reader? If you did read through it I need to make this clearer and your feedback here would be useful. If you did not read the README...many packages provide a README or vignette(s) that show the package use. This is a valuable first step to troubleshooting.
Using r_series
this is how I'd approach:
sample_size = 1e6
df_foo = r_data_frame(
n = sample_size,
ID = id,
y = dummy,
r_series(rnorm, 100, rep.sep = "")
)
If you want the variable names exactly as you show you can make a custom function as shown below:
r_norm <- function (n, ..., name = "norm") {
if (missing(n)) stop("`n` is missing")
out <- rnorm(n=n, ...)
varname(out, name)
}
df_foo = r_data_frame(
n = sample_size,
ID = id,
y = dummy,
r_series(r_norm, 100, name="x", rep.sep = "")
)
Politest RTFM I ever saw. :-) I did not read through the README @trinker -- I was already a layer deep in that I needed to use wakefield
to create an MWE to raise an issue about another package. But will do so. Thanks.
thanks for the honesty :-) I'm going to close if it doesn't work let me know (reopen this).
I am trying to create a wide dataset with multiple variables of a certain type and do not want to have to type them all out. If I were to type them all out, it would look something like this:
I wonder if something like this is possible with
wakefield
or there is a workaround to get this done?Thanks.