Displaying 20 results from an estimated 900 matches similar to: "recursive data-structures in R - An S4 "node" Class"
2008 Nov 26
1
S4 slot containing either aov or NULL
Dear listmembers,
I would like to define a class with a slot that takes either an object
of class aov or NULL. I have been reading "S4 Classes in 15 pages more
or less" and "Lecture: S4 classes and methods"
#First I tried with list and NULL
setClass(listOrNULL")
setIs("list", "listOrNULL")
setIs("NULL", "listOrNULL")
#doesn't
2009 Nov 25
2
Unique observations
An embedded and charset-unspecified text was scrubbed...
Name: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20091125/62ecd9aa/attachment-0001.pl>
2005 Jul 28
2
problem with an IF statement?
Can somebody please take a look at this and tell me whats going wrong?
It seems to be parsing wronly around the 'if' statement and gives me a
directory listing.
Thanks in advance
Tom
N.B. datan is an invented dataset
xvals<-c(1,0.4,0.2)
datan<-data.frame(s1=c(3,4,5),s2=c(5,5,5),s3=c(21,55,34),s4=c(5,3,2))
datan$sint<-NA
datan$sgrad<-NA
for(icount in 1:dim(datan)[1]) {
2007 Mar 12
2
e2fsck hanging
I'm trying to run e2fsck on a ~6TB filesystem which is about 90%
full. We're doing backup to disk to this filesystem, and have a
number of hard links (link counts up to 90).
strace shows:
write(1, "Pass 2: Checking ", 17) = 17
write(1, "directory", 9) = 9
write(1, " structure\n", 11) = 11
mmap(NULL, 91574272,
2008 Jan 29
2
Problem with new("externalptr")
Hi,
It seems that new("externalptr") is always returning the same instance, and
not a new one as one would expect from a call to new(). Of course this is hard
to observe:
> new("externalptr")
<pointer: (nil)>
> new("externalptr")
<pointer: (nil)>
since not a lot of details are displayed.
For example, it's easy to see that 2
2012 Apr 13
1
Coding columns for survival analysis
Hello Folks,
I have 5 columns for thousands of tree records that record whether that
tree was alive or dead. I want to recode the columns such that the cell
reads "found" when a live tree is first observed, "alive" for when a
tree is found alive and is not just found, and "mort" when it was
previously alive but is now dead.
Given the following:
> tree_live
2014 Aug 04
6
[hivex] Segfault for an integer value to node_set_value
Hi,
When an integer argument is passed as value, node_set_value
segfaults. Reproducer is at the end of this message
The backtrace points at hivex-py.c, function get_value. While obj
is non-NULL, `bytes = PyUnicode_AsUTF8String (obj);` returns NULL.
Kind regards,
Peter
https://lekensteyn.nl
#!/usr/bin/env python3
import hivex, sys
h = hivex.Hivex(sys.argv[1])
print(h)
val = {
2014 Aug 16
7
[hivex] [PATCH 0/6] Python fixes for node_set_value
Hi,
This patch series is based on a prior patch[1], splitting off changes as
requested and incorporating feedback from Richard Jones. It introduces type
validation to avoid segmentation faults (instead, it reports an exception) and
fixes handling of the bytes type in Python 3.
Major changes since that series:
- Drop newly introduced support for integer types for DWORD/QWORDS
- Reject Unicode
2012 Dec 25
2
reinterpreting externalptr in R
Hi,
I am using swig to build a wrapper for an c-function to use it in R. I would
like to define a generic function, which gives back a void pointer. On the R
side, I know what this pointer is pointing to, whether it is an integer or
an string, or something else... but I need to somehow reinterpret the
resulting "externalptr" into another form...
a function that looks like the
2016 Sep 15
1
Finalizer execution order question
Given an externalptr object 'pool' which protects an R object 'prot':
# SEXP prot = (a dynamically updated list with handles)
SEXP pool = R_MakeExternalPtr(p, R_NilValue, prot);
R_RegisterCFinalizerEx(pool, fin_pool, TRUE);
WRE explains that 'prot' remains in existence as long as 'pool' is
around. Does this also mean 'prot' still exists when the
2012 Oct 02
1
ffsave problems
Dear R friends.
After having some troubles learning how to create a ffdf object, now I find
myself having problems saving it.
this is the data i´d like to save:
str(DATA)
List of 3
$ virtual: 'data.frame': 6 obs. of 7 variables:
.. $ VirtualVmode : chr "double" "short" "integer" "integer" ...
.. $ AsIs : logi FALSE FALSE FALSE
2012 May 11
1
Passing externalptr to .C()
Greetings.
2.15.0 added this behavior
http://developer.r-project.org/blosxom.cgi/R-devel/NEWS/2012/03/29#n2012-03-29
o Passing R objects other than atomic vectors, functions, lists and
environments to .C() is now deprecated and will give a warning.
Most cases (especially NULL) are actually coding errors. NULL
will be disallowed in future.
This seems to make sense,
2018 Mar 18
3
`@<-` modify its argument when slot is externalptr
Dear all,
I am confused about the inconsistent behaviors of `@<-` operator when
used in different ways. Consider the following example:
library(inline)
# Function to generate an externalptr object with random address
new_extptr <- cfunction(c(), '
SEXP val = PROTECT(ScalarLogical(1));
SEXP out = PROTECT(R_MakeExternalPtr(&val, R_NilValue, val));
UNPROTECT(2);
2016 Feb 14
2
hivex lib: Add function hivex_node_num_children
Hello,
I've been working on a graphical registry hive editing tool in Qt
using the hivex C library.
While creating it, I noticed that in order to determine if an
expansion element should be shown on a node, you have to determine if
a node has any children.
Currently, in order to determine if a node has any children, you must
find every child with hivex_node_children, which is a relatively
2009 May 10
2
In C, a fast way to slice a vector?
Hello,
Suppose in the following code,
PROTECT(sr = R_tryEval( .... ))
sr is a RAWSXP vector. I wish to return another RAWSXP starting at
position 13 onwards (base=0).
I could create another RAWSXP of the correct length and then memcpy
the required bytes and length to this new one.
However is there a more efficient method?
Regards
Saptarshi Guha
2011 Oct 13
1
Package snow: is there any way to check if a cluster is "acticve"
Is there a 'proper' way of checking if cluster is active. For example, I create a cluster called .PBcluster
> str(.PBcluster)
List of 4
$ :List of 3
..$ con :Classes 'sockconn', 'connection' atomic [1:1] 3
.. .. ..- attr(*, "conn_id")=<externalptr>
..$ host: chr "localhost"
..$ rank: int 1
..- attr(*, "class")= chr
2011 Apr 27
2
[PATCH] hivex/python fix for i386 integer size issue
Hi,
While working on Debian packages of hivex 1.2.5, I came across a test
failure for the Python bindings with Python 2.7 on the i386
architecture. (The tests ran fine on amd64.)
,----
| $ make -C python check
| make[1]: Entering directory `/home/bengen/src/deb/hivex/hivex.git/python'
| 010-import.py
| 020-open.py
| 021-close.py
| 200-write.py
| python: hivex-py.c:52: get_handle: Assertion
2010 Jul 03
1
[PATCH] hivex: add hivex_set_value api call and perl bindings, tests
Added Perl binding glue and a simple test along the lines of present
tests.
(And again: I'm not on the list, please CC me on replies. Thanks!)
---
generator/generator.ml | 62 +++++++++++++++++++++++++++++++--
lib/hivex.c | 90 ++++++++++++++++++++++++++++++++++++++++++++++++
perl/t/201-setvalue.t | 54 ++++++++++++++++++++++++++++
3 files changed, 203 insertions(+), 3
2020 Apr 03
4
The finalizer of the externalPtr does not work when closing R?
Hi all,
I found that the finalizer of the externalPtr is not called when R is
quitting. However, manually calling GC() works fine. This behavior is
observed on devel R 2020-04-02 r78142 on Win and R 3.6.3 on Ubuntu. I make
a reproducible package here: https://github.com/Jiefei-Wang/example
Here is the detail of how to reproduce the problem, I create a temporary
file in the package root path and
2009 Oct 27
1
Rjava, RImageJ, and/or S4 question.
I am out of my league with this question. The following code starts the java imaging program ImageJ from within R, and displays an image (assuming ImageJ is installed on your computer).
library(RImageJ)
img <- IJ$openImage( file.choose() ) #pick an available .tif file
img$show() # make the image object visible
# An image is now displayed
# find out about the objects involved
>