Re: [R] piecewiseSEM two errors: arguments imply different numbers of rows / object 'ret' not found

2022-12-17 Thread Bert Gunter
Someone may be able to help (but not I); but please see ?debug, ?recover, ?traceback. Debugging is an essential task for any programming language. You should learn how to use R's tools to do this. I believe you would be able to find the error yourself if you did so. Cheers, Bert On Sat, Dec 17

[R] piecewiseSEM two errors: arguments imply different numbers of rows / object 'ret' not found

2022-12-17 Thread Michael Eisenring
Dear Rlist members, We are trying to run a SEM with your package. Unfortunaley while running our code two error messages popped up. For the life of us we could not figure out how to solve these errors . We are hoping very much that somebody can help us: Why do we get these error messages? We built

Re: [R] Adding comment in C++ code for debugging purpose

2022-12-17 Thread Rui Barradas
Às 13:38 de 17/12/2022, Christofer Bogaso escreveu: Hi, Below is the position of Rcout and underlying C++ function #ifdef _OPENMP #include #endif // [[Rcpp::depends(RcppProgress)]] #include #include "cpploss.h" #include #include #include using namespace Rcpp; // [[Rcpp::export]] SEXP GC

Re: [R] Adding comment in C++ code for debugging purpose

2022-12-17 Thread Christofer Bogaso
Hi, Below is the position of Rcout and underlying C++ function #ifdef _OPENMP #include #endif // [[Rcpp::depends(RcppProgress)]] #include #include "cpploss.h" #include #include #include using namespace Rcpp; // [[Rcpp::export]] SEXP GCPM_cpploss(SEXP default_distr_a,SEXP link_function_a,

Re: [R] Adding comment in C++ code for debugging purpose

2022-12-17 Thread Rui Barradas
Às 11:05 de 17/12/2022, Christofer Bogaso escreveu: Hi Rui, Unfortunately, the code Rcpp::Rcout << "-->.My values" << "\n"; still not printing the value. Regarding your second suggestion, R_Print("My values\n"); - where should I put this statement? On Sat, Dec 17, 2022 at 11:39 AM

Re: [R] Adding comment in C++ code for debugging purpose

2022-12-17 Thread Christofer Bogaso
Hi Rui, Unfortunately, the code Rcpp::Rcout << "-->.My values" << "\n"; still not printing the value. Regarding your second suggestion, R_Print("My values\n"); - where should I put this statement? On Sat, Dec 17, 2022 at 11:39 AM Rui Barradas wrote: > > Às 23:32 de 16/12/2022, Chris

Re: [R] Adding comment in C++ code for debugging purpose

2022-12-17 Thread Christofer Bogaso
Hi Ivan, This is a very nice point. I will check this out. Thanks and regards, On Sat, Dec 17, 2022 at 1:53 PM Ivan Krylov wrote: > > On Sat, 17 Dec 2022 05:02:33 +0530 > Christofer Bogaso wrote: > > > I am using an R package where there are some C++ code. > > > > To check some intermediate va

Re: [R] is.na()<- on a character vector

2022-12-17 Thread Göran Broström
Thanks to all. I was cofused and forgot that in is.na(x) <- value, value is an index vector. Clearly stated on the help page. So Bert's suggestion is the right one. Den 2022-12-16 kl. 19:44, skrev Jeff Newmiller: I don't find _either_ of these acceptable. On the other hand, x[ is.na( x

Re: [R] datatable using dt not able to print background colors

2022-12-17 Thread CALUM POLWART
I don't think this is an R issue, it's a HTML tables issue // browser issue. There are some hacks using background image (not R specific). BUT before you do any of this... Consider if colour is your answer! 8% of males are colour blind, so your table isn't as accessible as you may think it is. T

Re: [R] Adding comment in C++ code for debugging purpose

2022-12-17 Thread Ivan Krylov
On Sat, 17 Dec 2022 05:02:33 +0530 Christofer Bogaso wrote: > I am using an R package where there are some C++ code. > > To check some intermediate values generated by that C++ code, I added > a line like > > std::cout << "My values"; A more efficient way of debugging C++ code running under R