From |kry|ov @end|ng |rom d|@root@org  Thu Jul  4 11:43:06 2024
From: |kry|ov @end|ng |rom d|@root@org (Ivan Krylov)
Date: Thu, 4 Jul 2024 12:43:06 +0300
Subject: [Rd] R FAQ 2.6, 7.21
Message-ID: <20240704124306.41fb029f@trisector>

Hello R-devel,

I would like to suggest a couple of updates for the R FAQ.

https://CRAN.R-project.org/bin/linux/suse is currently empty and the
directory has mtime from 2012, so it probably doesn't help to reference
it in FAQ 2.6.

There seems to be increased interest in using variables as variable
names [1,2], so it might be useful to expand 7.21 a little. Can an R
FAQ entry link to R-intro section 6.1?

Index: doc/manual/R-FAQ.texi
===================================================================
--- doc/manual/R-FAQ.texi	(revision 86871)
+++ doc/manual/R-FAQ.texi	(working copy)
@@ -503,9 +503,6 @@
 @abbr{RPM}s for @I{RedHat Enterprise Linux} and compatible distributions (e.g.,
 @I{Centos}, Scientific Linux, Oracle Linux).
 
-See @url{https://CRAN.R-project.org/bin/linux/suse/README.html} for
-information about @abbr{RPM}s for openSUSE.
-
 No other binary distributions are currently publicly available via
 @CRAN{}.
 
@@ -2624,8 +2621,31 @@
 @end example
 
 @noindent
-without any of this messing about.
+without any of this messing about. This becomes especially true if you
+are finding yourself creating and trying to programmatically access
+groups of related variables such as @code{result1}, @code{result2},
+ at code{result3}, and so on: instead of fighting against the language to
+use
 
+ at example
+# 'i'th result <- process('i'th dataset)
+assign(paste0("result", i), process(get(paste0("dataset", i))))
+ at end example
+
+it is much easier to put the related variables in lists and use
+
+ at example
+result[[i]] <- process(dataset[[i]])
+ at end example
+
+and, eventually,
+
+ at example
+result <- lapply(dataset, process)
+ at end example
+
+which is easy to replace with @code{parLapply} for parallel processing.
+
 @node Why do lattice/trellis graphics not work?
 @section Why do lattice/trellis graphics not work?
 


-- 
Best regards,
Ivan



[Rd] R FAQ 2.6, 7.21
Ivan Krylov