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

check matrix carefully before returning it back to Stata #33

Open
haghish opened this issue Nov 13, 2023 · 2 comments
Open

check matrix carefully before returning it back to Stata #33

haghish opened this issue Nov 13, 2023 · 2 comments

Comments

@haghish
Copy link
Owner

haghish commented Nov 13, 2023

There seem to be a sloppy practice when returning matrices into R. R must ensure that matrices are numeric and do not break the process of matrix generation in Stata. Here is a code that generates an error, when rcall tries to return the object "output"

sysuse auto, clear // here's our dataset
rcall vanilla:                        ///
library("tableone") ;         ///
data<- st.data() ;             ///
rows <- c("price", "mpg", "rep78", "headroom", "trunk", "weight", "length") ; ///
columns <-c("foreign") ;     ///
categorical <- c("rep78") ;     ///
medianiqr <- c("weight") ;    ///
table1 <-CreateTableOne(data=data, vars=rows, strata=columns, factorVars=categorical, addOverall = TRUE) ; ///
output<-print(table1, nonnormal = medianiqr, missing=TRUE, quote=FALSE, noSpaces=TRUE, formatOptions = list(scientific = FALSE)) ;

Solution

most probably the error is a sloppy practice in stata.output.r file, which should be revised.

@ericmelse
Copy link

In response to your call for suggestions, I suppose for me the most valuable functionality would indeed be the transfer of matrices, result values of intermediate steps, from R to Stata.

@haghish
Copy link
Owner Author

haghish commented Nov 28, 2023

This is already implemented in rcall. though there is a need for a thorough testing of these features prior to releasing the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants