[Rd] R FAQ 2.6, 7.21

Ivan Krylov |kry|ov @end|ng |rom d|@root@org
Thu Jul 4 11:43:06 CEST 2024


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},
+ using code{result3}, and so on: instead of fighting against the language to
+use
 
+ using example
+# 'i'th result <- process('i'th dataset)
+assign(paste0("result", i), process(get(paste0("dataset", i))))
+ using end example
+
+it is much easier to put the related variables in lists and use
+
+ using example
+result[[i]] <- process(dataset[[i]])
+ using end example
+
+and, eventually,
+
+ using example
+result <- lapply(dataset, process)
+ using 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



More information about the R-devel mailing list