Displaying 10 results from an estimated 10 matches for "richard_raubertas".
2003 Aug 15
6
plot.lm mislabels points with na.exclude (PR#3750)
R 1.7.1 on Windows XP
The "normal Q-Q plot" produced by plot.lm() mislabels points
when the model is fitted using na.action=na.exclude. Example:
x <- 1:50
y <- x + rnorm(50)
y[c(5,10,15)] <- NA # insert some NA's
y[40] <- 50 # add an outlier
plot(lm(y ~ x, na.action=na.omit)) # outlier correctly labeled in all
# four plots
2003 Jul 21
2
Bug in file.copy: overwrite=FALSE ignored (PR#3529)
I am using R 1.7.1 on Windows XP Pro.
The 'overwrite=FALSE' argument appears to be ignored in
file.copy():
> file.exists(c("file1.txt", "file2.txt"))
[1] TRUE TRUE
> file.copy(from="file2.txt", to="file1.txt", overwrite=FALSE)
[1] TRUE
>
and sure enough, file1.txt has been overwritten.
Rich Raubertas
Biometrics Research, RY33-300
Merck
2002 Apr 23
2
Bug in read.table() (PR#1477)
The following command,
temp <- read.table("c:/rfr/r/test.txt")
reads the text file "test.txt", which contains the following lines:
21437
21438
21419-2
21420-2
21421-2
21422-2
and produces the following result:
> temp
V1
1 21437+0i
2 21438+0i
3 0+0i
4 0+0i
5 0+0i
6 0+0i
>
These "numbers" are actually sample ID's, and I
2013 Jun 27
1
'modifyList' drops (not adds) NULL components
Dear list,
Utils::modifyList() drops NULL components in its second argument, instead of adding them to the first argument. Compare:
> modifyList(x=list(A=1), val=list(B=2, C=3))
$A
[1] 1
$B
[1] 2
$C
[1] 3
> modifyList(x=list(A=1), val=list(B=NULL, C=3))
$A
[1] 1
$C
[1] 3
To me this seems inconsistent with the documentation ("Elements in 'val' which are missing from
2004 Mar 18
0
sd(): why error with NA's?
R 1.8.1 with Windows XP.
I have a question about how sd() behaves with NA's:
> mean(c(1,2,3,NA))
[1] NA
> median(c(1,2,3,NA))
[1] NA
> mad(c(1,2,3,NA))
[1] NA
> sd(c(1,2,3,NA))
Error in var(x, na.rm = na.rm) : missing observations in cov/cor
>
What is so special about the standard deviation, relative to
other descriptive statistics, that the presence of NA's
deserves an
2009 Mar 04
0
'anova.gls' in 'nlme' (PR#13567)
There is a bug in 'anova.gls' in the 'nlme' package (3.1-90). The=20
bug is triggered by calling the function with a single 'gls' object=20
and specifying the 'Terms' argument but not the 'L' argument:
> library(nlme)
> fm1Orth.gls <- gls(distance ~ Sex * I(age - 11), Orthodont,
+ correlation =3D corSymm(form =3D ~ 1 |
2004 Aug 16
1
Dotplot with nested factors
I am using the dotplot function from the lattice package to
display a quantitative variable versus two factors, say 'a' and
'b'. The levels of 'a' are nested within levels of 'b'. The
issue is that dotplot includes all the levels of 'a' in each panel
(conditioning on 'b'), even though many are empty in any given
panel. A toy example is
dat
2003 Jul 21
1
Inconsistent handling of character NA?
[R 1.7.1 on Windows XP Pro]
Since R allows missing values for character variables, why
are NA's not propagated by character manipulation functions?
For example:
> temp <- c("a", NA)
> temp
[1] "a" NA
> is.na(temp)
[1] FALSE TRUE
> paste(temp[1], temp[2])
[1] "a NA"
> substr(temp, 1, 1)
[1] "a" "N"
>
2003 Jan 13
2
Bug in boxplot(..., add=TRUE) ?
R 1.6.1 on Windows NT4:
The boxplot() function appears to draw its own tick marks
and axis values even when called with add=TRUE. As a toy
example, try
x <- rnorm(100)
f <- factor(rep(1:4, each=25))
plot(c(0,4), c(-3,3), type="n", xaxt="n", yaxt="n")
boxplot(x ~ f, add=TRUE)
My expectation is that a high-level plotting function will
not mess with the axes
2002 May 17
0
What is the most efficient way to assign to PARTS of obje cts in other frames/environments?
For nested function calls it appears that a combination of environment()
and '<<-' will also work:
f1 <- function() {
x <- rep(NA,4) # Object to be modified by function f2
environment(f2) <- sys.frame(1) # Make f1's environment available to f2
f2(2) # Changes 2nd element of x
print(x)
}
f2 <- function(i) {
#