Displaying 20 results from an estimated 30000 matches similar to: "Using the ``...'' argument."
2007 Oct 03
3
Factor levels.
I have factors with levels ``Unit", "Achieved", and "Scholarship"; I
wish to replace these with
"U", "A", and "S".
So I do
fff <- factor(fff,labels=c("U","A","S"))
This works as long as all of the levels are actually present in the
factor. But if ``Scholarship'' is absent
(as if often is) then
2006 Mar 17
1
Derivative of a splinefun function.
Is there a way of calculating the derivative of a function returned
by splinefun()? Such a function is a cubic spline, whence it has a
calculable derivative, but is there a (simple) way of getting at it?
One workaround that I have thought of is to take a fine grid of
points, evaluate the function returned by splinefun() at these
points, put an interpolating spline through these points using
2006 Mar 23
3
Intercepts in linear models.
A colleague asked me if there is a way to specify with a
***variable*** (say ``cflag'') whether there is an intercept in a
linear model.
She had in mind something like
lm(y ~ x - cflag)
where cflag could be 0 or 1; if it's 0 an intercept should
be fitted, if it's 1 then no intercept.
This doesn't work ``of course''. The cflag just gets treated
as another predictor
2006 May 29
2
newbie question: ROW average
Dimitris Rizopoulos wrote:
> look at ?rowMeans; you can also use "apply(mat, 1, mean)" but
> rowMeans() is better.
By my reading of the question, this is not what
Ezhil wants. He said:
``I have a 992 x 74 matrix. I would like to form a new matrix
by averaging each 4 rows from the original one.''
I.e. he wants (I think) the first row of the new matrix
to be the
2002 Apr 04
1
PR#1132.
Just now I again had occasion to want nested describe lists in a
documentation file. I found that the bug which I reported on 18
October, 2001 still persists. I checked on the bug report at the R
web page, and found that the notes say ``Not a problem in R 1.4.0
(2001-12-08)''.
Well, it's still a problem for me --- using R 1.4.1.
(Details:
platform sparc-sun-solaris2.7
arch
2003 Apr 21
4
help.start in R-1.7.0 with Netscape 7.0.
I'm experiencing a new and annoying phenomenon which seems to consist
of an unfortunate interaction between R-1.7.0 and netscape version 7.
When I invoke help.start(), a netscape window duly appears
with the browser pointed at the file .../R/doc/html/index.html
as one would hope and expect.
However if I then ask for help on a function, e.g.
> help(glm)
the help does NOT get displayed
2011 Jan 11
1
how to sort new data frame based on the original data frame
I have a really simple question
I have a data frame of 8 variables (the first column is the subjects' id):
SubID G1 G2 G3 G4 W1 W2 W3 W4
1 6 5 6 2 6 2 2 4
2 6 4 7 2 6 6 2 3
3 5 5 5 5 5 5 4 5
2002 Apr 11
2
Obtaining names of ``...'' arguments.
This may be an FAQ, but a (perfunctory) search failed to turn it up.
Suppose I have a function foo(...){<something>} and I want to obtain,
inside foo, the names of items comprising the ``...''. E.g. if I
call
foo(melvin,clyde,irving)
I want to be able to loop through the ``...'' and successively obtain
the text strings "melvin", "clyde", and
2005 Jun 06
1
Missing values in argument of .Fortran.
I wish to pass a vector ``y'', some of whose entries are NAs to a
fortran subroutine which I am dynamically loading and calling by
means of .Fortran(). The subroutine runs through the vector entry by
entry; obviously I want to have it do one thing if y[i] is present
and a different thing if it is missing.
The way I am thinking of proceeding is along the xlines of:
ymiss <- is.na(y)
2010 Nov 10
2
Centring titles for pairs of plots.
I would like to centre titles for pairs of plots in a 3-x-2
array. Each row of the array corresponds to a calendar year
and I would like to have the year value centred between the
two plots in the row, and just above their upper edges.
I have attached an example in "demo.pdf" showing roughly
what I want. I managed to produce the example using
2011 Nov 03
2
Problem with R CMD check and the inconsolata font business.
I have just installed R version 2.14.0 and tried to re-build and
re-check some
of the packages that I maintain.
I'm getting a warning (in the process of running R CMD check on my "deldir"
package):
> * checking PDF version of manual ... WARNING
> LaTeX errors when creating PDF version.
> This typically indicates Rd problems.
> LaTeX errors found:
> ! Font
2006 May 21
3
normality testing with nortest
I don't know from the nortest package, but it should ***always***
be the case that you test hypotheses
H_0: The data have a normal distribution.
vs.
H_a: The data do not have a normal distribution.
So if you get a p-value < 0.05 you can say that
***there is evidence***
(at the 0.05 significance level) that the data are not from a
normal distribution.
If the nortest package does
2006 Nov 25
3
OT: P(Z <= -1.46).
In checking over the solutions to some homework that I had assigned I
observed the fact that in R (version 2.4.0) pnorm(-1.46) gives
0.07214504. The tables in the text book that I am using for the
course give the probability as 0.0722.
Fascinated, I scanned through 5 or 6 other text books (amongst the
dozens of freebies from publishers that lurk on my shelf) and found
that some agree with R
2005 Apr 19
3
Ranking within a classification variable.
Suppose I have a data frame with two columns ``district'' and
``score'' --- score is numeric; district may be considered
categorical.
I wish to append to this data frame a third column whose entries are
the ranks of ``score'' ***within*** district.
I've tried fiddling about with tapply() and by() but the result is a
list whose i-th component consists of the ranks of
2002 Sep 03
2
Version 1.5.1 failing make check.
I just tried to install R version 1.5.1, and it is failing
``make check'', as follows:
$ make check
`Makedeps' is up to date.
running code in 'base-Ex.R' ...*** Error code 1
make: Fatal error: Command failed for target `base-Ex.Rout'
Current working directory /home1/faculty/rolf/Traal/Rtmp/R-1.5.1/tests/Examples
*** Error code 1
make: Fatal error: Command failed for target
2007 Apr 24
1
regarding 3d Bar Plot --- correction.
I mis-spoke. It seems I had two collections of functions in the same
directory. One by Colin Goodall, and one by David Scott (I have no
record of where he is/was located). It is the *latter* collection
that does all its work from within Fortran.
I'll have another look at what Colin Goodall actually wrote to see if
it could be useful to guarav.
cheers,
Rolf Turner
rolf at
2005 Jun 02
2
Caution on the use of model.matrix.
I have just been bitten by a quirk in the behaviour of model.matrix.
I used model.matrix inside a function, and passed to it a formula
that was built elsewhere.
The formula was of the form ``y ~ x + w + z''. Now, model.matrix
cheerfully accepts formulae of this form, although it only
***needs*** the right hand side, i.e. ``~ x + w + z'' --- the ``y''
can be dropped (but
2006 Apr 27
1
Symbol __f95_sign not found.
Our computing services people have recently reconfigured the Sun
compilers structure on our network, and I can no longer install, on
our Sun/Solaris machine, a certain package (spatstat) with which I am
heavily involved. (The same problem may well pertain to other
packages as well; I haven't yet experimented except with spatstat.)
Strictly speaking I can ***install*** it, but when I try
to
2001 Dec 20
2
library()
I've just installed version 1.4.0 of R, and am experiencing
a puzzling phenomenon with the library() function.
I have .lib.loc set as follows:
> .lib.loc
[1] "/usr/local/lib/R/library" "/home/faculty/rolf/Rlib"
If I invoke
> library(melvin)
I get the error message
Error in library(melvin) : There is no package called `melvin'
but if I invoke
>
2006 May 17
3
Off topic --- help in locating a source.
Apologies for the off-topic question; as usual I'm trying to draw
upon the unparalleled knowledge and sagacity of the r-help list.
Please reply off-list if you can help me out.
A collaborator of mine found a formula we need, on sheets which he had
photocopied out of a book, some years ago. He cannot remember which
book (he's getting to be as senile and forgetful as I am, poor
bloke!).