Displaying 20 results from an estimated 10000 matches similar to: "converting numeric to integer"
2009 Feb 21
2
difference between assignment syntax <- vs =
Hi,
Both operators <- and = can be used to make an assignment. My question
is: Is there a semantic difference between these two? Some time ago, I
remember I have read that because of some reason, one should be given
preference over the other - but I cannot remember the source, nor the
argument, nor which operator the preferred was.
What is the present state ?
Is still one version better
2009 Mar 13
2
changing function argument
Hi,
I wonder if the following is possible in R:
Suppose a function takes an argument, and wants to modify this argument
so that the change is visible _at the call side_. It would be what is
for example known as pass-by-reference-to-non-const in C++.
test <- function(x)
{
x <- 10
...
return (somethingElse) # I do NOT want having to return x
}
number = 5
test(number)
2009 Feb 11
2
generalized mixed model + mcmcsamp
Hi,
I have fitted a generalized linear mixed effects model using lmer
(library lme4), and the family = quasibinomial. I have tried to obtain a
MCMC sample, but on calling mcmcsamp(model1, 1000) I get the following
error which I don't understand at all:
Error in .local(object, n, verbose, ...) : Update not yet written
traceback() delivers:
4: .Call(mer_MCMCsamp, ans, object)
3:
2009 Jul 01
2
'singularity' between fixed effect and random factor in mixed model
Hi,
I just came across the following issue regarding mixed effects models:
In a longitudinal study individuals (variable ind) are observed for some
response variable. One explanatory variable, f, entering the model as
fixed effect, is a (2-level) factor. The expression of that factor is
constant for each individual across time (say, the sex of the
individual). ind enters the model as grouping
2010 Jan 07
7
Strange behaviour of as.integer()
I have encountered a strange behaviour of as.integer() which does not
seem correct to me. Sorry if this is just an indication of me not
understanding floating point arithmetic.
> .57 * 100
[1] 57
> .29 * 100
[1] 29
So far, so good. But:
> as.integer(.57 * 100)
[1] 56
> as.integer(.29 * 100)
[1] 28
Then again:
> all.equal(.57 * 100, as.integer(57))
[1] TRUE
> all.equal(.29 *
2013 Apr 24
5
[LLVMdev] Optimize away sqrt in simple cases?
> This is not true. The mathematically correct result for sqrt might not be a representable value in floating point, so rounding may occur between the two steps. In that case, pow2(sqrt(x)) != x.
>
> --Owen
I think what Christoph is saying is that x will always be at least as
accurate as pow2(sqrt(x)), so it's only unsafe in so far as one's code
is actually depending on an
2013 Apr 24
0
[LLVMdev] Optimize away sqrt in simple cases?
On Apr 23, 2013, at 7:15 PM, Stephen Lin <swlin at post.harvard.edu> wrote:
>> This is not true. The mathematically correct result for sqrt might not be a representable value in floating point, so rounding may occur between the two steps. In that case, pow2(sqrt(x)) != x.
>
> I think what Christoph is saying is that x will always be at least as
> accurate as pow2(sqrt(x)),
2006 Feb 12
1
floor and ceiling can't handle more than 15 decimal places (PR#8590)
Full_Name: Ben Phalan
Version: 2.2.1
OS: Win XP
Submission from: (NULL) (131.111.111.231)
I have noticed that floor returns the wrong number when there are more than 15
decimal places:
> floor(6.999999999999999)
[1] 6
> floor(6.9999999999999999)
[1] 7
There is a similar problem with ceiling, so this may apply to all/most rounding
functions?
> ceiling (2.000000000000001)
[1] 3
>
2011 Sep 30
2
[LLVMdev] Definition of C/C++ integral conversion(was Re: nsw/nuw for trunc)
>> 3) If the destination type is signed, the value is unchanged if it
>> can be represented in the destination type (and bit-field
>> width); otherwise, the value is implementation-defined.
>> ----------------------------------------------------
>>
>> 4.7.3 suggest to me, that the standard does not define a result for
>> '(signed char)
2011 Dec 16
2
[LLVMdev] striping of stdio information in llvm-gcc and clang
On Thu, Dec 15, 2011 at 08:43:01PM -0800, Eli Friedman wrote:
> clang's cross-compilation support isn't really mature; you might be
> able to get away with specifying "-ccc-host-triple sparc-sun-solaris
> -nostdinc -I /path/to/sparc/headers/".
Please read that as "clang's cross-compilation support is not magical".
It's not a question of maturity that
2011 Dec 17
0
[LLVMdev] striping of stdio information in llvm-gcc and clang
Thanks!
On Thu, Dec 15, 2011 at 10:39 PM, Joerg Sonnenberger
<joerg at britannica.bec.de> wrote:
> On Thu, Dec 15, 2011 at 08:43:01PM -0800, Eli Friedman wrote:
>> clang's cross-compilation support isn't really mature; you might be
>> able to get away with specifying "-ccc-host-triple sparc-sun-solaris
>> -nostdinc -I /path/to/sparc/headers/".
>
2011 Oct 03
0
[LLVMdev] Definition of C/C++ integral conversion(was Re: nsw/nuw for trunc)
On 09/30/2011 04:46 PM, Duncan Sands wrote:
>>> 3) If the destination type is signed, the value is unchanged if it
>>> can be represented in the destination type (and bit-field
>>> width); otherwise, the value is implementation-defined.
>>> ----------------------------------------------------
>>>
>>> 4.7.3 suggest to me, that the standard does
2020 Mar 18
2
[GSOC] "Project: Improve inter-procedural analyses and optimisations"
On 03/16, Fahad Nayyar wrote:
> I can see that Johanned have put up some issues for GSOC aspirants. I think
> that [2] <https://github.com/llvm/llvm-project/issues/179> ([Attributor]
> Cleanup and upstream `Attribute::MaxObjectSize`) will be a very good issue
> for me, It seems doable and I can get familiar with the whole process of
> writing a patch for an issue. How should I
2012 Nov 29
3
Ceiling function gives me wrong answer
Hi all,
I have a very simple code, but gives a wrong answer.
a=1000
b=1000^(1/3)
c=ceiling(a/b)
then c=101,
if change the code to be
a=1000
b=10
c=ceiling(a/b)
then c=100 is fine.
Thank you for the help.
[[alternative HTML version deleted]]
2003 Mar 03
1
transition matrix problem
I'm having trouble using some fairly simple code to change the entries
in a vector (x - the numbers 0-5) according to a simple transition
matrix that I've called p.dry.
the error message I get is
"no finite arguments to min; returning Inf"
Any suggestions as to where I'm going wrong greatly appreciated. Sorry
the message is lengthy!
cheers
Nick
The code is
2011 Feb 05
2
print(...,digits=2) behavior
A bug was recently posted to the R bug database (which probably would
better have been posted as a query here) as to why this happens:
> print(7.921,digits=2)
[1] 8
> print(7.92,digits=2)
[1] 7.9
Two things I *haven't* done to help make sense of this for myself are
(1) writing out the binary representations to see if something obvious
pops out about why this would be a breakpoint and
2011 Feb 05
2
print(...,digits=2) behavior
A bug was recently posted to the R bug database (which probably would
better have been posted as a query here) as to why this happens:
> print(7.921,digits=2)
[1] 8
> print(7.92,digits=2)
[1] 7.9
Two things I *haven't* done to help make sense of this for myself are
(1) writing out the binary representations to see if something obvious
pops out about why this would be a breakpoint and
2010 Jan 09
2
Plotting numeric values against non numeric items
Hi i want do a line graph.
My y axis contains numeric values. My x axis contains non numeric
statements.
This is what i want the graph to look like.
When i try to plot this graph on R it comes up with the following error
message:
"Error in plot.window(...) : need finite 'xlim' values
In addition: Warning messages:
1: In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by
2013 May 22
1
column width in .dbf files using write.dbf ... to be continued
Hello Arnaud,
You posted this question a long long time ago, however I found your answer so I decided to post it anyway in case somebody else have the same problem as you and me.
You were actually very close in finding your solution. The function DoWritedbf is an internal function from the foreign package. To access it outside of the package just do:
foreign:::DoWritedbf
so in your line:
2011 Dec 20
1
[LLVMdev] striping of stdio information in llvm-gcc and clang
Hi Joerg,
How do I find /path/to/sparc/headers/?
Many hanks,
Christine
On Fri, Dec 16, 2011 at 5:50 PM, Linlin Cheng <linlin at caltech.edu> wrote:
> Thanks!
>
> On Thu, Dec 15, 2011 at 10:39 PM, Joerg Sonnenberger
> <joerg at britannica.bec.de> wrote:
>> On Thu, Dec 15, 2011 at 08:43:01PM -0800, Eli Friedman wrote:
>>> clang's cross-compilation