Displaying 20 results from an estimated 500 matches similar to: "Right digits of a floating number"
2006 Jan 15
8
/ Operator not meaningful for factors
Folks,
I have a very basic question. The solution eludes me perhaps because
of my own lack of creativity. I am not attaching a fully reproducible
session because the issue may well be becuase of the way the data file
is, and the data file is large (and I don't know whether I can legally
distribute it). If people can suggest things that might be wrong in my
data or the way that I am reading it,
2011 Apr 20
2
Saving run time in loop
Hi r users,
I am trying to compute the "moving variance" of a large matrix. I now use a
loop but I am looking for a faster solution. Here is a sample of the code.
Source= matrix(rnorm(400),ncol=100)
variances= matrix(rep(NA,4*100),ncol=100)
for (i in 1:80) {variances[,i]=apply(Source[,i:(i+80)],1,var)}
any idea? Many thanks in advance.
Vincent.
--
View this message in context:
2010 May 10
2
tapply function with NA
Hi R users,
I have a matrix "m" of the type:
m
X4.20.2010 X4.19.2010 X4.16.2010
[1,] 0.008319468 0.00000000 -0.008250825
[2,] 0.005574136 0.01816118 0.073081608
[3,] -0.047830688 0.01612903 -0.030239833
[4,] NA NA NA
[5,] 0.008746356 0.02848576 -0.025566107
[6,] -0.007990868 0.00000000 -0.026666667
I want to get the sum of each column. Normally
2012 Mar 05
8
Automating R script with Windows 7
Hi R-users,
I am trying to automate the daily running of a simple R script from Windows
7.
>From previous posts, I understand that this needs to be done with the task
scheduler.
I can schedule my laptop to automatically open R at a certain time, but not
to execute a script.
Secondary question: how do I save a list of R commands so that they get
executed once the file is open?
Right now, I
2002 Dec 20
3
Bad packet length problem with "aes128-cbc" and openssh3.1p1
Hi,
I am trying to run openssh 3.1p1. But it is giving "Bad packet length" error
when I run sshd with default config file. On further investigation I found
that the error is coming only for the cipher algorithm "aes128-cbc". Also
the error comes only when I don't specify any protocol file
(/usr/local/etc/ssh_host_[rd]sa_key) or specify only "protocol 2" files.
I
2010 May 06
1
How to rank matrix data by deciles?
Hi R users,
I have a matrix of data similar to:
> y=matrix(rnorm(55),ncol=5)
I would like to know to which decile each number belongs compared to the
numbers in its column.
Say y[1,1] is the third decile among y[1:11,1] and y[2,1] is in the second
decile
I would like get a matrix that would return their ranks in decile, i.e.,
y[1,1] -> 3
y[2,1] -> 2
Your help is much appreciated!
2010 May 05
3
Read data from .csv file as a matrix
Hi R-users,
I have a csv file that contains weather observation (rows) by days (in
columns).
I open using:
> temp = read.csv("Weather.csv", sep=",")
and read:
X X1.Jan X2.Jan X3.Jan X4.Jan
1 Min 2 3 4 1
2 Max 6 10 8 6
3 Forecast Min 3 1 1 3
4 Forecast Max 8 7
2016 Dec 20
2
Very small numbers in hexadecimal notation parsed as zero
Hi all,
I have noticed incorrect parsing of very small hexadecimal numbers
like "0x1.00000000d0000p-987". Such a hexadecimal representation can
can be produced by sprintf() using the %a flag. The return value is
incorrectly reported as 0 when coercing these numbers to double using
as.double()/as.numeric(), as illustrated in the three examples below:
2007 Oct 13
2
the use of the .C function
Dear All,
could someone please shed some light on the use of the .C or .Fortran function:
I am trying load and running on R the following function
// psi.cpp -- psi function for real arguments.
// Algorithms and coefficient values from "Computation of Special
// Functions", Zhang and Jin, John Wiley and Sons, 1996.
//
// (C) 2003, C. Bond. All rights reserved.
//
//
2009 Jun 19
3
Floating point precision / guard digits? (PR#13771)
Full_Name: D Kreil
Version: 2.8.1 and 2.9.0
OS: Debian Linux
Submission from: (NULL) (141.244.140.179)
Group: Accuracy
I understand that most floating point numbers are approximated due to their
binary storage. On the other hand, I thought that modern math CPUs used guard
digits to protect against trivial underflows. Not true?
# integers, no problem
> 1+1+1==3
[1] TRUE
# binary floating
2009 Jun 19
3
Floating point precision / guard digits? (PR#13771)
Full_Name: D Kreil
Version: 2.8.1 and 2.9.0
OS: Debian Linux
Submission from: (NULL) (141.244.140.179)
Group: Accuracy
I understand that most floating point numbers are approximated due to their
binary storage. On the other hand, I thought that modern math CPUs used guard
digits to protect against trivial underflows. Not true?
# integers, no problem
> 1+1+1==3
[1] TRUE
# binary floating
2007 May 22
2
R 2.5.0 refuses to print enough digits to recover exact floating point values
I have noticed that in R 2.5.0, no method of textual output will print
a "double" mode quantity with more than 15 digits after the decimal
point. From the help page (?print.default) it appears that this is
intentional, since digits after the fifteenth may be uncertain.
However, fifteen digits after the decimal point are not enough to
represent all the values that an IEEE-double can
2010 May 05
0
R-help Digest, Vol 87, Issue 5
Unsubscribe
-----Original Message-----
From: r-help-request at r-project.org
Date: Wed, 05 May 2010 12:00:09
To: <r-help at r-project.org>
Subject: R-help Digest, Vol 87, Issue 5
Send R-help mailing list submissions to
r-help at r-project.org
To subscribe or unsubscribe via the World Wide Web, visit
https://stat.ethz.ch/mailman/listinfo/r-help
or, via email, send a message with subject
2003 Aug 08
0
VoicemailMain2, inband digits detection, rcf2833 digits detection (rtp issue, I think)
Hi!
I've been trying to use the Voicemail (and Voicemail2) applications with
an SIP Phone (X-Lite, for those who cares), when I use g.711(a/u) codec,
it works perfectly with inband (it detects the whole mailbox (in my case
10007)), but not with rfc2833 (in this case, it only detects 107 as the
mailbox number). With gsm codec, the inband doesn't work, I guess
that's due to the
2004 May 28
0
Problem with digits blending on inbound pulsed digits?
I have a situation where I am receiving DID calls using Immediate Start
Pulse signalling on a Loop Start trunk. The line terminates on a Newbridge
Mainstreet 3624 channel bank, which provides battery etc. The channel is
converted and routed to Asterisk. The lines are configured as follows:
/etc/asterisk/zapata.conf
; Channels 1-24 service MainStreet 3624 channel bank
context=infrom-did
group=1
2004 May 28
0
Problem with digits blending on inbound puls ed digits?
To answer my own question for the record:
The relevant timing parameters in zaptel.h are
#define ZT_MINPULSETIME (15 * 8) /* 15 ms minimum */
#define ZT_MAXPULSETIME (100 * 8) /* 150 ms maximum default, lowered
to 100ms */
#define ZT_PULSETIMEOUT ((ZT_MAXPULSETIME / 8) + 50)
And the pulse detecion loop that consumes these parameters begins at line
4866 of zaptel.c
The
2017 Jan 02
1
utils::ls.str(): Partial argument name 'digits' to seq() (should be digits.d?)
Should utils::ls.str() be updated as:
svn diff src/library/utils/R/str.R
Index: src/library/utils/R/str.R
===================================================================
--- src/library/utils/R/str.R (revision 71879)
+++ src/library/utils/R/str.R (working copy)
@@ -622,7 +622,7 @@
args$digits.d <- NULL
}
strargs <- c(list(max.level = max.level, give.attr = give.attr,
2011 Mar 04
2
sum of digits or how to slice a number into its digits
Dear R colleagues,
I face a seemingly simple problem I couldn't find a solution for myself
so far:
I have to sum the digits of numbers. Example: 1010 ->2 100100110 -> 4
Unfortunately there seems not to be a function for this task. So my idea
was to use sum(x) for it. But I did not figure out how to slice a number
to a vector of its digits. Example (continued from above): 1010 ->
2005 Feb 15
0
Re: [Rd] corrupt data frame: columns will be truncated or padded with NAs in: format.data.frame(x, digits = digits)
James, thanks for the response.
I understand now my puzzle.
tmp <- data.frame(y1=1:4, f1=factor(c("A", "B", "C", "D")))
tmp$y2 <- NA
tmp[1:2, "y2"] <- 2
Does the job. I see that I should add a full column. In my case adding full
column of NAs and then adding values, solves my problems.
Thanks to all.
james.holtman at convergys.com
2005 Feb 13
0
corrupt data frame: columns will be truncated or padded with NAs in: format.data.frame(x, digits = digits)
Hello R users!
I have written one function (look at the end), which will ease my
work with analysis of data in another programme, for which I need
sometimes a special data structure. However I encountered several
problems with a created data frame.
---------------------------------------------------------------
The data frame (produced from the example at the end) looks like
the way I want