Displaying 20 results from an estimated 5000 matches similar to: "NA in character vectors"
2002 Mar 28
0
pos argument to library
While R-1.5.0 is still unfrozen, I'd like to lobby again for a "pos" argument
in library(). It seems straightforward to implement -- just change this line:
env <- attach(NULL, name=pkgname)
to:
env <- attach(NULL, pos, name=pkgname)
The reason I want this, by the way, is to mimic the S-Plus synchronize()
command. Essentially, my version of synchronize() simply detaches a
2002 Jan 07
0
New package: colSums
I've uploaded a package colSums_1.0.tar.gz to CRAN /src/contrib/Devel. It
contains functions colSums, colMeans, colVars, colStdevs, rowSums, rowMeans,
rowVars, and rowStdevs. These do simple, fast arithmetic on columns/rows of a
matrix, or more generally across dimensions of an array, e.g. colSums(m) =
apply(m, 2, sum) but faster. They should be compatible with the corresponding
S-Plus
2006 Apr 28
1
as.character.factor when the factor contains "NA"
as.character.factor contains this line (where cx=levels(x)[x]):
if ("NA" %in% levels(x)) cx[is.na(x)] <- "<NA>"
Is it possible that this is no longer the desired behavior? These
two results don't seem very consistent:
> as.character(as.factor(c("AB", "CD", NA)))
[1] "AB" "CD" NA
> is.na(.Last.value)[3]
[1] TRUE
2001 Dec 03
1
New package: g.data
A new package "g.data" is available on CRAN, to create and maintain databases
that work more like the S-Plus model.
Here's the official Description for g.data (v1.2):
Create and maintain delayed-data packages (DDP's). Data stored in
a DDP are available on demand, but do not take up memory until requested.
You attach a DDP with g.data.attach(), then read from it and assign
2001 Dec 03
1
New package: g.data
A new package "g.data" is available on CRAN, to create and maintain databases
that work more like the S-Plus model.
Here's the official Description for g.data (v1.2):
Create and maintain delayed-data packages (DDP's). Data stored in
a DDP are available on demand, but do not take up memory until requested.
You attach a DDP with g.data.attach(), then read from it and assign
2002 Aug 15
1
order(1, na.last=NA) fails (PR#1913)
R> order(1, na.last=NA)
Error in apply(sapply(z, is.na), 1, any) :
dim(X) must have a positive length
This bug appears unrelated to PR#1906, and so the fix of 8/15 doesn't help.
It comes from the line inside order():
ok <- !apply(sapply(z, is.na), 1, any)
where z=list(1) in my example. sapply() returns a single-element vector, not a
matrix, making apply() unhappy. This might
2001 Oct 04
2
Characters subsetted with NA (was: Several R vs S-Plus issues)
Hello, R-devel!
I posted to R-help, and (inappropriately) to R-bugs, this R/S-Plus difference:
> LETTERS[c(NA,2)] in S is c("","B"), but in R is c("NA","B")
Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at> wrote:
> I think we do not want to change this. ...
> R> is.na(LETTERS[c(NA,2)])
[1] TRUE FALSE
> so we really have NA but it is
2002 Oct 15
1
cut() on NA gives 0 when labels=F
Hi all,
I just noticed this odd behavior in R 1.5.1 (on Solaris 2.6):
R> cut(c(2,NA), 1:5, labels=F)
[1] 1 0
Is it a bug? I would have expected "1 NA" (better for indexing), and also the
S-Plus analog is:
S-Plus> as.integer(cut(c(2,NA), 1:5))
[1] 1 NA
Apologies ahead of time if it's already fixed in R 1.6.0 and/or already known
(perhaps related to
2016 Jun 04
1
RProfmem output format
I'm picking up this 5-year old thread.
1. About the four memory allocations without a stacktrace
I think the four memory allocations without a stacktrace reported by Rprofmem():
> Rprofmem(); x <- raw(2000); Rprofmem("")
> cat(readLines("Rprofmem.out", n=5, warn=FALSE), sep="\n")
192 :360 :360 :1064 :2040 :"raw"
are due to some
2002 Aug 13
2
Misalignment of <NA> in rownames (PR#1905)
An NA in the rownames of a matrix (or dataframe) causes misalignment when the
matrix is printed:
R> x <- matrix(1:12, 3,4, dimnames=list(letters[1:3], LETTERS[1:4]))
R> rownames(x)[2] <- NA
R> x
A B C D
a 1 4 7 10
<NA> 2 5 8 11
c 3 6 9 12
The bug is in function Rstrlen, in src/main/printutils.c. MatrixRowLabel and
MatrixColumnLabel (same file) rely on Rstrlen
2016 Sep 16
1
getGraphicsEvent() questions, minor feature/tweak request, and patch(es).
Hey all, new R user and first timer here.
I've been using getGraphicsEvent() on an X11-Xlib device in a kind of
interactive loop, and would like to be able to stop it from printing
newlines in the console when I don't actually want to print a prompt.
Even an empty "" value still causes a newline right now.
To not break any code that depends on this behavior, I figured getting
2006 Oct 17
1
Error: STRING_ELT() can only be applied to a 'character vector', not a 'builtin'
I have a daily job that attaches hundreds of pseudo-packages containing
data as promise objects (DDP's, ref: g.data package), and plots the
results to a multi-page pdf device. Sometimes it fails. Under R-2.2.1
it just gave segfaults. Under R-2.3.1 it gave this error message:
*** caught segfault ***
address (nil), cause 'memory not mapped'
Traceback:
1:
2020 Jan 18
1
How to get an object name from C?
(earlier I sent it as html by mistake).
Hi,
How can I get from C an object name used as a function argument? I
have sample code in C that gives me access to the name of the function
being called:
SEXP xname(SEXP x)
{
const char *fun_name = CHAR(PRINTNAME(CAR(x)));
x = CDR(x);
const char *arg_name = isNull(TAG(x)) ? "" : CHAR(PRINTNAME(TAG(x)));
2009 Mar 03
1
profiler and loops
Hello,
(This is follow up from this thread:
http://www.nabble.com/execution-time-of-.packages-td22304833.html but
with a different focus)
I am often confused by the result of the profiler, when a loop is
involved. Consider these two scripts:
script1:
Rprof( )
x <- numeric( )
for( i in 1:10000){
x <- c( x, rnorm(10) )
}
Rprof( NULL )
print( summaryRprof( ) )
script2:
2005 Nov 17
0
OggPCM2: channel map
On 2005-11-17, Erik de Castro Lopo wrote:
> I did flesh out the wiki a **little** more. Is the intent clearer now?
Yes. Channel map type tells us what the primary interpretation of the
stored signals is. Channel definitions are there to tell which stored
channel corresponds to which abstract channel in the type. Channel
conversions define downmixes to secondary formats, as they do in MLP,
2015 Apr 29
3
Postpone email delivery with LMTP and Postfix
Hi,
is there any way, based on userdb/passwdb attribute, how to postpone an
email delivery? The purpose is, I need to freeze an account (Maildir++)
for a few minutes and new email must not be delivered. But emails must
be delivered when account is unfrozen.
I found few things about Postfix filters, but I'm not sure it's a good way.
Thank you, Milo
2002 Feb 20
1
Bug in "[<-.matrix"? (Was: Feature Request: "matrix[1:10,1:10, block=F] <- 1:10")
Thanks to David Meyer [david.meyer@ci.tuwien.ac.at] and David Brahm
[brahm@alum.mit.edu] who suggested:
m[ cbind(index.i, index.j) ] <- vals
This works fine for the example I gave.
Unfortunately, this approach doesn't extend to using the row and column
names to make assignments:
> m <- matrix("",ncol=3,nrow=3)
> dimnames(m) <-
2005 Nov 17
2
OggPCM2 : chunked vs interleaved data
Sampo Syreeni wrote:
> Secondly, I'd like to see the channel map fleshed out in more detail.
Sampo,
I did flesh out the wiki a **little** more. Is the intent clearer now?
> (Beware of the pet peeve...)
What is that pet peeve?
> IMO the mapping should cover at least the
> channel assignments possible in WAVE files, the most common Ambisonic
> ones, and perhaps some added
2016 Nov 23
1
New laptop recomendation
On 11/22/2016 3:50 PM, Dr. Mikeal Hughes wrote:
> When you go to the Dell Linux site and choose shop now you are taken to a page featuring Windows 10 machines.
[OT rant]
a pet peeve... webpile redesigns that mess everything up.
I was looking for info on the BLM (Bureau of Land Management) website
last night, and they'd totally redone the entire mess, it was all slick
and web 3.0-ish,
2011 May 18
0
[LLVMdev] 2.9 pass manager asserts "Unable to handle Pass that requires lower level Analysis pass"
Hi,
I am trying to write an LLVM project, using LLVM 2.9. My passes are defined
as follows, where the Pass2 requires Pass1.
namespace llvm {
class BaseClass : public ModulePass {
// Name for printing
const char* printname;
protected:
BaseClass(char id, const char* name)
: ModulePass(id),printname(name){
}
};
class Pass1 : public BaseClass {
public:
static char ID;
Pass1() :