similar to: Coding style query (braces)

Displaying 20 results from an estimated 10000 matches similar to: "Coding style query (braces)"

2007 Mar 16
1
Rownames are always character?
Gurus, Can I rely on the rownames() function, when applied to a matrix, always returning either NULL or an object of type character? It seems that row names can be entered as integers, but as of now (R 2.4.1 on Windows) the function returns character vectors, not numbers (which is my desired result). I am using elements of the returned vector to index the matrix. e.g., nams <-
2003 May 30
3
Time for Usenet R Group?
I probably shouldn't suggest this, because I can't volunteer to implement it. However, I bring it up in the hopes that if (1) others agree and (2) the R core group think it a good idea that a suitable volunteer will come forward. I am finding that the flood of R email messages is becoming difficult to deal with, even using filters, etc., in my email client. Would we be better
2008 May 30
4
Request: Documentation of formulae
In working through material on p.272 of MASS (4th ed.), I came across the following model formula: pet1.lm <- lm(Y ~ No/EP - 1, Petrol) I was at a loss to understand the use of "/" until I looked in "An Introduction [!] to R," where I found the explanation. My request is that more complete material on model formulae be lifted from "Introduction to R" (or
2007 Jan 24
4
Text position in Traditional Graphics
R 2.4.1 on Windows XP. Question: In traditional graphics, is it possible to find out the height of a line of text in units that can be used in arithmetic and then in calls to text()? Context: I have written a function that draws a plot and then, depending on whether some arguments are TRUE or FALSE, draws various lines of text in the plot. The text lines may be turned on or off individually
2008 Dec 31
3
Plotmath with values?
I hope to use the plotmath facility to print titles that mix math and values of R variables. The help for "plotmath" has an example, which after repeated reading, I find baffling. Likewise, I have read the help file for "substitute" (wqhich seems to be needed) without ever understanding what it does, other than being used in some magic incantations. I would like to do
2007 Feb 28
1
Help with "row.names = as.integer(c(NA, 5))" in file from dput
I am trying to understand why syntax used by dput() to write rownames is valid (say, when read by dget()). I ask this because I desire to emulate its actions *reliably* in my For2R routines, and I won't be comfortable until I understand what R is doing. Given data set "fred": > fred id var1 1 1991 0.4388587 2 1992 0.8772471 3 1993 0.6230486 4 1994 0.2340929 5 1995
2002 Dec 23
1
Plot scales
I remember reading somewhere that locations on plots (in my case, arguments x and y for legend()) can be specified in several scales besides the usual data scale. I would like to set x and y as proportions of total plot size or something similar. Can anyone steer me to documentation on how to do it? -- Michael Prager, Ph.D. <Mike.Prager at noaa.gov> NOAA Center for
2002 Aug 08
1
PR #1833 Clarification (PR#1890)
This is (correctly) filed under "non-reproducible." The corresponding notes say "solved by re-installing Windows (private comm)." I would like to clarify that this was solved by re-installing the patch known as "Windows 2000 Service Pack 2," not by reinstalling Windows itself. Perhaps my original message was not clear. I point this out because installing the
2003 Oct 18
2
Oceanographic lattice plots?
R 1.8.0 on Windows XP Professional. A huge THANK YOU to the R Team for this marvelous software. I am making lattice plots of oceanographic data. The usual layout does not conform to plotting conventions that marine scientists use when depth is the independent variable. Under those conventions, plots are made with the origin at the upper left, depth on the vertical axis (increasing as it
2004 Jul 15
3
More on global environment
To follow up on my previous question, suppose a user R session wants to unload one workspace and load another within an R session. Is the following the correct sequence? 1. save.image() to save the current workspace as .Rdata in the current working directory. 2. rm(list=ls()) to remove everything from the workspace. 3. setcwd("xxx") to set the new working directory. 4.
2004 Jul 15
4
Where is global environment?
I am using R 1.9.1 under Windows XP Professional. Is there any R function that returns the filesystem path from which the global environment (workspace) was loaded (and to which it will, by default, be saved)? This seems identical with the current directory, so in any given session it is not too difficult to find out by other means. But for several reasons I would like to find this out from
2005 Dec 20
4
Installing packages into updated R
A minor inconvenience in updating an R installation is remembering which packages were installed previously. Has anyone written a script to inspect a previous installation, then get & install the same packages into the new installation? -- Michael Prager NOAA Center for Coastal Fisheries and Habitat Research Beaufort, North Carolina 28516 Opinions expressed are personal, not official.
2002 Jul 16
1
Minor GUI Issues
Some minor request for the R on Windows (2000) GUI version. I'm using 1.5.1 with the SDI interface. (1) When minimized, the main R window and the graphics window show as two copies of the same icon. That makes it less convenient to switch among tasks in Windows, as I often select the wrong one. Could they have different icons in the future, please? (2) I use a fixed-width Type 1 font
2002 Jul 16
1
Minor GUI Issues
Some minor request for the R on Windows (2000) GUI version. I'm using 1.5.1 with the SDI interface. (1) When minimized, the main R window and the graphics window show as two copies of the same icon. That makes it less convenient to switch among tasks in Windows, as I often select the wrong one. Could they have different icons in the future, please? (2) I use a fixed-width Type 1 font
2006 Sep 11
1
Command equivalent of rgui "File, Save to File"?
R 2.3.1 on Windows XP Professional. I am writing some scripts to generate examples. The Rgui menu item "File, Save to File" is helpful. Is there perhaps an equivalent R function that can be incorporated into a script? Mike Prager Southeast Fisheries Science Center, NOAA Beaufort, North Carolina USA
2006 Oct 28
2
Package development on Windows - latest guidance?
I would like to start building R packages under Windows XP. I have programming experience and a minimal but working knowlege of many Unix (-like) programming tools. The package functions (for now) will be from R source, not C or Fortran. I've installed Rtools, Perl, the MS hhc, and so on. I am setting up a command shell with the correct PATH for building packages. (The master Windows PATH
2007 Mar 20
2
Ticks on barplots
Dear Gurus, Using R 2.4.1 on Windows XP I am generating stacked barplots of age-composition of fish populations (Y) over time (X). As there are many years, not every bars is labeled. When looking at the plot, it becomes difficult to associate labels with their bars. We have improved this a bit by using axis() to add a tickmark below each bar. Can anyone suggest a way to draw ticks ONLY
2006 Oct 24
0
X2R: R-compatible output routines from C, ADMB, Fortran to R
We announce the availability of three related software libraries: C2R, ADMB2R, and For2R (together, X2R). Each contains output routines to simplify transfer of complicated data structures from models written in a compiled language to R. The user's data can be written as a structured ASCII file which, when read by R (note 1) with a single dget() function call, will become an R data object
2006 Oct 24
0
X2R: R-compatible output routines from C, ADMB, Fortran to R
We announce the availability of three related software libraries: C2R, ADMB2R, and For2R (together, X2R). Each contains output routines to simplify transfer of complicated data structures from models written in a compiled language to R. The user's data can be written as a structured ASCII file which, when read by R (note 1) with a single dget() function call, will become an R data object
2007 Mar 01
0
Update of X2R sent to CRAN
A new version of X2R has just been uploaded to CRAN. It should be available at mirrors within a few days. This contains revisions to the For2R component to fix a bug in which data frames were not written correctly if the user did not pass row labels. The new version is supplied as files X2R.zip and X2R.tar.gz, which are equivalent. The version can be identified from the contents of file