Displaying 20 results from an estimated 6000 matches similar to: "Accessing just the value of an object but not the attributes"
2001 Nov 12
3
Plotting symbols
Has anyone got a cute way of compiling a table of the available plotting
symbols?
I've been repeatedly pasting in
cno <- cno + 1
cno
plot(x,y,pch=cno)
which is tedious, and besides I have to note down the symbols by hand.
Dr Murray Jorgensen http://www.stats.waikato.ac.nz/Staff/maj.html
Department of Statistics, University of Waikato, Hamilton, New Zealand
Email: maj at
2001 May 22
2
MASS data sets
I'm running R 1.2.2 under windows 98 on a Pentium 133 laptop.
I can't seem to retrieve the package MASS data sets:
> library(MASS)
> data(wtloss)
Warning message:
Data set `wtloss' not found in: data(wtloss)
> data(abbey)
Warning message:
Data set `abbey' not found in: data(abbey)
And yet all the .rda files for the MASS datasets are in
D:\Program
2001 Sep 18
2
Error mean square
If rb.lm is an lm-object, I can access the error mean square as
s2 <- sum(rb.lm$residuals^2)/rb.lm$df.residual
This seems a bit like hard work for such a commonly wanted quantity. Is
there a better way to do this?
Murray Jorgensen
Dr Murray Jorgensen http://www.stats.waikato.ac.nz/Staff/maj.html
Department of Statistics, University of Waikato, Hamilton, New Zealand
Email: maj at
2010 Jul 27
4
Sweave and scan()
I am introducing the scan() function to my class. Consider the following
file (Scanexamp.Rnw )
\documentclass[12pt]{article}
\begin{document}
<<>>=
height = scan()
64 62 66 65 62
69 72 72 70
part = scan(what = character(0))
"Soprano" "Soprano" "Soprano"
"Alto" "Alto" "Tenor"
"Tenor" "Bass"
2003 Sep 17
5
Quit asking me if I want to save the workspace!
How do you stop R from putting up a dialog box when you quit Rgui?
(I use Windows and I never save workspaces that way)
Murray
--
Dr Murray Jorgensen http://www.stats.waikato.ac.nz/Staff/maj.html
Department of Statistics, University of Waikato, Hamilton, New Zealand
Email: maj at waikato.ac.nz Fax 7 838 4155
Phone +64 7 838 4773 wk +64 7 849 6486 home
2006 Apr 14
5
vector-factor operation
I found myself wanting to average a vector [vec] within each level of a
factor [Fac], returning a vector of the same length as vec. After a
while I realised that
lm1 <- lm(vec ~ Fac)
fitted(lm1)
did what I want.
But there must be another way to do this, and it would be good to be
able to apply other functions than mean() in this way.
Cheers, Murray
--
Dr Murray Jorgensen
2003 Dec 30
4
Assignments in loops
Greetings all. Any help with the following would be appreciated.
I want to create a data frame for each file in a directory. The following
code does not work but it may show what I am trying to do:
carmakes <- c('BMW','Chrysler','Citroen','Fiat','Ford','Holden','Honda',
2003 Aug 20
5
Interlacing two vectors
I want to interlace two vectors. This I can do:
> x <- 1:4
> z <- x+0.5
> as.vector(t(cbind(x,z)))
[1] 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5
but this seems rather inelegant. Any suggestions?
Murray
--
Dr Murray Jorgensen http://www.stats.waikato.ac.nz/Staff/maj.html
Department of Statistics, University of Waikato, Hamilton, New Zealand
Email: maj at waikato.ac.nz
2003 Sep 23
2
R-project [.com?] [.net?]
I got a shock a few days ago when I accidentally visited
www.r-project.com . I thought that the r-project site had been hacked
until I realised my mistake. There is also a site www.r-project.net.
Both of these sites appear to be Japanese. Does anyone know anything
about them? I suppose that it is not unusual for names close to those of
popular sites to be used. It is good that they use a
2011 Jan 05
4
Converting Fortran or C++ etc to R
I'm going to try my hand at converting some Fortran programs to R. Does
anyone know of any good articles giving hints at such tasks? I will post
a selective summary of my gleanings.
Cheers, Murray
--
Dr Murray Jorgensen http://www.stats.waikato.ac.nz/Staff/maj.html
Department of Statistics, University of Waikato, Hamilton, New Zealand
Email: maj at waikato.ac.nz
2004 Apr 21
2
Rgui front-end has encountered a problem and needs to close
Well I don't know if anyone can help with this but it will be
interesting to know if others have had the same problem.
I can't start R at home on my laptop [ I'm using 1.8.1 under Windows
XP]. When I click on the shortcut I get the usual Windows box for when
an application needs to close. A couple of clicks down it displays the
following:
Error signature
AppName: rgui.exe
2006 Nov 13
2
A printing "macro"
I am exploring the result of clustering a large multivariate data set
into a number of groups, represented, say, by a factor G.
I wrote a function to see how categorical variables vary between groups:
> ddisp <- function(dvar) {
+ csqt <- chisq.test(G,dvar)
+ print(csqt$statistic)
+ print(csqt$observed)
+ print(round(csqt$expected))
+ round(csqt$residuals)
+ }
>
> x
2008 Aug 26
2
lattice plotting character woes
The following reproducable code shows the setting of my problem:
set.seed(260808)
n = 50
x = rnorm(n)
y = rnorm(n)
z = ceiling(runif(n,0,4))
g = runif(n,0,6)
G = factor(ceiling(g))
xyplot(y ~ x | G)
plsy <- trellis.par.get("plot.symbol")
plsy$pch = z
trellis.par.set("plot.symbol",plsy)
xyplot(y ~ x | G)
plsy$pch = as.character(z)
2004 Jul 07
6
text editor for R
Hi,
What is the best text editor for programming in R? I am using JEdit as the
text editor, however, it does not have anything specific for R. It will be
nice to have a developing environment where the keywords are highlighted,
plus some other debugging functions.
Yi-Xiong
[[alternative HTML version deleted]]
2004 Apr 24
5
Modalwert
Hai -
kann mir jemand sagen, wie ich den Modalwert in R berechne?! IRgendwie finde
ich den Befehl nicht....
greetz und herzlichen Dank
Sonja
2008 Mar 02
2
Recommended Packages
Having just update to R 2.6.2 on my old Windows laptop I notice that the
number of packages is growing exponentially and my usual approach of
get-em-all may not be viable much longer. Has any thought been given to
dividing "contributed" binaries into a recommended set, perhaps a couple
of hundred, and the remained. That way one could install the recommended
ones routinely and add in
2003 Mar 19
3
r-help using random generating
To whom it may concern:
Given that my sample size is n, my mean is 100, and my sd is 10, I need to
use a random number generator (which I believe is the function
rnorm(5,100,10)), but I need to repeat it a large number of times, and then
plot the sampling distributions of the sample means, sd's, and variances of
those generated sets. I'm having a real hard time trying to figure out how
2000 Sep 24
2
FW: Crosstabulation
how about this: tapply(vector,list(factor1,factor2),function)?
-----Original Message-----
From: owner-r-help at stat.math.ethz.ch
[mailto:owner-r-help at stat.math.ethz.ch]On Behalf Of Murray Jorgensen
Sent: 24. september 2000 02:46
To: R-help
Subject: [R] Crosstabulation
I can't seem to find a function in R similar to Splus crosstabs() for
creating a multi-way table from factors and a
2006 Aug 01
4
Fitting models in a loop
If I want to display a few polynomial regression fits I can do something
like
for (i in 1:6) {
mod <- lm(y ~ poly(x,i))
print(summary(mod))
}
Suppose that I don't want to over-write the fitted model objects,
though. How do I create a list of blank fitted model objects for later
use in a loop?
Murray Jorgensen
--
Dr Murray Jorgensen
2006 Jun 05
1
Extracting Variance components
I can ask my question using and example from Chapter 1 of Pinheiro & Bates.
> # 1.4 An Analysis of Covariance Model
>
> OrthoFem <- Orthodont[ Orthodont$Sex == "Female", ]
> fm1OrthF <-
+ lme( distance ~ age, data = OrthoFem, random = ~ 1 | Subject )
> summary( fm1OrthF )
Linear mixed-effects model fit by REML
Data: OrthoFem
AIC BIC