[R] Integration of functions with a vector argument

2024-06-12 Thread Levine, Michael
Hello all, I have a question concerning integration of a function of a multivariate argument with respect to one or more variables in r. Let us say we have a function F <- function(x){ body of the function} Where x is, in general, a d by 1 vector with d>1. Now I want to integrate out some o

Re: [R] Integration of functions with a vector argument

2024-06-12 Thread Ivan Krylov via R-help
В Tue, 11 Jun 2024 18:44:08 + "Levine, Michael" пишет: > Let us say we have a function > > F <- function(x){ body of the function} > > Where x is, in general, a d by 1 vector with d>1. Now I want to > integrate out some of the coordinates of x, e.g. x[1] or x[2] or both > of them etc. I'm

[R] my R code worked well when running the first 1000 lines of R code

2024-06-12 Thread Yuan Chun Ding via R-help
Hi R users, The following code worked well to summarize four data groups in a dataframe for three variables (t_depth, t_alt_count, t_alt_ratio), 12 columns of summary, see attached. However, after running another 2000 lines of R codes using functions from more than 10 other R libraries, then i

Re: [R] my R code worked well when running the first 1000 lines of R code

2024-06-12 Thread Bert Gunter
I am assuming from your message that *exactly* the same code you show was rerun and yielded different results. If that be so, I doubt that this can be answered without knowing what that other R code did -- and perhaps not even then -- and/or whether any of that code changed your data frame. Another

Re: [R] my R code worked well when running the first 1000 lines of R code

2024-06-12 Thread Ebert,Timothy Aaron
Hi Yuan, When you load some packages do you get messages saying that some function is being masked? What can happen is that one package has a function with the same name as another package. The conflict is resolved by having one package mask the other. However, this can cause conflicts if you

Re: [R] my R code worked well when running the first 1000 lines of R code

2024-06-12 Thread CALUM POLWART
I sometimes think people on this list are quite rude to posters. I'm afraid I'm likely to join in with some rudeness? 1. "Here is some code that works but also doesn't" is probably not going to get you an answer 2. I provide no information about the data it works on or doesn't 3. I tell you I'm u

Re: [R] my R code worked well when running the first 1000 lines of R code

2024-06-12 Thread Yuan Chun Ding via R-help
I am sorry that I know I should provide a dataset that allows to replicate my problem. It is a research dataset and quite large, so I can not share. Both Bert and Tim guessed my problem correctly. I also thought about the conflicting issue between different packages and function masking. I jus

Re: [R] my R code worked well when running the first 1000 lines of R code

2024-06-12 Thread Rui Barradas
Hello, Inline. Às 19:03 de 12/06/2024, Yuan Chun Ding via R-help escreveu: I am sorry that I know I should provide a dataset that allows to replicate my problem. It is a research dataset and quite large, so I can not share. Both Bert and Tim guessed my problem correctly. I also thought abou

Re: [R] my R code worked well when running the first 1000 lines of R code

2024-06-12 Thread Yuan Chun Ding via R-help
Hi Rui, Thank you very much! Yes, I verified using real data, it worked correctly as expected after adding tidyr:: to the pivot_longer function and dplyr:: to the group_by and summarize Function. I did not know how to assign the tidyr and dplyr to the three functions because I do not really u

Re: [R] my R code worked well when running the first 1000 lines of R code

2024-06-12 Thread Rui Barradas
Às 20:44 de 12/06/2024, Yuan Chun Ding escreveu: Hi Rui, Thank you very much! Yes, I verified using real data, it worked correctly as expected after adding tidyr:: to the pivot_longer function and dplyr:: to the group_by and summarize Function. I did not know how to assign the tidyr and dply