search for: mapcar

Displaying 8 results from an estimated 8 matches for "mapcar".

2000 Mar 20
1
Elementwise c() for lists
I have two lists of equal lengths. Each one consists of vectors. Is there an elegant way to combine them elementwise? Elegant means: without loops. For instance, for > jja_list(1:3,4:7) > jjb_list(rep(0,4),(2,5)) I would like to get: > list(c(1:3,rep(0,4)),c(4:7,rep(2,5))). --- D.Trenkler --- ************************************************************************ *********
2003 Jun 24
0
help on R programming.
...s NULL. > > is there a better way to set up such an object list data > structure that > will allow me to do this? try sapply(object.list, function (element) element$x) (I come from a Lisp background, so this seems natural to me. There may be better ways! *sighs with fond memories of mapcar and lambda*) > > - what is the correct way to -remove- a component from a list. this > seems to do the trick: list[[1]] = NULL, however, you'd think this > should simply attach a NULL object at the first component position? You'd think that, but you would be wrong. :-). To ad...
2000 Mar 10
1
variable name to hist within apply?
Hello, After spending sometime trying to generate histograms of all the numeric variables in a data frame using a for loop, I realized I could use apply to create the histograms. This was one of those few moments when I `see' the alternative to looping. So, I can generate all the histograms with this command: apply(toblo.df[,-c(40,52)],2,hist) # 40 and 52 are ID's When I do this, the
2010 Nov 12
0
Installing R+Emacs+MikTeX editor on a USB drive
...Create a directory called "home" in the USB drive a put your ".emacs" file in it. It should contain the following lines: (defvar usb-site-lisp-dir (expand-file-name "site-lisp" usb-home-dir)) (setq load-path (cons usb-site-lisp-dir load-path)) (let ((dir (delete nil (mapcar (lambda (f) (unless (string-match "\\.elc?\\'" f) f)) (cddr (directory-files usb-site-lisp-dir t)))))) (setq load-path (append dir load-path))) ;;portable emacs will know about portable R (setq inferior-R-program-name (concat usb-home-dir "../R/R-2.11.1/bin/Rter...
2003 Feb 13
5
position of an element in a vector
Hello. Sorry for the elementary post. I've looked through the documentation, but can't seem to find a function which allows one to extract the position of an element within a list...for example the position of the element 4 in the vector c(1,2,4,3,6) is 3. Thanks much for any help. Jason
2015 Jan 05
2
[LLVMdev] [PATCH] Fix Emacs package formatting
...) - "Syntax highlighting for LLVM" + "Syntax highlighting for LLVM." ) ;; ---------------------- Syntax table --------------------------- @@ -62,40 +67,40 @@ (if (not llvm-mode-syntax-table) (progn (setq llvm-mode-syntax-table (make-syntax-table)) - (mapcar (function (lambda (n) - (modify-syntax-entry (aref n 0) - (aref n 1) - llvm-mode-syntax-table))) - '( - ;; whitespace (` ') - [?\^m...
2008 Aug 22
2
Sending "..." to a C external
I'm trying to figure this out with "Writing R Extensions" but there's not a lot of detail on this issue. I want to write a (very simple really) C external that will be able to take "..." as an argument. (It's for optimizing a function that may have several parameters besides the ones being optimized.) I got the "showArgs" code (from R-exts) to compile and
2017 Sep 22
3
gtk3 update causing havoc
On my lab systems, the automatic updates were failing because of the problems with ipod libraries from EPEL being in the way. It turns out that was a good thing, because when I "fixed" it, a massive set of packages was updated, including the new gtk3. These packages are the ones causing problems, I think. gtk3-3.22.10-4.el7.x86_64 gtk3-devel-3.22.10-4.el7.x86_64 In the release notes,