Hi Duncan,
On 9/16/10 3:47 PM, Duncan Murdoch wrote:
On 16/09/2010 3:40 PM, Duke wrote:
Hi all,
I am writing a function (fun.R), but I dont know how to code the
function so that the Help Text will be shown up when one types ?fun (of
course, after he loads it up). Anyone has any advice
On 17/09/2010, at 8:51 AM, Duke wrote:
Hi Duncan,
On 9/16/10 3:47 PM, Duncan Murdoch wrote:
On 16/09/2010 3:40 PM, Duke wrote:
Hi all,
I am writing a function (fun.R), but I dont know how to code the
function so that the Help Text will be shown up when one types ?fun (of
course,
On 16/09/2010 5:00 PM, Rolf Turner wrote:
On 17/09/2010, at 8:51 AM, Duke wrote:
Hi Duncan,
On 9/16/10 3:47 PM, Duncan Murdoch wrote:
On 16/09/2010 3:40 PM, Duke wrote:
Hi all,
I am writing a function (fun.R), but I dont know how to code the
function so that the Help Text will be shown
David,
your example clarify me the use of sink.
I really appreciate your help
Evgenia
--
View this message in context:
http://r.789695.n4.nabble.com/Function-try-and-Results-of-a-program-tp2526621p2527227.html
Sent from the R help mailing list archive at Nabble.com.
Hello, users.
Dear users,
***I have a function f to simulate data from a model (example below used
only to show my problems)
f-function(n,mean1){
a-matrix(rnorm(n, mean1 , sd = 1),ncol=5)
b-matrix(runif(n),ncol=5)
data-rbind(a,b)
out-data
out}
*I want to simulate 1000 datasets
On Sep 4, 2010, at 6:10 AM, Evgenia wrote:
Hello, users.
Dear users,
***I have a function f to simulate data from a model (example
below used
only to show my problems)
f-function(n,mean1){
a-matrix(rnorm(n, mean1 , sd = 1),ncol=5)
b-matrix(runif(n),ncol=5)
data-rbind(a,b)
out-data
David,
your suggestion about try works perfect for me.
I still have a problem with sink. Could you explain me better your
suggestion?
Thanks alot
Evgenia
--
View this message in context:
http://r.789695.n4.nabble.com/Function-try-and-Results-of-a-program-tp2526621p2526822.html
Sent from
On Sep 4, 2010, at 12:41 PM, Evgenia wrote:
David,
your suggestion about try works perfect for me.
I still have a problem with sink. Could you explain me better your
suggestion?
When you sink to a file, you will continue sending console output to
that file until you issue sink(). And
Hi Marcio
You might like to look at some equivalents from the field of ecology, for
which there are existing functions. Have a look at the function
diversity in the package vegan. This provides the Simpson diversity
index, which is the complement of the Gini coefficient (Gini = 1 -
Simpson).
Hi, all
is there a built-in function to compare two numbers?
something like following function
cmp - function(x, y){
value - 0
if (x y){
value - 1
}else if (x == y){
value - 0
}else {
value - -1
}
return(value)
}
Thanks in advance,
Hyunchul
Hi!
Maybe something like this:
x - 2
y - 3
#since FALSE will be converted to 0 and TRUE to 1 you can do
as.numeric(xy)
as.numeric(xy)
HTH
Ivan
Le 9/3/2010 15:33, Hyunchul Kim a écrit :
Hi, all
is there a built-in function to compare two numbers?
something like following function
cmp-
x - 2
y - 3
ifelse(x y, 1, ifelse(x y, -1, 0))
[1] -1
On Fri, Sep 3, 2010 at 9:33 AM, Hyunchul Kim hyunchul.kim@gmail.com wrote:
Hi, all
is there a built-in function to compare two numbers?
something like following function
cmp - function(x, y){
value - 0
if (x y){
You could potentially use sign()
sign(3 - 5)
[1] -1
sign(5 - 3)
[1] 1
sign(5 - 5)
[1] 0
But... this could fail when you think two numbers are equal and the
computer doesn't, due to floating point precision. (Your version could
fail in exactly the same way.)
x - .3 - .2
x
[1] 0.1
sign(x -
On Sep 3, 2010, at 9:33 AM, Hyunchul Kim wrote:
Hi, all
is there a built-in function to compare two numbers?
something like following function
cmp - function(x, y){
value - 0
if (x y){
value - 1
}else if (x == y){
value - 0
}else {
value - -1
}
Hi listers,
Does it necessary to install any package in order to use the GINI or INEQ
functions.
If I use the following command the R tells me that didn't find the GINI
function.
x-c(541, 1463, 2445, 3438, 4437, 5401, 6392, 8304, 11904, 22261)
G-gini(x)
Thanks in advance,
Marcio
--
View this
for the Gini coefficient you can use this function:
gini - function(x, unbiased = TRUE, na.rm = FALSE){
if (!is.numeric(x)) {
warning('x' is not numeric; returning NA)
return(as.numeric(NA))
}
if (any(na.ind - is.na(x))) {
if (!na.rm)
stop('x'
Hi Dimitris,
I have already seen your code in another post. But, I would like to weight
my data. So, I wish I could use the following command:
gini(x, weights=rep(1,length=length(x)))
Thanks anyway and I am trying to understand your gini function in order to
apply a weigth.
Marcio
--
View
you need install and load package {reldist} before you call function gini().
HTH.
--
View this message in context:
http://r.789695.n4.nabble.com/Function-Gini-or-Ineq-tp2525852p2525966.html
Sent from the R help mailing list archive at Nabble.com.
__
Hi Peng,
I did that i installed the package RELDIST, but nothing happened. R does not
recognize this function.
Still looking for the solution.
Thanks,
Marcio
--
View this message in context:
http://r.789695.n4.nabble.com/Function-Gini-or-Ineq-tp2525852p2525981.html
Sent from the R help mailing
)
--- On Fri, 9/3/10, Mestat mes...@pop.com.br wrote:
From: Mestat mes...@pop.com.br
Subject: Re: [R] Function Gini or Ineq
To: r-help@r-project.org
Received: Friday, September 3, 2010, 1:07 PM
Hi Peng,
I did that i installed the package RELDIST, but nothing
happened. R does
Gabor ... that worked perfectly. Thank you.
-Original Message-
From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com]
Sent: Monday, August 09, 2010 10:20 PM
To: Derek Ogle
Cc: R (r-help@R-project.org)
Subject: Re: [R] Function to Define a Function
On Mon, Aug 9, 2010 at 9:31
Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
project.org] On Behalf Of Derek Ogle
Sent: Monday, August 09, 2010 7:31 PM
To: R (r-help@R-project.org)
Subject: [R] Function
On Mon, 9 Aug 2010, Derek Ogle wrote:
I am trying to define a general R function that has a function as the output
that depends on the user's input arguments (this may make more sense by looking
at the toy example below). My real use for this type of code is to allow a
user to choose from
Gabor Grothendieck ggrothendi...@gmail.com
on Mon, 9 Aug 2010 23:20:18 -0400 writes:
On Mon, Aug 9, 2010 at 9:31 PM, Derek Ogle do...@northland.edu wrote:
I am trying to define a general R function that has a
function as the output that depends on the user's input
Neat. But why assign the functions to separate variables at all?
mdlChooser - function(type=c(one,two)) {
type - match.arg(type)
m - switch(type,
one=function(x,N0,r) N0*exp(x*r) ,
two=function(x,N0,r,K) (N0*K)/(N0+(K-N0)*exp(-x*r))
)
m
}
also works without appearing to assign
I am trying to define a general R function that has a function as the output
that depends on the user's input arguments (this may make more sense by looking
at the toy example below). My real use for this type of code is to allow a
user to choose from many parameterizations of the same general
On Mon, Aug 9, 2010 at 9:31 PM, Derek Ogle do...@northland.edu wrote:
I am trying to define a general R function that has a function as the output
that depends on the user's input arguments (this may make more sense by
looking at the toy example below). My real use for this type of code
On 29/07/10 04:21, Jeremy Miles wrote:
I'd like a function that returns the variable name.
As in:
MyData$Var1
Would return:
Var1
Not quite sure what you mean, but does this get you started?
nn - function(x) deparse(substitute(x))
str( z - nn(airquality$Month) )
# chr airquality$Month
I'd like a function that returns the variable name.
As in:
MyData$Var1
Would return:
Var1
There should be a straightforward way to do this, but I can't see it.
Thanks,
Jeremy
--
Jeremy Miles
Psychology Research Methods Wiki: www.researchmethodsinpsychology.com
I am sorry if this question is vague or uninformed. I am just
learning R and struggling. I am using the book Hierarchical Modeling
and Inference in Ecology and they provide examples of R code. I have
the following code from the book but when I run it I don't get any
output. I cannot
On Jul 22, 2010, at 5:27 PM, Daniel Hocking wrote:
I am sorry if this question is vague or uninformed. I am just
learning R and struggling. I am using the book Hierarchical Modeling
and Inference in Ecology and they provide examples of R code. I have
the following code from the book but
On Jul 22, 2010, at 5:34 PM, David Winsemius wrote:
On Jul 22, 2010, at 5:27 PM, Daniel Hocking wrote:
I am sorry if this question is vague or uninformed. I am just
learning R and struggling. I am using the book Hierarchical Modeling
and Inference in Ecology and they provide examples of R
Thank you so much! I think I had tried those two pieces separately
and obviously had no success. I also typed panel3pt1.fn in the
console without the () following it.
On Jul 22, 2010, at 5:57 PM, David Winsemius wrote:
On Jul 22, 2010, at 5:34 PM, David Winsemius wrote:
On Jul 22,
Hi All,
I have a problem to create a variable that is a function of an integral of
another function.
The problem is the following:
I have a variable called cip. I have to create another variable called bip
that is a function of the former variable cip and also the cumulative
distribution
Hi,
I'm trying to replicate your program. It may be not the same as yours, hope
it helps.
## Create a vector of numbers
cip - seq(1.0,2.5,by=0.1)
## Create ecdf function
Fn - ecdf(cip)
## Create f function
f - function(x){(1-Fn(x))^4}
## Create integrate function
## Because the integrate
(
)
--
View this message in context:
http://r.789695.n4.nabble.com/SAS-Proc-summary-means-as-a-R-function-tp2286888p2287350.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman
On 13/07/2010 8:39 AM, Roger Deangelis wrote:
Thanks Richard and Erik,
I hate to buy the book and not find the solution to the following:
proc.means - function() {
deparse(match.call()[-1])
}
proc.means(this is a sentence)
unexpected symbol in proc means(this is)
One possible
Hello,
are you trying to pase SAS code (or lightly modified SAS code) and run it in R?
Then you are right: the hard part is parsing the code. I don't believe that's
possible without a custom parser, and even then it's really hard to parse all
the SAS sub languages right: data step, macro
What is the original intent? The bandwidth:productivity ratio is not
looking encouraging for this problem.
Frank
On 07/13/2010 12:38 PM, schuster wrote:
Hello,
are you trying to pase SAS code (or lightly modified SAS code) and run it in R?
Then you are right: the hard part is parsing the
Hi,
I am new to R.
I am trying to create an R function to do a SAS proc means/summary
proc.means ( data=bsebal;
class team year;
var ab h;
output out=BseBalAvg mean=;
run;)
I have a solution if I quote
On 07/12/2010 07:16 PM, Roger Deangelis wrote:
Hi,
I am new to R.
I am trying to create an R function to do a SAS proc means/summary
proc.means ( data=bsebal;
class team year;
var ab h;
output out=BseBalAvg mean
Please get a copy of
R for SAS and SPSS Users
*by*
*Muenchen*, Robert A.
http://www.springer.com/statistics/computanional+statistics/book/978-0-387-09417-5
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
environment.
However, I would like to load the data into the function environment,
so that the data goes away when the function terminates.
Cordially,
Giles Crane
--
View this message in context:
http://r.789695.n4.nabble.com/Loading-Rdata-within-an-R-function-tp2282751p2283051.html
Sent from the R
Giles Crane wrote:
Thank you for your consideration of this question.
I have tried both your suggestions.
However, the data is not loaded within the function.
When I specify load(mydata.Rdata,.globalEnv),
the data is loaded into the top level environment,
and the function does access the data
Hi,
I would like to assign the largest value of a column to a specific category
and repeat this for each column (v1 - v4).
x=c(1:12)
cat=c(cat1,cat5,cat2,cat2,cat1,cat5,cat3,cat4,cat5,cat2,cat3,cat6)
v1=rnorm(12,0.5,0.1)
v2=rnorm(12,0.3,0.2)
v3=rnorm(12,0.4,0.1)
v4=rnorm(12,0.6,0.3)
Hi Nils,
have a look at
?tapply
hth.
Am 09.07.2010 15:37, schrieb LogLord:
Hi,
I would like to assign the largest value of a column to a specific category
and repeat this for each column (v1 - v4).
x=c(1:12)
cat=c(cat1,cat5,cat2,cat2,cat1,cat5,cat3,cat4,cat5,cat2,cat3,cat6)
On Jul 9, 2010, at 9:46 AM, Eik Vettorazzi wrote:
Hi Nils,
have a look at
?tapply
hth.
Perhaps this will be part way there (I couldn't really figure out the
desired structure of the final object):
lapply( bla[, -(1:2)], function(x) tapply(x, bla$cat, max) )
$v1
cat1 cat2
you are right. But maybe aggregate is close to the desired result?
aggregate(bla, list(bla$cat), max)
Am 09.07.2010 16:01, schrieb David Winsemius:
On Jul 9, 2010, at 9:46 AM, Eik Vettorazzi wrote:
Hi Nils,
have a look at
?tapply
hth.
Perhaps this will be part way there (I couldn't
On Jul 9, 2010, at 10:26 AM, Eik Vettorazzi wrote:
you are right. But maybe aggregate is close to the desired result?
aggregate(bla, list(bla$cat), max)
Right. I couldn't get it to work until I removed the first two columns:
aggregate(bla[,-(1:2)], list(bla$cat), max)
Then I got pretty
just to satisfy my curiousity,
aggregate(bla, list(bla$cat), max)
works for me and resulted in
Group.1 x catv1v2v3v4
1cat1 5 cat1 0.6337076 0.2887081 0.3629962 0.5328683
2cat2 10 cat2 0.5519426 0.6076447 0.4593770 0.9632341
3cat3 11 cat3 0.6094089
Is there a function similar to combine.levels ( in the Hmisc package)
that combines the levels of factors, but not based on their frequency.
Alternatively, I am looking into using the significance of the dummy
variables of factors based on their Pr(|t|) value using the linear
model, then deleting
On 07/09/2010 05:33 PM, Saeed Abu Nimeh wrote:
Is there a function similar to combine.levels ( in the Hmisc package)
that combines the levels of factors, but not based on their frequency.
Alternatively, I am looking into using the significance of the dummy
variables of factors based on their
Does anyone have an idea on this?
On 6 Lip, 11:32, Timo W esuomi...@gmail.com wrote:
Hi,
I have a matrix of results of multiple 2x2 chi^2 tests, non-
significant tests are marked as TRUE. Is there a function for grouping
those variables in a similar way LSD.test from agricolae library does?
.
}
I wish to load mydata.Rdata only within the function f1.
Perhaps I have misunderstood the capabilities of load(),
or the environment concepts.
Thank you for any help you may give.
Cordially,
Giles Crane
--
View this message in context:
http://r.789695.n4.nabble.com/Loading-Rdata-within-an-R
On Jul 8, 2010, at 3:21 PM, Giles Crane wrote:
Colleagues:
I am having trouble loading data from within .Rdata file
within the environment of a function. That is,
the following always loads to the global environment:
f1 - function(){
load(mydata.Rdata)
# compute
On 08/07/2010 3:21 PM, Giles Crane wrote:
Colleagues:
I am having trouble loading data from within .Rdata file
within the environment of a function. That is,
the following always loads to the global environment:
f1 - function(){
load(mydata.Rdata)
# compute
On 08/07/2010 6:21 PM, Duncan Murdoch wrote:
On 08/07/2010 3:21 PM, Giles Crane wrote:
Colleagues:
I am having trouble loading data from within .Rdata file
within the environment of a function. That is,
the following always loads to the global environment:
f1 - function(){
, Robert A LaBudde wrote:
At 05:10 PM 7/5/2010, Gregory Gentlemen wrote:
Dear R-users,
Is there an R function to compute the multinomial beta function? That
is, the normalizing constant that arises in a Dirichlet distribution.
For example, with three parameters the beta function is
Beta(n1,n2,n2
Hi,
I have a matrix of results of multiple 2x2 chi^2 tests, non-
significant tests are marked as TRUE. Is there a function for grouping
those variables in a similar way LSD.test from agricolae library does?
I reviewed LSD.test's source but it's not helpful for me.
This is my matrix:
[,1]
Dear R-users,
Is there an R function to compute the multinomial beta function? That is, the
normalizing constant that arises in a Dirichlet distribution. For example, with
three parameters the beta function is Beta(n1,n2,n2) =
Gamma(n1)*Gamma(n2)*Gamma(n3)/Gamma(n1+n2+n3)
Thanks in advance
How about this?
mbeta - function(...) {
exp(sum(lgamma(c(...)))-lgamma(sum(c(...
}
gamma(5)*gamma(6)*gamma(7)/gamma(18)
[1] 5.829838e-09
mbeta(5,6,7)
[1] 5.829838e-09
On Mon, 2010-07-05 at 17:10 -0400, Gregory Gentlemen wrote:
Dear R-users,
Is there an R function to compute
At 05:10 PM 7/5/2010, Gregory Gentlemen wrote:
Dear R-users,
Is there an R function to compute the multinomial beta function?
That is, the normalizing constant that arises in a Dirichlet
distribution. For example, with three parameters the beta function
is Beta(n1,n2,n2) = Gamma(n1)*Gamma(n2
On 2010-06-20 23:33, zhu yao wrote:
Dear R users:
In stat, there is a stpower function for power analysis and sample-size
determination in survival
models. Is there a counterpart in R?
library(sos)
findFn(power)
-Peter Ehlers
Thanks
Yao Zhu
Department of Urology
Fudan University
Dear R users:
In stat, there is a stpower function for power analysis and sample-size
determination in survival
models. Is there a counterpart in R?
Thanks
Yao Zhu
Department of Urology
Fudan University Shanghai Cancer Center
Shanghai, China
[[alternative HTML version deleted]]
Perfect. Thanks Erik.
On Thu, Jun 17, 2010 at 1:07 AM, Erik Iverson er...@ccbr.umn.edu wrote:
Vishwanath Sindagi wrote:
Hi,
Suppose a write a function
a_fn-function(arg1)
{
return(table(arg1));
}
I have a column called AGE. Now I call the function c = a_fn(AGE);
When a_fn is
Hi,
Suppose a write a function
a_fn-function(arg1)
{
return(table(arg1));
}
I have a column called AGE. Now I call the function c = a_fn(AGE);
When a_fn is called, AGE is received in arg1. My question is, how do I
access the actual name of the argument arg1? i.e, inside the
function, i
Vishwanath Sindagi wrote:
Hi,
Suppose a write a function
a_fn-function(arg1)
{
return(table(arg1));
}
I have a column called AGE. Now I call the function c = a_fn(AGE);
When a_fn is called, AGE is received in arg1. My question is, how do I
access the actual name of the argument arg1?
Try
# data
AGE - rpois(25, 30)
# option 1
foo - function(string) table(get(deparse(substitute(string
foo(AGE)# no quotes
# option 2
foo2 - function(string) table(get(string))
foo2('AGE') # note the quotes here
HTH,
Jorge
On Wed, Jun 16, 2010 at 11:30 AM, Vishwanath Sindagi wrote:
Dear list,
I would like to ask you a question. I'm trying to build the time series'
production with the Divisia index. The final step would require to do the
following calculations:
a)PROD(2006)=PROD(2007)/1+[DELTA_PROD(2007)]
b)PROD(2005)=PROD(2006)+[1+DELTA_PROD(2006)]
This is what you asked for.
Prod2007 - 1:10
Prod2006 - Prod2007/1+c(0,diff(Prod2007))
Prod2005 - Prod2006+(1+c(0,diff(Prod2006)))
Prod2004 - Prod2005+(1+c(0,diff(Prod2005)))
Prod2006
[1] 1 3 4 5 6 7 8 9 10 11
Prod2005
[1] 2 6 6 7 8 9 10 11 12 13
Prod2004
[1] 3 11 7
Dear list,
I would like to ask you a question. I'm trying to build the time series'
production with the Divisia index. The final step would require to do the
following calculations:
a)PROD(2006)=PROD(2007)/[1+DELTA_PROD(2007)/100]
b)PROD(2005)=PROD(2006)/[1+DELTA_PROD(2006)/100]
-project.org
Ogg: Re: [R] function
This is what you asked for.
Prod2007 - 1:10
Prod2006 - Prod2007/1+c(0,diff(Prod2007))
Prod2005 - Prod2006+(1+c(0,diff(Prod2006)))
Prod2004 - Prod2005+(1+c(0,diff(Prod2005)))
Prod2006
[1] 1 3 4 5 6 7 8 9 10 11
Prod2005
[1] 2 6 6 7 8 9 10
note: whole function is below- I am sure I am doing something silly.
when I use it like USGS(input=precipitation) it is choking on the
precip.1 - subset(DF, precipitation!=NA)
b - ddply(precip.1$precipitation, .(precip.1$gauge_name), cumsum)
DF.precip - precip.1
DF.precip$precipitation -
I don't think you can do this
precipitation!=NA)
have a look at ?is.na
--- On Tue, 5/18/10, stephen sefick ssef...@gmail.com wrote:
From: stephen sefick ssef...@gmail.com
Subject: [R] Function that is giving me a headache- any help appreciated
(automatic read )
To: r-help@r-project.org
:
From: stephen sefickssef...@gmail.com
Subject: [R] Function that is giving me a headache- any help appreciated
(automatic read )
To: r-help@r-project.org
Received: Tuesday, May 18, 2010, 12:38 PM
note: whole function is below- I am
sure I am doing something silly.
when I use it like USGS(input
precip.1 - subset(DF, precipitation!=NA)
b - ddply(precip.1$precipitation, .(precip.1$gauge_name), cumsum)
DF.precip - precip.1
DF.precip$precipitation - b$.data
I suspect what you want here is
ddply(precip.1, gauge_name, transform, precipitation = cumsum(precipitation))
Hadley
--
Dear R-list members,
About the parameter n of the function density() (Kernel Density
Estimation, package stats):
The R HTML documentation says about the parameter n: the number
of equally spaced points at which the density is to be estimated.
When n 512, it is rounded up to the next power of
Dear list,
I'm trying to implement the following function, but what I get is an error
message and I don't understand where is the error:
#outliers'identification:
iqr=lapply(bb,function(){
inner_fencesl=quantile(x,0.25)-1.5*IQR(x)
inner_fencesh=quantile(x,0.75)+1.5*IQR(x)
There is too little information to answer your question definitively.
However, an obvious reason is that you want to apply the function over
columns of a data.frame, which is done with apply(), but you try to apply
the function over elements of a list using lapply(). A list is not a
data.frame
I missed the original query, but here am replying to the respondent.
On Wed, May 12, 2010 at 1:28 PM, Daniel Malter dan...@umd.edu wrote:
There is too little information to answer your question definitively.
However, an obvious reason is that you want to apply the function over
columns of a
On May 12, 2010, at 1:28 PM, Daniel Malter wrote:
There is too little information to answer your question definitively.
However, an obvious reason is that you want to apply the function over
columns of a data.frame, which is done with apply(), but you try to
apply
the function over
-Original Message-
From: r-help-boun...@r-project.org
[mailto:r-help-boun...@r-project.org] On Behalf Of David Winsemius
Sent: Wednesday, May 12, 2010 10:41 AM
To: Daniel Malter
Cc: r-help@r-project.org
Subject: Re: [R] function
On May 12, 2010, at 1:28 PM, Daniel Malter wrote
Fair enough, my mistake. However, I am quite fascinated how that focuses
everybody else on picking on the intitial answer and diverts everybody away
from anwering the actual question. All the more it points to the second
paragraph of my reply, namely that all modular components of the function
Try this:
lapply(bb, function(x)quantile(x, c(0.25, 0.75)) - matrix(IQR(x) * c(1.5,
3), nrow = 2) %*% c(-1, 1))
On Wed, May 12, 2010 at 1:44 PM, n.via...@libero.it n.via...@libero.itwrote:
Dear list,
I'm trying to implement the following function, but what I get is an error
message and I
On May 12, 2010, at 2:50 PM, Daniel Malter wrote:
Fair enough, my mistake. However, I am quite fascinated how that
focuses
everybody else on picking on the intitial answer and diverts
everybody away
from anwering the actual question. All the more it points to the
second
paragraph of my
Hi,
I am looking for a established R function or package which does the
multivariate local linear regression. I mean the predictor x is
multi-dimensional. locpoly() is the univariate version. I am wondering if there
is a multivariate version besides the function loess().
Thank you
On May 6, 2010, at 11:44 AM, Bo Li wrote:
Hi,
I am looking for a established R function or package which does the
multivariate local linear regression. I mean the predictor x is
multi-dimensional. locpoly() is the univariate version. I am
wondering if there is a multivariate version
On 05/02/2010 10:00 PM, Duncan Murdoch wrote:
...
I've seen this description a couple of times lately, and I think it's
worth pointing out that it's misleading. The deparse(substitute(x))
trick returns the *expression* that was passed to the argument x.
Sometimes that's the name of a variable,
Jim Lemon wrote:
On 05/02/2010 10:00 PM, Duncan Murdoch wrote:
...
I've seen this description a couple of times lately, and I think it's
worth pointing out that it's misleading. The deparse(substitute(x))
trick returns the *expression* that was passed to the argument x.
Sometimes that's the
On 05/02/2010 11:56 AM, R K wrote:
Hello,
I was wondering if someone could tell me how I can make text dependent on a
variable in a R function I have created.
The function will create plots, thus I would like each plot to have a unique
title based on the inputted variable as well
On 02/05/2010 4:07 AM, Jim Lemon wrote:
On 05/02/2010 11:56 AM, R K wrote:
Hello,
I was wondering if someone could tell me how I can make text dependent on a
variable in a R function I have created.
The function will create plots, thus I would like each plot to have a unique
title based
say x is the variable.
plot(..., title=paste(x, whatever else), ...) should work as well.
same should work with file names as well.
Nikhil
On May 1, 2010, at 9:56 PM, R K wrote:
Hello,
I was wondering if someone could tell me how I can make text
dependent on a variable in a R function
, 0.5, 0.75, 1)
plot(x, main=paste(x, whatever))
--
David
Nikhil
On May 1, 2010, at 9:56 PM, R K wrote:
Hello,
I was wondering if someone could tell me how I can make text
dependent on a variable in a R function I have created.
The function will create plots, thus I would like each
Nikhil
On May 1, 2010, at 9:56 PM, R K wrote:
Hello,
I was wondering if someone could tell me how I can make text dependent on
a variable in a R function I have created.
The function will create plots, thus I would like each plot to have a
unique title based on the inputted variable
Hello,
I was wondering if someone could tell me how I can make text dependent on a
variable in a R function I have created.
The function will create plots, thus I would like each plot to have a unique
title based on the inputted variable as well as a unique file name when saved
using
On Sun, 2 May 2010, R K wrote:
Hello,
I was wondering if someone could tell me how I can make text dependent
on a variable in a R function I have created.
example( deparse )
HTH,
Chuck
The function will create plots, thus I would like each plot to have a unique
title based
Thanks so much
Douglas Bates a écrit :
image applied to a sparseMatrix object uses lattice functions to
create the image. As described in R FAQ 7.22 you must use
print(image(x))
or
show(image(x))
or even
plot(image(x))
when a lattice function is called from within another
Hi,
I'm getting crazy:
This does work:
library(Matrix)
a1-b1-c(1,2)
c1-rnorm(2)
aDgt-spMatrix(ncol=3,nrow=3,i=a1,j=b1,x=c1)
png(myImage.png)
image(aDgt)
dev.off()
But this doesn't !!!
f-function(x){
png(myImage.png)
image(x)
dev.off()
}
f(aDgt)
My image is saved as a text file and contains
image applied to a sparseMatrix object uses lattice functions to
create the image. As described in R FAQ 7.22 you must use
print(image(x))
or
show(image(x))
or even
plot(image(x))
when a lattice function is called from within another function.
On Wed, Apr 28, 2010 at 1:20 PM, Gildas Mazo
Giovanni,
You can use the '...' for that, as in:
loocv - function(data, fnc, ...) {
n - length(data.x)
score - 0
for (i in 1:n) {
x_i - data.x[-i]
y_i - data.y[-i]
yhat - fnc(x=x_i,y=y_i, ...)
score - score + (y_i - yhat)^2
}
score - score/n
return(score)
}
scoreks -
801 - 900 of 1323 matches
Mail list logo