Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lex() argument length, and inserting 'if' in function codes #8

Open
Ghozayel opened this issue Oct 3, 2022 · 0 comments
Open

lex() argument length, and inserting 'if' in function codes #8

Ghozayel opened this issue Oct 3, 2022 · 0 comments

Comments

@Ghozayel
Copy link
Owner

Ghozayel commented Oct 3, 2022

Hi @BatoolMM

  • The length lex() function currently taking is 2400 observation/rows. I have tested this before, it was working well with less than 2400 as well as up to 2400, which was fair enough for me. However, when I ran lex() function yesterday, it returned an error when less than 2400 obs were used, meaning that the length must be 2400 rows, not less!
    Q: Is there a way to make it flexible, any 60 multiples مضاعفات ٦٠?

For the testing-data, the following codes generate fake-data (also available in the Lextale readme file, under examples):

answer <- sample(c(0/1), replace = TRUE, 2400) #generate 2400 random binary responses
ID <- gl(40, 60) #generate 40 ids
test-data <- cbind(ID, answer) #combine the two columns above into one data
as.data.frame(test-data)

  • lex() function codes, I need to include 'if statements', i.e. if users used yes/no instead of binary data (0/1), the function should convert yes to 1 and no to 0. For now the function lex() only takes binary 0/1.
  • Additionally, but not necessary, I'd like to ensure that ID and answer lengths be equal, e.g. if there are 60 observations under ID there should be 60 observations under answer, and if not, a warning message should tell the user something in line with ' ID and answer lengths must be equal' or 'make sure there are no NAs in your data'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant