Displaying 2 results from an estimated 2 matches for "treeapply".
2004 Nov 17
1
OOP pkg compilation failure
...g on rw_2.0.0 WIN XP SP2 platform).
Thanks in advance
---transcript----
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\...\>R CMD INSTALL OOP.tar.gz
---------- Making package OOP ------------
adding build stamp to DESCRIPTION
making DLL ...
making treeApply.d from treeApply.c
gcc -Ic:/R/rw2000/include -Wall -O2 -c treeApply.c -o treeApply.o
ar cr OOP.a treeApply.o
ranlib OOP.a
windres --include-dir c:/R/rw2000/include -i OOP_res.rc -o OOP_res.o
gcc --shared -s -o OOP.dll OOP.def OOP.a OOP_res.o
-Lc:/R/rw2000/src/gnuwin32 -lg2c -lR
... DLL...
2002 Jun 13
2
Summary: recursion over list
...[i]] else list(x[[i]]))
}
return(result)
}
This function might be usefull for some purpose, but again not mine. (as
the result is a concatenation, it can't deal matrices or functions).
- Thomas Lumley proposes a version that allows to do the same job without
having to flatten the list:
treeapply<-function (x, FUN)
{
if (is.atomic(x)) FUN(x)
else lapply(x, function(n) treeapply(n, FUN))
}
Once again, all elements are not handled: I am considering any possible
list: a list containing a function would not be handled.
- Finally, I have to thank particularly Mark Bravington, for hi...