Re: [R] RSTAN

2021-06-19 Thread Jeff Newmiller
Off topic. Read the Posting Guide before posting here. You may find a more suitable forum via the Url entry in the rstan description file [1]. [1] https://cran.r-project.org/web/packages/rstan/index.html On June 19, 2021 6:15:04 PM PDT, peri He wrote: >Dear Friends, > >I have started to write

[R] RSTAN

2021-06-19 Thread peri He
Dear Friends, I have started to write some codes for RSTAN, I have a general question regarding likelihood function. Below you can see a simple structure of RSTAN model. For most of the codes, in the "model" block, I saw priors (hyperpriors) and likelihood functions. In a few programs, I don't s

Re: [R] Unexpected behaviour when using format(x, scientific = TRUE) on integer vector

2021-06-19 Thread Duncan Murdoch
On 19/06/2021 9:58 a.m., Remo Röthlin wrote: Dear useRs I’m encountering an unexpected behaviour when trying to apply format(x, scientific = TRUE) on integer vectors (but not double vectors). The resulting string is not formatted in scientific notation, however, using formatC() instead, the re

Re: [R] Unexpected behaviour when using format(x, scientific = TRUE) on integer vector

2021-06-19 Thread Bert Gunter
The behavior is **as documented on the man page**, always the first thing you should consult. It can be terse, but almost always accurate once deciphered. In this case, ?format says for the "scientific" parameter(Highlighting added): scientific Either a logical specifying whether elements of a **r

[R] Unexpected behaviour when using format(x, scientific = TRUE) on integer vector

2021-06-19 Thread Remo Röthlin
Dear useRs I’m encountering an unexpected behaviour when trying to apply format(x, scientific = TRUE) on integer vectors (but not double vectors). The resulting string is not formatted in scientific notation, however, using formatC() instead, the result is as expected. Is this the expected beh

Re: [R] [External] Unexplained behaviour of .Last.value

2021-06-19 Thread luke-tierney
Thanks for the report. Fixed in R-devel in r80530; will port to R-patched soon. Best, luke On Fri, 18 Jun 2021, Bickis, Mikelis wrote: Hello: Here is a bit of R-code: mvr [1] 2.2658 (sin(.Last.value)+sin(2*.Last.value)) [1] -0.2156507 acos((-sqrt(17)-1)/8) [1] 2.2658 (sin(.Last.value

Re: [R] Unexplained behaviour of .Last.value

2021-06-19 Thread Jake Elmstedt
Behaviour is confirmed on 4.1.0 on Ubuntu 20.04 and Windows 10. What's happening is (sin(.Last.value) + sin(2 * .Last.value)) is evaluating the first sin(.Last.value) which resolves to 0.7680514 then using that in the second expression, sin(2*.Last.value) := sin(2 * 0.7680514) which resolves to