Displaying 20 results from an estimated 3000 matches similar to: "S4: Multiple inheritance"
2010 Mar 30
6
Error "singular gradient matrix at initial parameter estimates" in nls
I am using nls to fit a non linear function to some data.
The non linear function is:
y= 1- exp(-(k0+k1*p1+ .... + kn*pn))
I have chosen algorithm "port", with lower boundary is 0 for all of the
ki parameters, and I have tried many start values for the parameters ki
(including generating them at random).
If I fit the non linear function to the same data using an external
2006 Apr 11
2
About list to list - thanks
Thank you very much for your useful suggestions.
These are exactly what I was looking for.
foo <- list(foo1, foo2, foo3)
lapply(foo, function(x) matrix(unlist(x), nrow = length(x), byrow = TRUE))
or
lapply(foo, function(x) do.call('rbind', x))
Best, Muhammad Subianto
On 4/11/06, Muhammad Subianto <msubianto at gmail.com> wrote:
> Dear all,
> I have a result my experiment
2006 Apr 11
2
About list to list
Dear all,
I have a result my experiment like this below (here my toy example):
foo1 <- list()
foo1[[1]] <- c(10, 20, 30)
foo1[[2]] <- c(11, 21, 31)
foo2 <- list()
foo2[[1]] <- c(100, 200, 300)
foo2[[2]] <- c(110, 210, 310)
foo3 <- list()
foo3[[1]] <- c(1000, 2000, 3000)
foo3[[2]] <- c(1100, 2100, 3100)
list(foo1,foo2,foo3)
The result:
> list(foo1,foo2,foo3)
[[1]]
2008 Mar 25
1
Passing (Optional) Arguments
Dear List:
In short, I am writing a number of functions as building blocks for
other functions and have some questions about scoping and passing arguments.
Suppose I have functions foo1, foo2, and foo3 such that:
foo1<-function(a=1,b=TRUE,c=FALSE){#do stuff};
foo2<-function(x=1,y=FALSE,z=c(1,2,3,4)){#do stuff};
foo3<-function(lambda,...){lambda*foo1()*foo2()};
I want to be able to
2012 Nov 06
1
Depends/Imports/Suggest/Enhence
Hi the list
In the DESCRIPTION file of my package foo0, I have:
Depends: foo1
Imports: foo2
Suggest: foo3
Enhence: foo4
If I understand correctly, to install foo0 on my computer, I need to already have foo1, foo2, foo3.
foo4 is not necessary.
I my R sesssion, when I will write: library(foo0), then the package foo1 will be attach. foo2, foo3
and foo4 will not. Is that correct?
But what is
2010 Feb 10
1
How to solve: Error in * unused argument(s) ?
Hi all,
For some reason, I would like to use functions bellow (see example code
bellow), but instead I get the following error message:
*Error in foo2(...) : unused argument(s) (arg3 = 3)*
#---------------------
# example code
#---------------------
foo1 <- function(arg1,...)
{
print(arg1)
foo2(...)
foo3(...)
}
foo2 <- function(arg2)
{
print(arg2)
}
foo3 <- function(arg3)
{
2009 Sep 01
3
Strange error returned or bug in gam in mgcv????
Dear friends,
what is this error message in gam???? I cannot understand what it means ....
is it a bug?
gam_bray_scot24_pc_0505<gam(bray~s(PC1,PC2,PC3,PC4,PC5,
PC1.1,PC2.1,PC3.1,PC4.1,PC5.1),data=dist_scot24_vector_with_climate)
Error in if (length(data) != vl) { :
missing value where TRUE/FALSE needed
Calls: gam ... smooth.construct -> smooth.construct.tp.smooth.spec -> array
In
2014 May 02
1
Authors@R: and Author field
Hi to all
Authors@R: c(person("fooa","foob", role = c("aut","cre"),
email = "fooa.foob@fooc.de"),
person("foo1","foo2", role = c("ctb"),
email = "foo1.foo2@foo3.de"))
Author: fooa foob, with contributions from foo1 foo2
using r CMD check --as-cran .. (R 3.1
2009 Sep 30
3
A point in a vector?
Dear list,
I have a strange requirement .... I have a vector, for example v<-
c(0,0,0,0,1,2,4,6,8,8,8,8). I have a value,for example x<- 4.8.
I would like to understand in which sub interval of v is x. In this case, v
would be in the sub interval [4,6] that is in the subinterval starting from
element j=7 to the element j+1=8.
Can we do that with an R command?
Regards
--
Corrado Topi
2006 Jun 29
3
advice on arguments
I have a general style question about R coding.
Suppose I'm writing a function (foo1) that calls other functions
(foo2, foo3, ...) which have complicated argument
lists (e.g. optim(), plot()), _and_
I may be calling several different functions in the body of
foo1. Since foo2 and foo3 have different sets of arguments, I
can't just use "..." ; I did write some code a while ago
2009 Sep 03
3
goodness of "prediction" using a model (lm, glm, gam, brt, regression tree .... )
Dear R-friends,
How do you test the goodness of prediction of a model, when you predict on a
set of data DIFFERENT from the training set?
I explain myself: you train your model M (e.g. glm,gam,regression tree, brt)
on a set of data A with a response variable Y. You then predict the value of
that same response variable Y on a different set of data B (e.g. predict.glm,
predict.gam and so on).
From THE R BOOK -> Warning: In eval(expr, envir, enclos) : non-integer #successes in a binomial glm!
2010 Mar 30
3
From THE R BOOK -> Warning: In eval(expr, envir, enclos) : non-integer #successes in a binomial glm!
Dear friends,
I am testing glm as at page 514/515 of THE R BOOK by M.Crawley, that is
on proportion data.
I use glm(y~x1+,family=binomial)
y is a proportion in (0,1), and x is a real number.
I get the error:
In eval(expr, envir, enclos) : non-integer #successes in a binomial glm!
But that is exactly what was suggested in the book, where there is no
mention of a similar warning. Where am I
2009 Nov 25
3
Concave hull
Dear friends,
Do you know how to calculate the CONCAVE hull of a set of points (2-
dimensional or n-dimensional)? is that possible in R? (With a "smoothing"
parameter of course).
Best,
--
Corrado Topi
Global Climate Change & Biodiversity Indicators
Area 18,Department of Biology
University of York, York, YO10 5YW, UK
Phone: + 44 (0) 1904 328645, E-mail: ct529 at york.ac.uk
2012 Nov 07
2
Correct use of Depends, Imports and ::
Dear R developers,
Taking advantage of the yesterday discussion about the use of
Depends/Import/Suggests/Enhances, I would like to add a related question.
Let's assume, in the DESCRIPTION file of my package foo0, I have:
Depends: foo1
Imports: foo2
while in the NAMESPACE file of my package I have
importFrom("foo2", f2)
and within my package I use the following two external
2007 Dec 13
2
use ggplot in a function to which a column name is given
Hi everyone, Hi ggplot users in particular,
ggplot makes it very easy to plot things given their names when you
use it interactively (and therefore can provide the names of the
columns).
qplot(x,foo,data=A) where A has columns (x,y,foo,bar) for example
but I would like to use this from inside a function to which the name
of the column is given. I cannot find an elegant way to make this
2011 Jun 20
1
access objects by name
Hi,
I have several data structures (xts structures). I then have a list of the names of those objects.
I'd like to access the object by name.
For example:
foo1 <- as.xts(....)
foo2 <- as.xts(...)
foo3 <- as.xts(...)
structs <- c("foo1", "foo2", "foo3")
for (thisOne in structs){
print(thisOne$colA)
}
The above fails. Clearly I'm missing a
2004 Apr 20
2
Creating variable names
My apologies for asking what is doubtless a dumb question, but I have
scant experience in R.
It would be very convenient in doing lots of plots to be able to do them
in a loop that stepped through a vector of variable names. For example
one could say
x<-("mydates")
y<-c("foo1","foo2","foo3") #where "foon" were vectors
2010 Nov 15
2
How to move an internal function to external keeping same environment?
Hi
I have within a quite big function foo1, an internal function foo2. Now,
in order to have a cleaner code, I wish to have the internal foo2 as
"external". This foo2 was using arguments within the foo1 environment
that were not declared as inputs of foo2, which works as long as foo2 is
within foo1, but not anymore if foo2 is external, as is the case now.
Now, I could add all those
2015 Dec 17
2
Multiple IPs and hostname
Hi,
I'm running postfix as SMTP-server and dovecot as IMAP-server.
The server has multiple IPs, and postfix is configured that every domain
is using a separate IPv4-address.
Examle:
foo1.com --> 11.22.33.44
foo2.com --> 22.33.44.55
foo3.com --> 33.44.55.66
bar.org --> 66.77.88.99
The hostname of the server is: mail.bar.org
Now I have a request from one of my customers,
2009 Jun 18
3
How to parse and eval a collection of items
Let's say I have, for some reason, a bunch of scalars (i.e.
single-valued variables) and I want to merge them all into a single
vector of values. Can someone recommend a better function, or simpler
way, to do so than the following?
Suppose my scalars' names are foo1, foo2, foo3, foo1high, foo2high,
foo3lo2, etc. Then I can do:
>ls(pat='foo')->thels