Displaying 20 results from an estimated 9000 matches similar to: "[g]sub behaviour with NA (PR#6451)"
2003 Dec 18
1
qbinom when probability is 1 (PR#5900)
Full_Name: Jonathan Swinton
Version: 1.8.0
OS: Windows 2000
Submission from: (NULL) (193.132.159.34)
Calling qbinom with a sample probability of 1 returns NaN
> qbinom(p=0.95,size=10,prob=1)
[1] NaN
I believe that this is wrong and that qbinom(p,size,prob=1) should always be
size for 0<p<=1.
The documentation says that
The quantile is defined as the smallest value x such that F(x)
2003 Dec 19
1
Missing arguments to new
Is this the expected and/or correct behaviour? And if
so, how do I persuade new to interpret a named but
missing argument as missing?
-------------
setClass("testMissing",representation(a="numeric"),prototype=list(a=0));
showMissing <- function(real.arg,missing.arg) {
really.missing <- new("testMissing");
show(really.missing);
really.there <-
2004 Apr 20
2
Re: [R] Unexpected behaviour of identical (PR#6799)
"Swinton, Jonathan" <Jonathan.Swinton@astrazeneca.com> writes:
> # works as expected
> > ac <- c('A','B');
> > identical(ac,ac[1:2])
> [1] TRUE
>
> #but
> > af <- factor(ac)
> > identical(af,af[1:2])
> [1] FALSE
>
> Any opinions?
Did a cross-check with Splus and it doesn't do that , so I think it
2004 Apr 19
3
How to write an S4 method for sum or a Summary generic
If I have a class Foo, then i can write an S3 method for sum for it:
>setClass("Foo",representation(a="integer"));aFoo=new("Foo",a=c(1:3,NA))
>sum.Foo <- function(x,na.rm){print(x);print(na.rm);sum(x at a,na.rm=na.rm)}
>sum(aFoo)
But how do I write an S4 method for this? All my attempts to do so have
foundered. For example
2006 Jan 17
1
data.matrix returns mode logical for zero rows (PR#8496)
Full_Name: Jonathan Swinton
Version: 2.2.1
OS: Windows
Submission from: (NULL) (193.132.159.169)
#The first line of description for data.matrix says that it will
# 'Return the matrix obtained by converting all the variables in a
# data frame to numeric mode and then binding them together as the
# columns of a matrix.'
#However when called with a data.frame with zero rows,
2010 Jun 02
2
regexpr mystery can not remove trailing spaces
Dear all
I encountered strange problem with regexpr replacement
I made this character object
str <- "02.06.10 12:40 "
> str(str)
chr "02.06.10 12:40 "
I read in an object which seems to be quite similar
> str(as.character(becva$V1)[1])
chr "02.06.10 12:40 "
However I can not remove trailing spaces from it
> sub(' +$',
2018 Feb 10
1
please help me a little
Hi R Users,
I am very frustrated with the following code. Please do me a favor to run it.
after reading into the test data set (I also pasted the data set below), the first line of code for "res_coxphf" did not work and generated the error code below. but the other three line worked well. the second line for "res_coxphf2" should be the same as the first line; I need to run
2007 Jul 26
3
substituting dots in the names of the columns (sub, gsub, regexpr)
Dear R users,
I have the following two problems, related to the function sub, grep,
regexpr and similia.
The header of the file(s) I have to import is like this.
c("y (m)", "BD (g/cm3)", "PR (Mpa)", "Ks (m/s)", "SP g./g.", "P
(m3/m3)", "theta1 (g/g)", "theta2 (g/g)", "AWC (g/g)")
To get rid of spaces and
2003 Apr 01
2
Old style and new style classes
I have been writing quick and dirty S-plus code for years, but for a recent project I took the plunge, bought Venables and Ripley's S Programming, and implemented a class library using new style classes (in S-Plus 6.0). It worked quite nicely and I am wondering about making more routine use of them. Before I make much more of an investment, I have a few questions, both factual and subjective,
2003 Apr 01
2
Old style and new style classes
I have been writing quick and dirty S-plus code for years, but for a recent project I took the plunge, bought Venables and Ripley's S Programming, and implemented a class library using new style classes (in S-Plus 6.0). It worked quite nicely and I am wondering about making more routine use of them. Before I make much more of an investment, I have a few questions, both factual and subjective,
2011 May 16
4
Problem on glmer
Hi all,
I was trying to fit a Gamma hierarchical model using "glmer", but got weird error message that I could not understand. On the other hand, a similar call to the glmmPQL leads to results that are close to what I expect. I also tried to change tha "nAGQ" argument in "glmer", but it did not solve the problem. The model I was fitting has a simple structure - one
2011 Jul 05
2
Stuck ...can't get sapply and xmlTreeParse working
Can't seem to get the code below working. It gets stuck on line 24 inside the
function hm; comments show the line in question. The function hm is called
by sapply and is at the bottom of the code. Other stuff above line 24 works
correctly including the first couple of lines of the function hm. Should I
be using a different apply function or am I doing something wrong with
xmlTreeParse ?
2008 Apr 15
1
why does regexpr not work with '.'
Dear R Helpers,
I am running R 2.6.2 on a Windows XP machine.
I am trying to use regexpr to locate full stops in strings, but, without
success.
Here an example:-
f="a,b.c at d:" #define an arbitrary test string
regexpr(',',f) #find the occurrences of ',' in f - should be one at location
2
# and this is what regexpr finds
#[1] 2
2010 Jun 01
1
regexpr help (match.length=0)
R-help,
Sorry if this is more of a regex question than an R question. However,
help would be appreciated on my use of the regexpr function.
In the first example below, I ask for all characters (a-z) in 'abc123';
regexpr returns a 3-character match beginning at the first character.
> regexpr("[[:alpha:]]*", "abc123")
[1] 1
attr(,"match.length")
[1] 3
2007 Nov 02
1
R timeDate does not allow seconds?
Hello, Sorry if anyone gets this message twice, as my mailserver may not
be working.
Thanks for your response. Your idea makes a lot of sense to me, but I've
been unable to get seconds to work.
I ended up with this format finally:
"2007-10-31_16:20:22"
Problem is I am unable to get it recognized as a date using timeDate():
R>
2020 Jul 24
3
[PATCH v3 5/6] powerpc/pseries: implement paravirt qspinlocks for SPLPAR
On 7/24/20 4:16 AM, Will Deacon wrote:
> On Thu, Jul 23, 2020 at 08:47:59PM +0200, peterz at infradead.org wrote:
>> On Thu, Jul 23, 2020 at 02:32:36PM -0400, Waiman Long wrote:
>>> BTW, do you have any comment on my v2 lock holder cpu info qspinlock patch?
>>> I will have to update the patch to fix the reported 0-day test problem, but
>>> I want to collect
2020 Jul 24
3
[PATCH v3 5/6] powerpc/pseries: implement paravirt qspinlocks for SPLPAR
On 7/24/20 4:16 AM, Will Deacon wrote:
> On Thu, Jul 23, 2020 at 08:47:59PM +0200, peterz at infradead.org wrote:
>> On Thu, Jul 23, 2020 at 02:32:36PM -0400, Waiman Long wrote:
>>> BTW, do you have any comment on my v2 lock holder cpu info qspinlock patch?
>>> I will have to update the patch to fix the reported 0-day test problem, but
>>> I want to collect
2009 Mar 16
8
Good phone near $125
I was looking at the aastra 9133i, however I was informed that this phone is
no longer supported. What are good phones around the $100 - $125 price
point? (Need POE)
Thanks,
David Ruggles
CCNA MCSE (NT) CNA A+
Network Engineer Safe Data, Inc.
(910) 285-7200 david at safedatausa.com
2001 Oct 19
4
Exclude
Hi Folks,
I'm running rsync between an NT client and a Solaris 7 Server (Ver 2.4.6).
I'd like to be able to exclude the following directory:
/opt/IBMHTTPDLOG/archivelogs
but retrieve
/opt/IBMHTTPDLOG
My setup is:
rsync -av -p -e rsync@server1.cna.com:/opt/IBMHTTPDLOG/
F:/opt/IBMHTTDLOG
(client)
rsync --daemon --exclude-from=/etc/rsync.exclude
(server)
What I get is
2010 May 05
1
extracting a matched string using regexpr
Given a text like
I want to be able to extract a matched regular expression from a piece of
text.
this apparently works, but is pretty ugly
# some html
test<-"</tr><tr><th>88958</th><th>Abcdsef</th><th>67.8S</th><th>68.9\nW</th><th>26m</th>"
# a pattern to extract 5 digits
> pattern<-"[0-9]{5}"
#