[R] vector values substitution in an expression using label_bquote in ggplot()

2021-03-02 Thread Shaami
anyone please guide me about that? Thank you Shaami [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

Re: [R] dependent nested for loops in R

2021-02-02 Thread Shaami
Hi Prof. David Thank you. I will always follow your advice. The suggested code worked. It gives either 1 or 0 depending on the condition to be true. I want index of z for which the condition is true (instead of 1) else zero. Could you please suggest? Thank you Shaami On Tue, Feb 2, 2021 at 10

Re: [R] dependent nested for loops in R

2021-02-01 Thread Shaami
Hi Duncan It worked. Thank you. Best Regards On Mon, Feb 1, 2021 at 6:26 PM Duncan Murdoch wrote: > On 01/02/2021 7:03 a.m., Shaami wrote: > > z = NULL > > p = 0.25 > > x = rnorm(100) > > z[1] = p*x[1] + (1-p)*5 > > for(i in 2:100) > > { > >z[

Re: [R] dependent nested for loops in R

2021-02-01 Thread Shaami
Winsemius wrote: > > On 1/31/21 1:26 PM, Berry, Charles wrote: > > > >> On Jan 30, 2021, at 9:32 PM, Shaami wrote: > >> > >> Hi > >> I have made the sample code again. Could you please guide how to use > >> vectorization for variables whose n

Re: [R] dependent nested for loops in R

2021-01-31 Thread Shaami
]<1) { w[j]=i } else { w[j] = 0 } } } On Sun, Jan 31, 2021 at 10:01 AM David Winsemius wrote: > > On 1/30/21 8:26 PM, Shaami wrote: > > Hi > > I have very large dependent nested for loops that are quite expensive > > computationally. It t

[R] dependent nested for loops in R

2021-01-30 Thread Shaami
Hi I have very large dependent nested for loops that are quite expensive computationally. It takes weeks and does not end to give me results. Could anyone please guide how could I use apply function or any other suggestion for such big and dependent loops in R? A sample code is as follows. w = NUL

[R] log of small values in R

2021-01-10 Thread Shaami
Dear FriendsI am facing the problem of log values in R. The log(1-0.9) is giving -Inf while log(1e-18) gives finite answer. Any suggestion to deal with this problem? Thank you [[alternative HTML version deleted]] __ R-he

[R] how to prove sum of probabilities to be one in R?

2020-08-20 Thread Shaami
lities is approximately 1. The difference from 1 is 1-p1-p2 = 9.97e-09, that is very small. I need to apply the sum of probabilities conditions in my many functions. But execution is halted because of floating point. Could anyone please guide about that? Thank you Regards Shaami [[alternative HTM

[R] Integrating a function that contains for loop or vectorization for for loop

2020-07-19 Thread Shaami
Hi Everyone It has been a long time I am facing a problem with integrating a function that contains for-loop or even vectorization of for loop. Could you please guide for the following MWE that how I could get rid of the error or warning messages? My MWE code is here: myfun <- function(X, a, b){

[R] Editing of .Rd files generated by roxygen2

2020-07-19 Thread Shaami
Hi All Could you please guide how we can edit the .Rd files generated by roxygen2 for better formatting? I get the function and its input arguments into multiple lines in the PDF file. Also, I do not get \usage{} line in .Rd file for an Rcpp functions. An example of an .Rd file and its correspon