Displaying 20 results from an estimated 40000 matches similar to: "write.table and segment fault?"
2006 Mar 28
1
Help understanding behavior of apply vs sapply
Hi,
I was surprised that apply and sapply don't return the same results in
the example below. Can someone tell me what I'm missing?
> zls <- function(x) character(0)
> m <- matrix(0, nrow=2, ncol=2)
> apply(m, 1, zls)
character(0)
> sapply(m, zls)
[[1]]
character(0)
[[2]]
character(0)
[[3]]
character(0)
[[4]]
character(0)
> R.version
_
2006 Mar 28
2
atan2(1,1i)
Hi
?atan2 says that atan2(y,x)=atan(y/x) for x and y numeric or complex
vectors.
Well, I would expect atan2(1,1i) to be equal to atan(-1i), but
> atan2(1,1i)
Error in atan2(y, x) : Non-numeric argument to mathematical function
> R.version
_
platform powerpc-apple-darwin8.5.0
arch powerpc
os darwin8.5.0
system powerpc, darwin8.5.0
2006 Mar 28
2
atan2(1,1i)
Hi
?atan2 says that atan2(y,x)=atan(y/x) for x and y numeric or complex
vectors.
Well, I would expect atan2(1,1i) to be equal to atan(-1i), but
> atan2(1,1i)
Error in atan2(y, x) : Non-numeric argument to mathematical function
> R.version
_
platform powerpc-apple-darwin8.5.0
arch powerpc
os darwin8.5.0
system powerpc, darwin8.5.0
2006 Mar 10
2
appending objects to a file created by save()
Hi,
I've been slowly transitioning to saving sets of objects for a project
using save() rather than cluttering my workspace and then doing
save.image()
However, sometimes after I have done say:
save(x,y,z, file='work.Rda')
and I reload it a little later and I see that I also want to save
object p. Currently I need to do:
save(x,y,z,p, file='work.Rda')
Is there any way
2009 Sep 14
1
loading a package .Rda file at package load time
Hi, I have seen the answer to this sometime before but I just can't find it
again - pointers appreciated.
I have a package that contains some data.frames saved as .Rda files in the
data/ directory. When the package is loaded I would like to have them be
available in the workspace (without the user having to explicitly load them
using data(...)).
If my package does not use a NAMESPACE, I can
2009 Feb 13
1
Write and Load functions from an external file
Hi All,
Would be grateful,if anyone can answer my queries.
I need to share code. For example, if I am working in C/C++, I would put
some function declarations in .h files that you would include. In PHP, I
would create files with the common functions in them and then "include()"
them. So far, I haven't been able to figure out what the standard practice
is in R.
The two options
2007 Sep 25
1
'load' does not properly add 'show' methods for classes extending 'list'
The GeneSetCollection class in the Bioconductor package GSEABase
extends 'list'
> library(GSEABase)
> showClass("GeneSetCollection")
Slots:
Name: .Data
Class: list
Extends:
Class "list", from data part
Class "vector", by class "list", distance 2
Class "AssayData", by class "list", distance 2
If I create
2007 Oct 10
2
slow load() in R2.6.0
I'm encountering excruciatingly slow load times for character vectors in
R 2.6.0-- up to 30sec for a 15K file that contains a no-attributes
character vector of length ~1e4 and object size ~0.5MB. In R 2.5.1,
repeated loads of the same set of files are near-instantaneous.
The problem is proving tricky to reproduce consistently from scratch, so
I have attached the 3 files used in the examples
2016 Nov 13
2
Missing objects using dump.frames for post-mortem debugging of crashed batch jobs. Bug or gap in documentation?
Dear R friends,
to allow post-mortem debugging In my Rscript based batch jobs I use
tryCatch( <R expression>,
error = function(e)
{
dump.frames(to.file = TRUE)
})
to write the called frames into a dump file.
This is similar to the method recommended in the "Writing R extensions"
manual in section 4.2 Debugging R code (page 96):
2018 Oct 22
1
v3 serialization of compact_intseq altrep should write modified data
Experimenting with altrep objects and v3 serialization, I discovered a
possible bug. Calling DATAPTR on a compact_intseq object returns a
pointer to the expanded integer sequence in memory. If you modify
this data, the object values appear to be changed. However, if the
compact_intseq object is then serialized (with version=3), only the
original integer sequence info is written.
For example,
2010 Oct 05
2
[LLVMdev] gold-plugin build errors
I tried to build the gold plugin and receive the errors posted below. I
checked out the gold plugin using "cvs -z 9 -d
:pserver:anoncvs at sourceware.org:/cvs/src co src," as documented on
llvm.org. Is that version bleeding edge and perhaps not stable?
The first errors have to do with the libtool version. I have libtool
2.2.6 on my system, which is what the README-maintainer-mode
2010 Nov 22
3
save a regression model that can be used later
Hi everyone
I have a question about how to save a regression model in R and how to retrieve it for making predictions in a new session.
To be more specific, I fitted a multilevel logistic regression model using the lmer from the "lme4" package. I then successfully make predictions using fitted(mymodel).
Since data are complex (three levels, nested, numerous categorical and
2011 Jun 14
1
heatmap with values
Hi!
I'm displaying a contingency table with heatmap():
> svm.predPix.tabla
svm.predPix CC DD LL NN NN2
CC 22 0 3 8 3
DD 0 27 0 1 0
LL 1 1 90 3 7
NN 2 0 1 11 4
NN2 0 0 5 1 20
> heatmap(svm.predPix.tabla[5:1,], Rowv=NA, Colv=NA,col =
rev(heat.colors(32)), scale="column", margins=c(5,10))
and I'm happy
2016 Nov 15
2
Missing objects using dump.frames for post-mortem debugging of crashed batch jobs. Bug or gap in documentation?
Martin, thanks for the good news and sorry for wasting your (and others
time) by not doing my homework and query bugzilla first (lesson learned!
).
I have tested the new implementation from R-devel and observe a semantic
difference when playing with the parameters:
# Test script 1
g <- "global"
f <- function(p) {
l <- "local"
dump.frames()
}
2008 Feb 26
1
load windows file in linux
Hello R users,
I have windows XP running Rv2.6.0 and a Solaris OS 10 x86-64 running
Rv2.4.0.
I transferred several large .rda files from windows to linux because
of memory issues. I saved as .rda files on windows. In linux, the
files load and have the proper dimensions, but will not index. I get
the following error:
"negative length vectors are not allowed".
However, I can load
2007 Aug 11
1
LDA and RDA: different training errors
Hello
I try to fit a LDA and RDA model to the same data, which has two classes.
The problem now is that the training errors of the LDA model and the
training error of the RDA model with alpha=0 are not the same. In my
understanding this should be the case. Am I wrong? Can someone explain what
the reason for this difference could be?
Here my code:
LDA model:
===========
% x is a dataframe
tmp =
2014 Apr 29
1
access environment in which an error occurred
Dear R developers,
i have already send the question below to r-help but got no responses.
Perhaps it is more suitable for r-devel due to its rather technical
level. It would really help me to find a solution (or to find out that
there is none).
Is there any way to access/print/save the content of an environment in
which an error occoured?
Imagine the following testcase:
test =
2008 Aug 22
1
save() should not overwrite a file if an error occurs (PR#12583)
If save() fails because an object is not found,
it should not overwrite an existing file.
> a <- 1:9
> save(a, file = "a.rda")
> rm(a)
> load("a.rda")
> a
[1] 1 2 3 4 5 6 7 8 9
> rm(a)
> save(a, file = "a.rda")
Error in save(a, file = "a.rda") : object 'a' not found
> load("a.rda")
Error in
2011 Apr 14
1
saving a regression model to a file
Hello all,
First off, I am using R version 2.13.0 in Ubuntu.
I have read previous posts in the R mailing list on saving models for
later use, and the responses indicate using the R save() function to
save a model and then using load() to load it is one way to go.
However, when I use the save() function to save a model to a file, and
then try to load it using load(), the loaded "model"
2008 May 12
1
Insert a recorde into a table using SQL
Dear list,
I want to insert a recorde into a SQLite table by dbGetQuery(), but
there is a problem when the value contains quotation mark.
> dd<-data.frame(txt=c("having both ' and \" in character.","OK"))
> library(RSQLite)
Loading required package: DBI
> con<-dbConnect(dbDriver("SQLite"),":memory:")
>