Re: [R] Help with function and survey data

2022-10-31 Thread Edjabou Vincent
Dear Bert Thank you for your suggestion. I have tried it but it did not work. For record, I am reposting the post with the plain text. library(tidyverse) library(plyr) library(survey) dat <- structure(list( r3a_1 = structure(c(3L, 2L, 3L, 3L, 3L, 3L, 3L,3L, 3L, 3L, 3L, 2L, 2L, 3L, 3L, 3L,

Re: [R] Help with function and survey data

2022-10-31 Thread Bert Gunter
1. This is a plain text list. Set your email to post in plain text, not html, which often gets mangled (see below). 2. I did not run your example, but try: my_funca(mk =names(dat)[1:9], y = dat$seg_2) ## seg_2 is a component of dat and is not in the environment of the call. I did not see any

[R] Help with function and survey data

2022-10-31 Thread Edjabou Vincent
Dear R-Help I am working with complex survey data using the survey package. I would like to create a function for the generate multi crosstable. The problem is that I am getting error with the following message: "Error in eval(predvars, data, env) : object 'y' not found" Here is the example: