Displaying 20 results from an estimated 3000 matches similar to: "Follow Up To: Splitting the left and right hand terms of a formula"
2006 Jul 14
1
Splitting the left and right hand terms of a formula
Let's say I have the following formula:
a.formula <- x ~ y + z
I want to extract the left and right-hand sides of the function so
that I have two character vectors like the ones you would create using
the following assignments:
left.hand.side <- "x"
right.hand.side <- c("y", "z")
One way to do this follows:
left.hand.side <-
2005 Mar 01
3
packages masking other objects
hello all,
I am trying to use the function getCovariateFormula(nlme) in conjunction with the library lme4. When I load both packages I get the following message and the getCovariateFormula function no longer works:
library(nlme)
library(lme4)
Attaching package 'lme4':
The following object(s) are masked from package:nlme :
contr.SAS getCovariateFormula
2001 Jul 31
4
nlme: bug in getCovariateFormula (PR#1038)
I found that predict.gnls failed with a wierd error message about a
non-numeric argument to a binary vector in one of three nearly identical
uses.
Error in Inh/Ki : non-numeric argument to binary operator
(Inh and Ki are arguments to the function used in the formula for the
object whose predictions were requested).
It turns out that the problem is in getCovariateFormula().
The final line in
2006 Aug 04
2
Sampling from a Matrix
Hello all,
Consider the following problem:
There is a matrix of probabilities:
> set.seed(1)
> probs <- array(abs(rnorm(25, sd = 0.33)), dim = c(5,5), dimnames = list(1:5, letters[1:5]))
> probs
a b c d e
1 0.21 0.27 0.50 0.0148 0.303
2 0.06 0.16 0.13 0.0053 0.258
3 0.28 0.24 0.21 0.3115 0.025
4 0.53 0.19 0.73 0.2710 0.656
5 0.11 0.10 0.37 0.1960
2010 Jul 28
0
nlme: augPred.lme for factor covariates
Hi everybody,
as you may be aware the function augPred.lme does not work as soon as
the covariate is a factor. The problem lies in the line
newprimary <- seq(from = minimum, to = maximum, length.out = length.out)
which does not make sense for factors. I think augPred.lme can be useful
for models with a factor covariate as well. Thus, I propose to change
the code to:
augPred.lme <-
2005 Jul 26
1
evaluating variance functions in nlme
Hi,
I guess this is a final plea, and maybe this should go to R-help but
here goes.
I am writing a set of functions for calibration and prediction, and to
calculate standard
errors and intervals I need the variance function to be evaluated at new
prediction points.
So for instance
fit<-gnls(Y~SSlogis(foo,Asym,xmid,scal),weights=varPower())
2007 Sep 14
2
Building an R GUI using gWidgets and RGtk2
Hello,
I'm developing a GUI in R that will be used to monitor financial
portfolio performance. The GUI will be distributed as an R package. So
far, I've decided to use the "cairoDevice", "RGtk2", "gWidgets", and
"gWidgetsRGtk2" packages to develop the GUI. I am trying to decide what
would be the best way to structure the GUI would be.
I've
2009 Mar 09
1
Zero distance error in corSpatial - correlation structure using lme
Hello,
I am having a problem specifying the correlation structure in lme which
leads to the error: Error in getCovariate.corSpatial(object, data =
data) : Cannot have zero distances in "corSpatial". I have specified a
grouping variable which is the only fix I could find by searching this
error on R-help.
ISee the below example. When my samples (tran) - which are transects
2005 Aug 12
1
Problem with lme4
Hi,
I cannot seem to get lme4 to work. I have installed the lme4 and Matrix
package with apt-get. and both can be found in /usr/lib/R/site-library.
When I tried an example for lmer, R could not find the function lmer(),
> library(lme4)
Attaching package: 'lme4'
The following object(s) are masked from package:nlme :
getCovariateFormula getResponseFormula
2006 Jul 01
1
nlme: correlation structure in gls and zero distance
Dear listers,
I am trying to model the distribution of fox density over years in the
Doubs department. Measurements have been taken on 470 plots in March
each year and georeferenced. Average density is supposed to be different
each year.
In a first approach, I would like to use a general model of this type,
taking spatial correlation into account:
2010 Apr 14
1
creating a new corClass for lme()
Hi,
I have been using the function lme() of the package nlme to model grouped
data that is auto-correlated in time and in space (the data was collected on
different days via a moving monitor). I am aware that I can use the
correlation classes corCAR1 and corExp (among other options) to model the
temporal and spatial components of the auto-correlation. However, as far as
I can tell, I can only
2010 Dec 13
2
Does a formula object have a "left hand side"
Hello,
Does anyone know of a function that will determine whether
or not a formula object has a left hand side?
I.e., can differentiate between
y ~ x + z
and
~ x + z
Perhaps I'm overlooking the obvious...
Thanks!
2013 Mar 02
2
Multiple left hand side variables in a formula
The lattice package uses special logic to allow for multiple left-hand-side
variables in a formula, e.g. y1 + y2 ~ x. Is there an elegant way to do
this outside of lattice? I'm trying to implement a data summarization
function that logically takes multiple dependent variables. The usual
invocation of model.frame( ) causes R to try to do arithmetic addition to
create a single dependent
2006 Nov 20
1
My own correlation structure with nlme
Dear all,
I am trying to define my own corStruct which is different from the
classical one available in nlme. The structure of this correlation is
given below.
I am wondering to know how to continue with this structure by using
specific functions (corMatrix, getCovariate, Initialize,...) in order to
get a structure like corAR1, corSymm which will be working for my data.
Thanks in advance.
2008 Oct 08
1
Observed responses in 'augPred' data frame - Wrong order ?
Dea-R community.
I'd like to draw your attention to an issue I have recently
encountered while doing my current data analysis.
I've got an unexpected (to me) result from the command:
> augPred(lmList(my.object)),
'my.object' being a grouped data frame of class:
> class(my.object)
[1] "nfnGroupedData" "nfGroupedData" "groupedData"
2009 Aug 05
7
why is 0 not an integer?
Why when I assign 0 to an element of an integer vector does the type change
to numeric?
Here is a particularly perplexing example:
> v <- 0:10
> v
[1] 0 1 2 3 4 5 6 7 8 9 10
> class(v)
[1] "integer"
> v[1] <- 0
> class(v)
[1] "numeric" #!!
>
--
View this message in context:
2009 Aug 05
7
why is 0 not an integer?
Why when I assign 0 to an element of an integer vector does the type change
to numeric?
Here is a particularly perplexing example:
> v <- 0:10
> v
[1] 0 1 2 3 4 5 6 7 8 9 10
> class(v)
[1] "integer"
> v[1] <- 0
> class(v)
[1] "numeric" #!!
>
--
View this message in context:
2005 Dec 19
0
has_one mapping with arbitrary right and left hand side keys
I have two tables:
table_1:
tab1_id,
other_id
table_2:
id,
tab2_id,
something_else
I would like to specify a has_one mapping from table_1 to table_2 but
specifying that the join is based on (table_2.tab2_id =
table_1.other_id).
I am half way there with:
class Table1 < ActiveRecord::Base
set_table_name "table_1"
set_primary_key "tab1_id"
has_one :Table2, :class_name
2013 May 21
0
Arules: getting rules with only one item in the left-hand side
Hello,
I am using the package arules to generate association rules. I would like
to restrict the rules so that in the left-hand side there's only one
particular element, let's call it "potatoe".
If I do this:
rules <- apriori(dtm.mat, parameter = list(sup = 0.4, conf =
0.9,target="rules"), appearance = list(lhs = c("potatoe")))
I get "potatoe"
1999 Dec 13
1
Superscript or subscript on Left hand side of symbol
Is there a way to get subscripts and superscripts on the left hand side of
a symbol? For example, oC or oF (degree Celsius or Fahrenheit)
TIA
Partha
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the