> strsplit("Ibuprofin 200mg", split=number.pattern,keep=TRUE)
[[1]]:
[1] "200"
Is this a reasonable thing to want strsplit to do?
Is this a reasonable parameterization of it?
Bill Dunlap
uot;
Is this worth encapsulating in a standard R function?
If so, is doing via an extra argument to strsplit()
a reasonable way to do it?
> strsplit(c("12;34:56,89,,12", "1.2, .4, 1., 1e3"), number.pattern, keep=T)
[[1]]:
[1] "12" "34" "56" &
< n; i++)
> LOGICAL(ans)[i] = ISNAN(REAL(x)[i]);
> break;
>
> and it's hard to see how that can be improved. It does suggest that a
> faster anyNA() function would have to not be generic.
-
gt; I did think you could make use of an option to decide whether to the print
> the message or not, but I have always assumed that those who did want a
> banner probably did not want it suppressed.
If the .onAttach() used message() instead of cat()
to display the banner message then you could
ng when fixed!=TRUE):
> cat(gsub("/", "", "C:/Program Files/R"),"\n")
C:\Program Files\R
> cat(gsub("/", "\\", "C:/Program Files/R", fixed=T), "\n")
C:\Program Files\R
B
er have SHLIB complain if it sees a -flag
that SHLIB doesn't recognize. Otherwise we get
portability problems. E.g., when using the Microsoft
C compiler and linker a SHLIB that knows about the
-l and -L flags can translate
-lfoo -L/dir/subdir
into LDFLAGS that link.exe knows about:
foo.
are the unique strings in the
argument. This may save time and space if there a many
repeated values in the strings and may make the
statistical modelling functions easier to use. The
default is TRUE, unless one sets options(stringsAsFactors=FALSE).
...
---
On Mon, 22 May 2006, Prof Brian Ripley wrote:
> On Mon, 22 May 2006, Bill Dunlap wrote:
>
> > On Mon, 22 May 2006, Prof Brian Ripley wrote:
> >
> >> The other motivation was to allow the option to not convert character
> >> vectors to factors, wh
quot;character"
R does this when grepping an integer vector.
R> grep("1", 0:11, value=T)
[1] "1" "10" "11"
help(grep) says it returns "the matching elements themselves", but
doesn't say if "themselves" means before or a
be my first inclination also. I would have expected the output of
grep(pattern, text, value=TRUE)
to be identical to that of
text[grep(pattern, text, value=FALSE)]
no matter what class text has.
No end users have seen this in Splus so we can change it to anything,
but we want to keep it th
year 2006
> month 06
> day01
> svn rev38247
> language R
> version.string Version 2.3.1 (2006-06-01)
> > win.version()
> [1] "Windows XP Professional (build 2600) Service Pack 2.0"
>
>
> Many thanks in advance and be
3.24 0.78 44.11 0.00 0.00
To save setup time in the S code, out-of-range values
in the group argument (negatives, values greater than
ngroup, and NA's), mean that the correponding element
in x is ignored.
Bill Dunlap
ing (i.e. higher values will
> represent larger MTB firms, etc).
>
> That just leaves the problem of calculating stats on short sequences
> of of a longer integer.
>
> > They are fast:
> >
> >> x<-runif(2e6)
> >> i<-rep(1:1e6, 2)
> >> sys.time
gt; Dominick Samperi wrote:
> > In for loops of the form:
> > for(m in seq(beg,end))
> > ...
> >
> > when beg > end, the default behavior is
> > to decrement, and the action described
> > by ... is executed at least once.
---
NA 2.00 4.141593
2 NA 3.718282 7.283185
3 NA 8.389056 10.424778
Warning message:
+ not meaningful for factors in: Ops.factor(left, right)
If we made + do paste(sep="") for character+number then
we would lose the messages and let garbage flow further
down the pipe.
Shoul
See, e.g.,
http://www.helpware.net/FAR/help/dlg_hhpedit_sec.htm
--------
Bill Dunlap
Insightful Corporation
bill at insightful dot com
360-428-8146
"All statements in this message represent the opinions of the author and do
no
tfind=T'
if you
# want an error to occur when there is no such named element. NOT to be used
for slots.
function(object, name, mustfind = F)
.Internal(elNamed(object, name, mustfind), "S_el_named", T, 0)
It isn't used much and has some surprises. E.g.,
elNamed(zlis
) 1, list(a=quote(foo)))
function(a = foo)
1
> substitute(function(a=func(100))func(a), list(func=quote(myFunction)))
function(a = myFunction(100))
myFunction(a)
R's substitute does not appear to go into
the 'formals' of a function definition
when looking for names t
re substituted.
In R I'm not sure what class/mode the argument name
in the formals list has. The formals list is a "pairlist"
and the argument names are th names of the pairlist.
What internal class/mode do they have?
However, substitute() in R does not appear to go into
formal a
= 0)
The warning is mostly emitted when the error is benign, but it
might help get people to think about what they are typing.
Bill Dunlap
Insightful Corporation
bill at insightful dot com
360-428-8146
"All statements in this message represent the opinions of the author and do
not necessaril
ide of brackets would give incorrect results.
> > bayesmix/R/JAGScontrol.R: text[4] <- "-inits.R\"\n\initialize\n"
> > SciViews/svDialogs/R/fixedDlg.wxPython.R:if (length(grep("[\.]",
> > basename(res))) == 0)
In SciViews I also see
comman
t to find too many folks using \f where they intended
> > either \\f or f.)
> >
> > We don't support unicode so we won't do anything with the \u or
> > \U. That is something Splus does need to warn about to aid in
> > porting stuff from R.
eval.with.vis <- function(expr, envir = parent.frame(),
enclos = if (is.list(envir) || is.pairlist(envir)) parent.frame()
else baseenv())
.Internal(eval.with.vis(expr, envir, enclos))
Perhaps that could be adapted for more general use.
-
quot;,"ccc"), titi=c(.9,.9,999.9))
R> as.matrix(df7)
toto titi
1 "a" " 0.9"
2 "bb" " 0.9"
3 "ccc" "999.9"
Once such a decision is made it is hard to change things, especially
when the be
It currently runs into
uninitialized memory at the end of ".Primitive".
(This is in a copy of R source from June 2006.)
Bill Dunlap
Insightful Corporation
bill at insightful dot com
360-428-8146
"All statements in this message represent the opinions of th
On Mon, 13 Nov 2006 [EMAIL PROTECTED] wrote:
> When I use readBin() to read an unknown number
> of null-terminated strings from a file by supplying
> an overcount as the n= argument, it appends an empty
> string to the result.
>
> > tf<-tempfile()
> > strings<-c("One","Two","Three")
> > writeBin(s
d e f g h
> >>> Levels: d e f g h
> >>>> c(x,y)
> >>> [1] 1 2 3 4 5 1 2 3 4 5
> >>>>
> >>>
> >>> Is there a case for a new method c.factor as follows? Does something
> >>> similar exist already? Is there a better way to write the function?
-
unction
called concat.two(x,y) with is generic and has 2 arguments
to make it easer to write methods for. concat(x,y,z)
calls concat.two(concat.two(x,y),z). concat() is not used much,
but it is the Summary group functions: min, max, sum, etc.
---
;, sig=signature(x="missing", y="missing"),
definition=function(x, y, ...).plot.noxy(...))
E.g.,
plot(xlim=c(-2,2), ylim=c(-2,2)) # set up plot and draw axes
for(i in -10:10)points( (.8+.7i)^i) # add points to graph
--
101 - 129 of 129 matches
Mail list logo