similar to: xyplot: getting data into the panel function

Displaying 20 results from an estimated 9000 matches similar to: "xyplot: getting data into the panel function"

2007 Nov 29
2
sqlQuery of variable of type varchar - confusion with "."
Dear list, I have a rather large dataset in SAS which I export to a SQLite database for subsequent use in R. One of the columns is cowidp 1881501224.2 1881501224.2 and the column is stored as a character in SAS. It becomes a varchar in the database (it should be - it is an identifier; not a number). Reading this into R gives cowidp 1 1881501224 2 1881501224 .... - i.e. the
2006 Nov 01
2
xyplot: Plotting two variables, one as points - the other as line. Can that be done without explicitly using panel functions
Hi! Consider d <- data.frame(x=1:10,y=5+1:10, yf=rnorm(10,5+1:10)) x y yf 1 1 6 5.268621 2 2 7 8.623896 3 3 8 8.114830 4 4 9 10.125955 5 5 10 9.977261 ... I plot y and yf against x with xyplot(y+yf~x,data=d,col=c('red','green'),pch=c("a","b")) BUT - I would like that the plot of y against x is with type='l' and the
2006 Aug 29
2
lattice/xyplot: plotting 4 variables in two panels - can this be done?
Hi, I would like to create a plot of y1,y2,y3,y4 against x for several subjects such that y1 and y2 are plotted against x in one panel and y3 and y4 against x in another panel. Thus if there are 3 subjects I should end up with 6 panels. Is there a simple way of doing so (i.e. without calling xyplot() several times, and then padding the results together)?? Regards S?ren
2010 Nov 26
3
Calling substitute(expr, list(a=1)) when expr <- expression(a+b+c)
# The result I am after is the result after a substitution in an expression, such as substitute(expression(a+b+c), list(a=1)) expression(1 + b + c) # However, the way I want to do it is for a an expression "stored as a variable" as (expr <- expression(a+b+c)) expression(a + b + c) # a) The following does not work (expr2 <- substitute(expr, list(a=1))) expr # b) - whereas this
2007 Aug 22
2
Evaluating f(x(2,3)) on a function f<- function(a,b){a+b}
Dear list I have a function and a vector, say f <- function(a,b){a+b} x <- c(2,3) I want to "evaluate f on x" in the sense of computing f(x[1],x[2]). I would like it to be so that I can write f(x). (I know I can write a wrapper function g <- function(x){f(x[1],x[2])}, but this is not really what I am looking for). Is there a general way doing this (programmatically)?
2007 Apr 20
1
xyplot: Combining 'subscripts' and 'allow.multiple=T'
Dear all, Consider this plot xyplot(Sepal.Length + Sepal.Width ~ Petal.Length | Species, data = iris, allow.multiple=T, outer=F, panel = function(x,y,...) { panel.xyplot(x,y,...) } ) I want to *add* some things to each panel and what I want to add involves using the data for each panel, so I try to take this subset of data out with subscripts:
2006 Aug 14
2
Calculating trace of products
Dear all, I need to calculate tr(A B), tr(A B A B) and similar quantities **fast** where the matrices A, B are symmetrical. I've searched for built-in functions for that purpose, but without luck. Can anyone help? Thanks in advance Søren [[alternative HTML version deleted]]
2006 Sep 29
2
Automatical download of needed packages from CRAN
I write a package foo which requires a package bar (from CRAN) to work. So in the DESCRIPTION file I write Depends: bar. I would like it to be so that when one installs foo, then it is automatically checked whether bar is installed, and if not then bar is also installed at the same time. I remember having seen packages which do so, but I can not figure out the mechanism 'Depends: bar' in
2005 Jun 20
2
Fwd: How to sample from a linear mixed model
Thanks. I wonder if there is a general way of extracting var(u) and var(e), which would be needed to simulate u and e. Clearly, one can get the estimated parameters, but is there a clever way of 'setting up' the matrices?? Best S??ren On 6/19/05, S??ren H??jsgaard <Soren.Hojsgaard at agrsci.dk> wrote: > I would like to draw a sample from a linear mixed model y=Xb+Zu+e which has
2006 Sep 01
1
Checking a package: "Foreign function calls without 'PACKAGE' argument:" - what must I do??
In the process of checking a package, I get the warning Foreign function calls without 'PACKAGE' argument: .Call("tr", ...) .Call("trProd", ...) See section 'System and foreign language interfaces' of the 'Writing R.. These functions are called using the wrappers trX <- function(x, package="gRcox") { .Call("tr", x,
2005 Jul 12
10
Computer algebra in R - would that be an idea??
>From time to time people request symbolic computations beyond what D() and deriv() etc can provide. A brief look at the internet shows that there are many more or less developed computer algebra packages freely available. Therefore, I wondered if it would be an idea to try to 'integrate' one of these packages in R, which I guess can be done in more or less elegant ways... I do not know
2005 Jul 31
3
Drawing a graph with vertices and edges using tcl/tk
Dear all; I would like to draw a graph with vertices and edges, and I guess tcl/tk would be appropriate. I don't know tcl/tk but have googled for a 10-page (or so) introduction to 'getting started with tcl/tk in R' but without any luck. - Does anyone know of the existence of such a document or any other web-based material on the subject? - Does anyone have an (informative) piece of
2005 Jun 19
1
How to sample from a linear mixed model
I would like to draw a sample from a linear mixed model y=Xb+Zu+e which has been fitted with lme(), i.e. a model y ~ N(Xb, C), where C=Z cov(u) Z' + cov(e). I've tried to figure out how to extract C from an lme object, because that would solve my problem when also using the predict() function, but without any luck. Can anyone help on that?
2004 Aug 27
3
Reading SAS data into R
Dear all, One of my students (whom I am trying to convince to use R) wants to get a fairly large SAS dataset into R (about 150mB). An obvious and simple thing she tried was to write the dataset as a .csv-file and then read that into R, but that takes forever (or something close to that..). The dataset is so large, that exporting it as an Excel file from SAS is not feasible (more than 65000 lines).
2004 Jun 05
2
'invalid HOMEDRIVE'
Dear all, One of my students have installed R1.9.0 on windows, and gets the fatal error 'invalid HOMEDRIVE' Can anyone help her/me out on that one? Thanks in advance Søren Højsgaard [[alternative HTML version deleted]]
2006 Apr 06
1
polynomial predict with lme
Does lme prediction work correctly with poly() terms? In the following simulated example, the predictions are wildly off. Or am I doing something daft? Milk yield for five cows is measured weekly for 45 weeks. Yield is simulated as cubic function of weekno + random cow effect (on intercept) + residual error. I want to recover an estimate of the fixed curve. ############### library(nlme)
2007 Sep 28
2
Importing only one function from a package
Dear List In a package I want to import the mApply function from the Hmisc package, and I would like to import only that function. 1) If I write "Depends: Hmisc" in the DESCRIPTION file I get the whole Hmisc package, so that is not the way to go ahead. 2) According to "Writing R extensions", sec 1.6.1 "Specifying imports and exports" I can (as I read it) simply
2006 Jul 02
2
:include breaks has_many :order
It would appear that using :include on a model that has_many with an :order on another model makes it so that the order is ignored. Is this supposed to happen? Strikes me as odd behavior. For example class Farmer < ActiveRecord::Base has_many :cows, :order => ''position'' end class Cow < ActiveRecord::Base acts_as_list :scope => :farmer end If I do
2004 Jun 06
2
Repeated measures
Dear R-gurus, I am pretty much new on R. I am trying to to do a repeated analysis of a linear mixed model with R, and I consistently fail... The problem is: Cow is the random factor, treatment is the fixed factor. The dependent variable is milk yield, which is measured several times (repeatedly over time), thus there is another variable which is time (i.e. week). The model would be
2005 Jun 30
1
Nolinear mixed-effects models (nlme)
Hello, I am trying to fit a nonlinear model of the form of: A*x^b*exp(-c*x) This represents a lactation curve. I have a bunch of cows, so I want COW to be a random effect. I have been trying the following code with very littel success: > fm1 <- nlme(yield ~ A*(DIM^B)*(exp(-C*DIM)), + data = group, + fixed = A + B + C ~ 1, + start = c(A = 20, B =