Hello,
I have a function like this:
fun - function (x, y) {
a - log(10)*y
b - log(15)*x
extr - a-b
extr
}
fun(2,3)
[1] 1.491655
x - c(1,2,3)
y - c(4,5,6)
fun(x, y)
[1] 6.502290 6.096825 5.691360
How do I have to modify my function that I can
On 9/2/07, Lauri Nikkinen [EMAIL PROTECTED] wrote:
I have a function like this:
fun - function (x, y) {
a - log(10)*y
b - log(15)*x
extr - a-b
extr
}
fun(2,3)
[1] 1.491655
x - c(1,2,3)
y - c(4,5,6)
fun(x, y)
[1] 6.502290 6.096825
Yeah, exactly. Thanks. The solution was too obvious :-)
Cheers,
Lauri
2007/9/2, [EMAIL PROTECTED] [EMAIL PROTECTED]:
Hello,
I have a function like this:
fun - function (x, y) {
a - log(10)*y
b - log(15)*x
extr - a-b
extr
}
On 9/2/07, Paul Smith [EMAIL PROTECTED] wrote:
I have a function like this:
fun - function (x, y) {
a - log(10)*y
b - log(15)*x
extr - a-b
extr
}
fun(2,3)
[1] 1.491655
x - c(1,2,3)
y - c(4,5,6)
fun(x, y)
[1] 6.502290
outer(x,y,fun)
Lauri Nikkinen wrote:
Hello,
I have a function like this:
fun - function (x, y) {
a - log(10)*y
b - log(15)*x
extr - a-b
extr
}
fun(2,3)
[1] 1.491655
x - c(1,2,3)
y - c(4,5,6)
fun(x, y)
[1] 6.502290 6.096825
Just to add to this be sure you do have names if you want them
and read about vectorization in ?outer in case fun was just an
example and your actual fun is more complex:
x - c(1,2,3)
names(x) - x
y - c(4,5,6)
names(y) - y
outer(x, y, fun) # as in previous answer
# or
outer(-log(15) * x,
GaGr == Gabor Grothendieck [EMAIL PROTECTED]
on Thu, 16 Aug 2007 23:46:28 -0400 writes:
GaGr Get the indices using expand.grid and then reorder
GaGr them: set.seed(1); X - array(rnorm(24), 2:4) # input
GaGr X # look at X
GaGr do.call(expand.grid, sapply(dim(X),
Dear list,
I am looking for a function/way to get the array coordinates of given
elements in an array. What I mean is the following:
- Let X be a 3D array
- I find the ordering of the elements of X by ord - order(X) (this
returns me a vector)
- I now want to find the x,y,z coordinates of each
A not very good solution is as below:
If your array's dimensions were KxMxN and the linear
index is i then
n - ceiling(i/(K*M))
i1 - i - (n-1)*(K*M)
m - ceiling(i1/K)
k - i1 - (m-1)*K
and your index is (k,m,n)
I am almost sure that there is a function in R which
does this (it exists in Matlab).
See arrayIndex() in the R.utils package, e.g.
X - array((2*3*4):1, dim=c(2,3,4))
idx - 1:length(X)
ijk - arrayIndex(idx, dim=dim(X))
print(ijk)
[,1] [,2] [,3]
[1,]111
[2,]211
[3,]121
[4,]221
[5,]131
[6,]231
[7,]1
If I am correctly understanding the problem, I think that this is what
you want:
set.seed(1)
# Create a 3x3x3 array
ARR - array(sample(100, 27), c(3, 3, 3))
ARR
, , 1
[,1] [,2] [,3]
[1,] 27 89 97
[2,] 37 20 62
[3,] 57 86 58
, , 2
[,1] [,2] [,3]
[1,]6 61
[Ana Conesa]
I am looking for a function/way to get the array coordinates of given
elements in an array. What I mean is the following:
- Let X be a 3D array
- I find the ordering of the elements of X by ord - order(X)
(this returns me a vector)
- I now want to find the x,y,z coordinates
Get the indices using expand.grid and then reorder them:
set.seed(1); X - array(rnorm(24), 2:4) # input
X # look at X
do.call(expand.grid, sapply(dim(X), seq))[order(X),]
On 8/16/07, Ana Conesa [EMAIL PROTECTED] wrote:
Dear list,
I am looking for a function/way to get the array coordinates
Hi,
I was wondering if there is already some function
implemented into R that reads in tables with more than
2 dimensions. There is probably something neat out
there...
Thanks,
Werner
Wissenswertes zum Thema PC, Zubehör oder Programme. BE A BETTER
INTERNET-GURU! www.yahoo.de/clever
Never mind, using scan() and putting it into an array
of the specific dimensions is sufficient for my case.
But it still would be interesting to know if there is
some function to read in more complex data objects.
Thanks,
Werner
Hi,
I was wondering if there is already some function
Stripping either or both ends can be achieved by the somewhat tortuous but
fairly general
stripspace-function(x) sub(^\\s*([^ ]*.*[^ ])\\s*$, \\1,x)
which uses a replacement buffer to keep the useful part of the string.
Prof Brian Ripley [EMAIL PROTECTED] 06/08/2007 21:23:49
I am sure Marc
I feel like an idiot posting this because every language I've ever seen has a
string function that trims blanks off strings (off the front or back or
both). Ideally, it would process whole data frames/matrices etc but I don't
even see one that processes a single string. But I've searched and I
On Mon, 2007-08-06 at 12:15 -0700, adiamond wrote:
I feel like an idiot posting this because every language I've ever seen has a
string function that trims blanks off strings (off the front or back or
both). Ideally, it would process whole data frames/matrices etc but I don't
even see one
Use trim from:
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/40714.html
or trim from gdata or trimWhiteSpace from limma in BioConductor.
RSiteSearch(trim) and help.search(trim) can locate such functions.
s - c( abc , def ) # vector
m - cbind(a = s, b = s) # matrix
DF - as.data.frame(m) #
On Mon, 2007-08-06 at 21:23 +0100, Prof Brian Ripley wrote:
I am sure Marc knows that ?sub has examples of trimming trailing space and
whitespace in various styles.
Indeed, though leading spaces are not covered there, so thought that I
would take a minute or two to provide both and the
PROTECTED] On Behalf Of
Ronaldo Reis Junior
Sent: Monday, July 23, 2007 4:05 PM
To: R-Help
Subject: [R] Function to separate effect in AOV
Hi,
I have a dummy question.
Suppose that I have two explanatory variable, T1 (A, B) and
T2 (C, D) and one response variable.
attach(dados
Dear all,
To modelize the abundance of fish (4 classes) with a set of environmental
variables, I used the polr and predict.polr functions. I would like to know how
to bring the cumulated probabilities back to a discrete ordinal scale.
For the moment I used the predict.polr function with the
Dear useRs,
I have written a function that implements a Bayesian method to
compare a patient's score on two tasks with that of a small control
group, as described in Crawford, J. and Garthwaite, P. (2007).
Comparison of a single case to a control or normative sample in
neuropsychology:
You need to make use of the profiling methods described in 'Writing R
Exensions'. My machine is about 4x faster than yours: I get
Each sample represents 0.02 seconds.
Total run time: 62.08041 seconds.
Total seconds: time spent in function and callees.
Self seconds: time spent in
Hi,
I have a dummy question.
Suppose that I have two explanatory variable, T1 (A, B) and T2 (C, D) and one
response variable.
attach(dados)
tapply(Y,list(T1,T2),mean)
CD
A 2.20 10.2
B 2.22 20.26667
In this case, A and B inside C have no difference, but have
Hi R Users!
Thanks in advance.
I am using R-2.5.1 on Windows XP and I have installed all necessary tools
such as perl and tools.exe.
I am trying to use sample(1:100, 3, rep=F) in C. How can I use this R
function in C?
Once again thank you very much for your time
--- Stephen Tucker [EMAIL PROTECTED] wrote:
Dear John,
Perhaps I am mistaken in what you are trying to
accomplish but it seems like
what is required is that you call lstfun() outside
of ukn(). [and remove the
call to lstfun() in ukn()].
nts - lstfun(myfile, aa, bb)
results - ukn(dd1,
, nts$cda) ###
modified how called.
- Original Message -
From: John Kane [EMAIL PROTECTED]
To: R R-help r-help@stat.math.ethz.ch
Sent: Thursday, June 28, 2007 12:03 PM
Subject: [R] Function call within a function.
I am trying to call a funtion within another
function
and I
PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of John Kane
Sent: Thursday, June 28, 2007 12:04 PM
To: R R-help
Subject: [R] Function call within a function.
I am trying to call a funtion within another
function
and I clearly am misunderstanding what I should
do.
Below
-help@stat.math.ethz.ch
Sent: Thursday, June 28, 2007 12:03 PM
Subject: [R] Function call within a function.
I am trying to call a funtion within another
function
and I clearly am misunderstanding what I should
do.
Below is a simple example.
I know lstfun works on its own but I cannot
[SNIP]
This has been very helpful though I still do not
understand why one must call nts$cda using the
eval(parse()) command. Is it because nts is created
within the ukn environment?
You don't *have* to use the eval(parse()). This works just as
well: mysum - nts$cda.
However, it
Hello R:
I am working with a self-defined function and I wish to subject a list
(t) to this function. My list is a list of tables:
$rs7609589
2/2 2/4 4/4 2/2 2/4 4/4
89 188 87 89 188 87
$rs3909907
1/1 1/4 4/4
94 178 92
$rs12748004
0/0 1/3 3/3
37 150 177
$rs6695928
2/2 2/4 4/4
35
Try whit rownames.
--
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40 S 49° 16' 22 O
On 28/06/07, G E [EMAIL PROTECTED] wrote:
Hello R:
I am working with a self-defined function and I wish to subject a list
(t) to this function. My list is a list of tables:
$rs7609589
2/2 2/4
Thank you Henrique,
rownames also gives me the header of the table, but not the name of the
list-element...
Any other idea?
Wishing you a good day, Georg.
**
Georg Ehret
Johns Hopkins University
Baltimore
On 6/28/07, Henrique Dallazuanna [EMAIL PROTECTED] wrote:
Try whit rownames.
I am trying to call a funtion within another function
and I clearly am misunderstanding what I should do.
Below is a simple example.
I know lstfun works on its own but I cannot seem to
figure out how to get it to work within ukn. Basically
I need to create the variable nts. I have probably
missed
Perhaps, you can get the name of list element whit:
unlist(lapply(list_name, rownames))
--
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40 S 49° 16' 22 O
On 28/06/07, Georg Ehret [EMAIL PROTECTED] wrote:
Thank you Henrique,
rownames also gives me the header of the table, but not
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of John Kane
Sent: Thursday, June 28, 2007 12:04 PM
To: R R-help
Subject: [R] Function call within a function.
I am trying to call a funtion within another function
and I clearly am misunderstanding
Dear John,
Perhaps I am mistaken in what you are trying to accomplish but it seems like
what is required is that you call lstfun() outside of ukn(). [and remove the
call to lstfun() in ukn()].
nts - lstfun(myfile, aa, bb)
results - ukn(dd1, a, b, nts$cda)
Alternatively, you can eliminate the
HERE
mysum - eval(parse(text=nam1))
#mysum - nam1[,3]*5
return(mysum)
}
results - ukn(dd1, a, b, nts$cda) ### modified how called.
- Original Message -
From: John Kane [EMAIL PROTECTED]
To: R R-help r-help@stat.math.ethz.ch
Sent: Thursday, June 28, 2007 12:03 PM
Subject: [R] Function
Hi, I am trying to write a function with the following codes and I would like
it to return the values for alpha
beta para parab seperately. Then I would like to use this funstion for
variable with factor a and b. But the result turns out to be a matrix
with element like Numeric,2 ... I guess
You wChange the function 'parameter'
sapply(split(variable,list(a,b)),parameter)
On 6/19/07, livia [EMAIL PROTECTED] wrote:
Hi, I am trying to write a function with the following codes and I would
like
it to return the values for alpha
beta para parab seperately. Then I would like to use
First, to return several values from your function 'parameter', you can use
a list:
parameter - function (...) {
...
list(alpha=alpha,beta=beta,para=para,parab=parab)
}
Then, you may use:
sapply(split(variable,list(a,b)), parameter)
(tapply also works but return a matrix of lists)
HI
Is there any function in R that tells us error rate(misclassification rate)
for logistic regression type classification?
i also want to know the function to determine type I and type II error.
I have found a link where misclass and confusion are used. But I dont
know the package name.
Hi,
I'm a new user trying to switch from SAS, so sorry for the beginner's
question: Suppose I have a dataframe DF that contains variables X,Y,Z. I am
trying to write a function like this:
myplot - function(varname){xyplot(varname ~ Y, group = Z, data = DF)}.
The problem is then how to enter X
You need to reference the data.frame or append it.
myplot(DF$X) should work
or
append(DF)
myplot(X)
--- Diego Gruber [EMAIL PROTECTED] wrote:
Hi,
I'm a new user trying to switch from SAS, so sorry
for the beginner's
question: Suppose I have a dataframe DF that
contains variables X,Y,Z.
Thanks a lot for your suggestions. Referencing the dataset solved the
problem. I had actually tried it before but since I was also subsetting the
datset within the function (something I didn't mention in my question) the
objects were not of the same length and that caused me trouble. Your comment
Hi,
Assume that we may model the Nottingham temperature data (nottem) or Sunspot
data (sunspot) set by a nonparametric autoregressive model of the form
Yt = m(Yt-1) + et.
Using the kernel estimation method, produce the resulting plots. We may use
the fucntion
Ken Nussear knussear at mac.com writes:
I'm running a series of mixed models using lme, and I wonder if there
is a way to sort them by AIC prior to testing using anova
(lme1,lme2,lme3,lme7) other than by hand.
You can try something like the following. However, also consider using
Hello everybody,
I am a new R user. At current moment I need to do a Principal Components
Analysis with a table who contain mixed variables (categorical and
numerical). There is some function available in R for transform these
variables?
For example: I need transform the categorical variable X
?model.matrix
?contr.treatment
Whether this makes sense for PCA is another matter: princomp() contains a
test to stop this happening automatically with a formula argument. One
problem is the result depends on just how you do the transformation.
On Thu, 24 May 2007, J.Andrés Martínez wrote:
Hi J. Andres,
You are probably better off using the ade4 package, which has two functions
that will do exactly what you want, i.e. a PCA using mixed quantitative and
categorical variables:
## You will need to download ade4 first
library(ade4)
?dudi.hillsmith
?dudi.mix
Regards,
Mark Difford.
Hello again,
I got it with dudi.mix included in ade4 library that Mark told.
Thank you very much to all!
J. Andres
On 5/24/07, Mark Difford [EMAIL PROTECTED] wrote:
Hi J. Andres,
You are probably better off using the ade4 package, which has two
functions
that will do exactly what you
Ken Nussear knussear at mac.com writes:
I'm running a series of mixed models using lme, and I wonder if
there
is a way to sort them by AIC prior to testing using anova
(lme1,lme2,lme3,lme7) other than by hand.
You can try something like the following. However, also consider
On 5/24/07, Ken Nussear [EMAIL PROTECTED] wrote:
Ken Nussear knussear at mac.com writes:
I'm running a series of mixed models using lme, and I wonder if
there
is a way to sort them by AIC prior to testing using anova
(lme1,lme2,lme3,lme7) other than by hand.
You can try
On May 24, 2007, at 2:12 PM, Douglas Bates wrote:
On 5/24/07, Ken Nussear [EMAIL PROTECTED] wrote:
Ken Nussear knussear at mac.com writes:
I'm running a series of mixed models using lme, and I wonder if
there
is a way to sort them by AIC prior to testing using anova
Hi List
I'm running a series of mixed models using lme, and I wonder if there
is a way to sort them by AIC prior to testing using anova
(lme1,lme2,lme3,lme7) other than by hand.
My current output looks like this.
anova
Hi,
I am struggling with using R CMD BATCH command. Kindly suggest solution to
the following problem.
I have a function named CinC with accept two input parameters. This can be
shown as:
CinC - function(start, end)
where start and end both are character strings.
Please suggest me how can I
)
CinC(command.args[1],command.args[2])
--
View this message in context:
http://www.nabble.com/Running-R-function-as-a-Batch-process-tf3764048.html#a10640433
Sent from the R help mailing list archive at Nabble.com.
__
R-help@stat.math.ethz.ch mailing
:\logout.txt
Regards
Alex
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of d. sarthi
maheshwari
Sent: May 16, 2007 8:29 AM
To: r-help@stat.math.ethz.ch
Subject: [R] Running R function as a Batch process
Hi,
I am struggling with using R CMD BATCH command
I am using the graph package, which has a function called union()
that acts on graph objects. There is also a {base} function called
union(). How do I explicitly specify union {graph} instead of the
default union {base} ?
union(g1, g2) evokes the wrong union(), which produces an error.
#Is there a single function similar to get that works for both an object, and
elements of an object ?
#(I want the function to be able to return objects, and/or the deeper elements
of an object.)
#(i.e. elements of a dataframe and/or list)?
#e.g.
tempdf = data.frame(a=c(4,5,6) ,
Try:
get('tempdf')$a
get('templist')$x
On 5/12/07, new ruser [EMAIL PROTECTED] wrote:
#Is there a single function similar to get that works for both an object,
and elements of an object ?
#(I want the function to be able to return objects, and/or the deeper
elements of an object.)
Hello,
I am feeling that this question can have a very simple answer, but I
can't find it.
I need to use the function knn.dist from knnflex library.
Whatever I try, I get the error:
Error in as.vector.dist(x, character) : unused argument(s) (character)
First example:
a-NULL
On Wed, 11 Apr 2007, [EMAIL PROTECTED] wrote:
Hello,
I am feeling that this question can have a very simple answer, but I
can't find it.
I need to use the function knn.dist from knnflex library.
Whatever I try, I get the error:
Error in as.vector.dist(x, character) : unused argument(s)
Hello,
Has anyone written R functions for applying self-controlled case series
methods (http://statistics.open.ac.uk/sccs/).
In fact only thing needed is to modify glm function to allow absorption
of effect. Eg. in Poisson model individual effect is used as factor, but
it is considered as
Dear Jari
The problem is to build the dataset to apply the conditional logit
model. However, as far as I know, no R function exists.
BTW if you are dealing with time series of pollution and health, the
following two papers might be of interest of you:
It appears that the time series approach
, as far as I know, no R function exists.
BTW if you are dealing with time series of pollution and health, the
following two papers might be of interest of you:
It appears that the time series approach could be preferred.
Heather J. Whitaker, Mounia N. Hocine, C. Paddy Farrington
On case
Dear all, Why the transform function does not accept two statistics
functions?
a = data.frame(matrix(rnorm(20),ncol=2))
transform(a,M.1=mean(X1),M.2=mean(X2)) # does not works
#while:
transform(a,M.1=mean(X1),M2=log(abs(X2))) #works
Best regards
JL
lamack lamack wrote:
Dear all, Why the transform function does not accept two statistics
functions?
a = data.frame(matrix(rnorm(20),ncol=2))
transform(a,M.1=mean(X1),M.2=mean(X2)) # does not works
#while:
transform(a,M.1=mean(X1),M2=log(abs(X2))) #works
It's a variation of this
With help of list(), function can return ala of the results.
my.fun=function(vector, index){
a=fun.a(vector, index)
b=fun.b(vector, index)
return(list(a,b))
}
Example:
R : Copyright 2005, The R Foundation for Statistical Computing
Version 2.2.1 (2005-12-20 r36812)
ISBN
hello,
i have written a function to extract certain lines from a matrix. the
result is a matrix with 6 cols, named dynamically according to the
functions arguments.
the problem is now, that i'm not able to return the resultmatrix for
further use. the object is not being created.
example
Instead of trying to create object back in the global environment (which is
not really recommended from a function), return the answer in a list that
you can then access it as you want. Here is an example:
getans - function(x){
+ # create the name that you want in the list
+ .name -
my.fun=function(vector, index){
a=fun.a(vector, index)
b=fun.b(vector, index)
return(list(a=a, b=b))
}
On 3/1/07, Claudio Isella [EMAIL PROTECTED] wrote:
Dear R user,
I have a simple question for you: I have created a global function that
evoke other subsidiary functions. when
Dear R user,
I have a simple question for you: I have created a global function that
evoke other subsidiary functions. when I run the global function I want
to store the outcomes of the of each subsidiary function into a
variables. an examples
my.fun=function(vector, index){
a=fun.a(vector,
Hi,
I apologize if this topic has been discussed - I could not figure out
a good search phrase for this question.
I have a named vector x, with multiple (duplicate) names, and I would
like to obtain a (shorter) vector with non-duplicate names in which
the values are the means of the values of the
try this:
x - 1:30
names(x) - sample(LETTERS[1:5], 30, TRUE)
x
B B C E B E E D D A B A D B D C D E B D E B D A B
B A B E B
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
26 27 28 29 30
x - 1:30
names(x) - sample(LETTERS[1:5], 30,
PROTECTED]
CC: [EMAIL PROTECTED], r-help@stat.math.ethz.ch, Talbot Katz
[EMAIL PROTECTED]
Subject: Re: [R] Function to assign quantiles?
Date: Fri, 16 Feb 2007 19:51:49 +1300
On 2/16/07, Frank E Harrell Jr [EMAIL PROTECTED] wrote:
Marc Schwartz wrote:
On Thu, 2007-02-15 at 17:50 -0500, Talbot Katz
Hi.
If I call the quantiles function as follows:
qvec = quantiles(dvals,probs=seq(0,1,0.1))
the results will return a vector something like the following example:
0%10%20%30% 40% 50%60%70% 80% 90%
100%
56.0 137.3 238.4 317.9 495.8
On Thu, 2007-02-15 at 17:50 -0500, Talbot Katz wrote:
Hi.
If I call the quantiles function as follows:
qvec = quantiles(dvals,probs=seq(0,1,0.1))
the results will return a vector something like the following example:
0%10%20%30% 40% 50%60%70% 80%
Marc Schwartz wrote:
On Thu, 2007-02-15 at 17:50 -0500, Talbot Katz wrote:
Hi.
If I call the quantiles function as follows:
qvec = quantiles(dvals,probs=seq(0,1,0.1))
the results will return a vector something like the following example:
0%10%20%30% 40% 50%
On 2/16/07, Frank E Harrell Jr [EMAIL PROTECTED] wrote:
Marc Schwartz wrote:
On Thu, 2007-02-15 at 17:50 -0500, Talbot Katz wrote:
Hi.
If I call the quantiles function as follows:
qvec = quantiles(dvals,probs=seq(0,1,0.1))
the results will return a vector something like the
of this system called it directly from the DB
(PostgreSQL) in form of PL/R, I haven't found Oracle to have this
capability. So I'm thinking that the solution might be to make a short C++
wrapper for the R function.
Looking at the documentation I was only able to run R functions in C++ if
the C++ function
Hey guys.
I have Installed and running JRI from Java
and it works. Using : java -cp jri.jar; MainApp.java
The problem is How do I calling R function that need R library
I have tried these with my Java program :
x = re.eval(glm( y ~ x1 + x2, family = poisson
On Thu, 14 Dec 2006, Rajesh Krishnan wrote:
Hi all,
I was wondering if there is a function available in any of the R add-on
packages that could be used to fit a STARIMA (Phillip E. Pfeifer and
Stuart Jay Deutsch. (1980). A STARIMA Model-Building Procedure with
Application to Description
Hi all,
I was wondering if there is a function available in any of the R add-on
packages that could be used to fit a STARIMA (Phillip E. Pfeifer and
Stuart Jay Deutsch. (1980). A STARIMA Model-Building Procedure with
Application to Description and Regional Forecasting, Transactions of
the
On 11/9/06, Bill Hunsicker [EMAIL PROTECTED] wrote:
I am trying to create a function that i pass a data set to and have the
function return some calculations based on data.
Allow me to illustrate:
myfunc - function(lst,mn,sd){
lst - sort(lst)
mn - mean(lst)
sd - sqrt(var(lst))
On Thu, 2006-11-09 at 12:58 -0500, Bill Hunsicker wrote:
R-help,
I am trying to create a function that i pass a data set to and have the
function return some calculations based on data.
Allow me to illustrate:
myfunc - function(lst,mn,sd){
lst - sort(lst)
mn - mean(lst)
On Thu, 2006-11-09 at 12:15 -0600, Marc Schwartz wrote:
On Thu, 2006-11-09 at 12:58 -0500, Bill Hunsicker wrote:
R-help,
I am trying to create a function that i pass a data set to and have the
function return some calculations based on data.
Allow me to illustrate:
myfunc -
Hello all.
I can find no function to compute norms (even the basic two-norm) of a
vector in the online help (within the GUI) or the downloadable
documentation.
Thanks.
- dan elliott
[[alternative HTML version deleted]]
__
The following code works fine:
# g is the function that returns the square of a number
g - function(y) y^2
# f1 is a function that takes one function
# as argument, and returns another function
f1 - function(f) function(x) f(x+1) - f(x)
# h(x) is g(x+1) - g(x) or 2x + 1
h - f1(g)
# h(1) = 3
#
On 10/10/2006 3:53 PM, Alberto Monteiro wrote:
The following code works fine:
# g is the function that returns the square of a number
g - function(y) y^2
# f1 is a function that takes one function
# as argument, and returns another function
f1 - function(f) function(x) f(x+1) - f(x)
#
On 10/10/06, Alberto Monteiro [EMAIL PROTECTED] wrote:
The following code works fine:
# g is the function that returns the square of a number
g - function(y) y^2
# f1 is a function that takes one function
# as argument, and returns another function
f1 - function(f) function(x) f(x+1) -
Deepayan Sarkar wrote:
# f1 is a function that takes one function
# as argument, and returns another function
f1 - function(f) function(x) f(x+1) - f(x)
# h(x) is g(x+1) - g(x) or 2x + 1
h - f1(g)
h
function(x) f(x+1)-f(x)
environment: 0264BE84
Presumably, 'f' takes the value 'g' in
Dear R-helpers,
I want to smooth a scatter plot (or 2d histogram) to generate the density
map using a squared Euclidean kernel function, with each data point
contributing a density of 1/(r*r + k) to each cell on the heatmap, where
r*r was the squared Euclidean distance between the coordinates of
Dear R-user,
Did anybody know how to calculate the kappa statistics of two vectors for
the agreement? for example:
a-c(0,1,0,0,1,0)
b-c(0,1,1,0,0,1)
I know the percent of agreement is 3/6, but how to get the kappa?
[[alternative HTML version deleted]]
: [R] R function to compute kappa statistics for two vector
Dear R-user,
Did anybody know how to calculate the kappa statistics of two vectors for
the agreement? for example:
a-c(0,1,0,0,1,0)
b-c(0,1,1,0,0,1)
I know the percent of agreement is 3/6, but how to get the kappa?
[[alternative
Philip He [EMAIL PROTECTED] writes:
Dear R-user,
Did anybody know how to calculate the kappa statistics of two vectors for
the agreement? for example:
a-c(0,1,0,0,1,0)
b-c(0,1,1,0,0,1)
I know the percent of agreement is 3/6, but how to get the kappa?
Multiple packages appear to
Dear R-list,
the following function f changes L. I thought, assignments within
functions are only local?
f-function(LL)
{ for (ll in LL)
{ ll$txt-changed in f
}
}
l-list(txt=original value)
L-list(l)
L[[1]]$txt
f(L)
L[[1]]$txt
gives (using R 2.3.1):
...
L[[1]]$txt
[1] original value
On 9/11/2006 4:49 AM, Moeltner, Andreas wrote:
Dear R-list,
the following function f changes L. I thought, assignments within
functions are only local?
That looks like a bug, still present in R-patched and R-devel. (I
haven't got the latest pre-release built yet today, but I expect it's
Hi,
Can anyone tell me which function in R gives the hessian matrix of the
log-likelihood of a nonlinear mixed model? fdHess is for scarlar function
only.
Thanks in advance!
Hongmei
[[alternative HTML version deleted]]
__
1 - 100 of 380 matches
Mail list logo