Displaying 20 results from an estimated 50000 matches similar to: "Retaining comments when using `example'"
2003 Sep 17
1
the name of a variable in a function
Dear collegues,
How can I get the name of a variable (and not the variable) within a
function ?
For instance, in the following function, I'd like to create a variable
in the dataframe df with the same name to the variable passed in var:
prova <- function( var )
{
df <- as.data.frame(matrix(nr=20,nc=0))
df[["here"]] <- seq(min(var), max(var), le= 20) #
df
}
for
2009 Mar 21
1
Forestplot () box size question
Hi All,
I have been able to modify the x-axis to start at zero by adding xlow
and xhigh parameters; that was pretty simple. I have been unable to
find the location of the code that would turn off the information
weighting of the box size (I have smaller randomized trials getting
less weight than a much larger non-randomized trial). The function
is forestplot() from rmeta.
Thanks for any
2009 Apr 23
1
qqnorm.lme & pairs.lme
Hello,
I am trying to do some plotting to check random effect assumptions for a
model I fit using lme.
I want to use qqnorm and pairs (similarly to examples given in Pinheiro &
Bates p. 188), but it's not working. Here's some relevant code and the
error message:
library(nlme)
data(Machines)
m1 <- lme(fixed=score~Machine,random=~1|Worker/Machine, data=Machines)
qqnorm(m1,
2019 Sep 14
0
'==' operator: inconsistency in data.frame(...) == NULL
Dear all,
I did some more tests regarding the == operator in Ops.data.frame (see
below).? All tests done in R 3.6.1 (x86_64-w64-mingw32).
I find that errors are thrown also when comparing a zero length
data.frame to atomic objects with length>0 which should be a valid case
according to the documentation. This can be traced to a check in the
last line of Ops.data.frame which tests for the
2006 Dec 03
1
passing matrix as argument to a C function
Hi,
Although this is not directly an R-related question, it is relevant as I am
trying to port some R code to C to speed things up in a computation.
I am working through my first attempts to generate and link compiled C code
in R. I could make the 'convolve' function to work and similar functions
that take vectors as arguments. In my application I need to pass a couple
of matrices to
2004 Mar 24
1
combined random effects
Hi,
I have the following linear mixed model:
y(g,i,j,k,l)=u + L(g) + T(i) + D(j) + S(k) + (TS)(i,k) + error(g,i,j,k,l)
where S(k) and the combined effect (TS)(i,k) are random effects whereas
the rest are fixed effects.
How do I specifiy the random part of the model formula in lme(),
especially concerning the combined effect (TS)?
Moreover, when I run the model as a fixed effect model I get
2007 Mar 03
0
2 bugs in max.col() (PR#9542)
Dear R-Developers,
I think I found two bugs in max.col(). Ties between zeros are not broken, which might affect simulations. -Inf and Zero can be treated the same, which can give completely wrong results, e.g. when the second max is sought by replacing all maxs by -Inf.
To fix max.col I do offer the C-code behind my function rowMax(), which also handles NAs and seems to be faster. However,
2008 Jun 05
0
bug in barplot.default (graphics) (PR#11585)
There seems to be a minor bug in barplot.default when used with log scale w=
here one or more values is NA:
dat <- matrix(1:25, 5)
dat[2,3] <- NA
barplot(dat, beside =3D T) #Plots and appropriate barplot with gaps for m=
issing data
barplot(dat, beside =3D T, log =3D "y")
#Error in if (min(height + offset) <=3D 0) stop("log scale error: at least =
one 'height +
2005 Oct 11
1
aligning column of xyplots and removing space between them
The code below displays three graphs in three rows and one column but:
1. I want to remove the space between the graphs (I tried playing with position=
arg to print.trellis but it seems quite difficult to get the right
values and all
my attempts had space between them or had overlapping graphs. Is
there a better way to do this?
2. the widths of the plots are not the same even though I specified
2007 Jul 17
0
write.dcf/read.dcf cycle converts missing entry to "NA" (PR#9796)
Full_Name: Bill Dunlap
Version: 2.5.0
OS: Red Hat Enterprise Linux WS release 3 (Taroon Update 6)
Submission from: (NULL) (24.17.60.30)
If you read a dcf file with read.dcf(file,fields=c("Field",...))
and the file does not contain the desired field "Field",
read.dcf puts a character NA for that entry in its output
matrix. If you then call write.dcf, passing it the output
of
2012 Sep 24
1
Question lattice SplomT
Dear Deepayan Sarkar,
I have (again) a question concerning "panel" and my function "SplomT",
see attachments. Some time ago you helped me to write this function,
thanks again. I have used it to great advantage in my statistics
instructions. Now the problem I encounter is that the .pdf figure
generated in Sweave consists of
one extra empty page at the start.
This prevents
2005 Nov 01
1
coding nesting in data for nlme example of Wafer data set.
I am trying to understand the proper way to encode the nesting structure
for data in the context of nlme, in the specific case of individuals
nested within species for which each individual is unique. I have
searched through Pinheiro & Bates and also past postings, but without
success.
Take the Wafer data set which has 2 levels: Wafer (8 values) and Site
nested within Wafer (10 values for
2007 Jan 19
4
Vectorize rearrangement within each column
Consider a matrix like
> ma = matrix(10:15, nr = 3)
> ma
[,1] [,2]
[1,] 10 13
[2,] 11 14
[3,] 12 15
I want to rearrange each column according to row indexes (1 to 3)
given in another matrix, as in
> idx = matrix(c(1,3,2, 2,3,1), nr = 3)
> idx
[,1] [,2]
[1,] 1 2
[2,] 3 3
[3,] 2 1
The new matrix mb will have for each column the
2006 May 21
1
print.trellis(..., draw.in=...)
A year ago I had posted this code
https://stat.ethz.ch/pipermail/r-devel/2005-June/033508.html
and the associated discussion was that there would be a print.trellis
argument that could be used to eliminate the need for with.vpPath
or with.viewport there. I assume that that is what draw.in= in
print.trellis is for. When I try it I get an error. I did notice that
?print.trellis says draw.in=
2004 Jan 20
2
repeated measurements with R
Hello All,
I have a more statistical question, and how this is implemented in R.
The problem is the following:
We have 2 different solutions (samples), which are filtered and then
the concentration of the filtrate is measured.
We want to evaluate how the filter proces and the concentration
measurement influences the detection of the difference of the two
solutions and which step has which
2007 Jul 18
1
(PR#9796) write.dcf/read.dcf cycle converts missing entry
BIll,
Thanks.
I am seeing some problems here, for example when all the fields are
missing, or all the fields in a row are missing. I've fixes for those,
and will commit to R-devel shortly.
On Tue, 17 Jul 2007, bill at insightful.com wrote:
> Full_Name: Bill Dunlap
> Version: 2.5.0
> OS: Red Hat Enterprise Linux WS release 3 (Taroon Update 6)
> Submission from: (NULL)
2001 Sep 08
0
barplot forces xpd=TRUE (PR#1088)
<<insert bug report here>>
barplot hardcodes xpd as "TRUE" causing the bars to go outside of the
plot region. True can be the default, but it shouldn't be the only
option.
*** barplot.R Sat Sep 8 10:15:16 2001
--- barplot.R.orig Sat Sep 8 10:03:39 2001
***************
*** 5,11 ****
legend.text = NULL, beside = FALSE, horiz = FALSE,
col =
2006 Oct 10
1
read.table versus read.csv (PR#9284)
This message is in MIME format.
--=_6vx1wr5xhvr4
Content-Type: text/plain;
charset=ISO-8859-1;
DelSp="Yes";
format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Dear R Core Team,
Help to 'read.table' claims that
'read.csv' is identical to 'read.table' except for the defaults.
However, 'read.table' seems
2005 Jul 07
2
Problems with nlme: Quinidine example
This concerns the "Clinical Study of Quinidine" example on page 380
of the book "Mixed-Effects Models in S and S-PLUS" by Pinheiro and Bates (2000).
I have tried to reproduce the example, but get an error:
> library(nlme)
> fm1Quin.nlme <- nlme(conc ~ quinModel(Subject, time, conc, dose, interval, lV,
lKa, lCl),
+ data=Quinidine,
+
2010 Mar 18
2
Please Post Planned Contrasts Example in lme {nlme}
Hi I am running some linear and non-linear mixed effect models and would like to do some planned contrasts (a priori contrasts)
I have looked in the help and in many forums and it seems possible to do so but don't understand how to write the function and I couldn't find an example in Pinheiro and Bates.
lme {nlme} has a contrasts argument but I can't understand how to code it.