> On May 24, 2015, at 6:35 AM, Narua wrote:
>
> Dear kd,
> thanks for your fast reply
> hm, I thougth, F is normally the abbrevation, but in R FALSE represents
> "false"?
> Anyway, your function works and I got the idea to work with "apply"
>
> I had actually a little more complicate function
Dear kd,
thanks for your fast reply :-D
hm, I thougth, F is normally the abbrevation, but in R FALSE represents
"false"?
Anyway, your function works.
I had actually a little more complicate functions (put I posted in the forum
first an easier example):
f<-function(a,b)((1/(sum(sqrt(1:a*sqrt(b)
Dear kd,
thanks for your fast reply
hm, I thougth, F is normally the abbrevation, but in R FALSE represents
"false"?
Anyway, your function works and I got the idea to work with "apply"
I had actually a little more complicate functions (put I posted in the forum
first an easier example):
f<-funct
i)))
x <- 1:4
sapply(x, ff, m=4)
sapply(x, FF, m=4)
Keep up with using R! :)
Best,
kd
Feladó: R-help [r-help-boun...@r-project.org] ; meghatalmazó: Narua
[maria@gmx.de]
Küldve: 2015. május 24. 0:21
To: r-help@r-project.org
Tárgy: [R] Problem with a
Hello ,
I want to try R for statistics.
Therefore, I defined a function f with parameters m and k, which calculates
a to sqrt(x) proportional density function:
f <- function(m,k)((1/(sum(sqrt(1:m*sqrt(k))
A function F sums the results in order to get a distribution function:
F <- function(
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of Peter Dalgaard
> Sent: Wednesday, May 20, 2009 8:16 AM
> To: De France Henri
> Cc: r-help@r-project.org
> Subject: Re: [R] problem with "APPLY&q
De France Henri wrote:
Hello,
The "apply" function seems to behave oddly with my code below
NB : H1 is a data frame. (data in the attached file.)
# the first lines are:
1 02/01/2008 0.00 0 0 0.00 0
2 03/01/2008 0.00 0 0 0.00 0
3 04/01/2008 0.00 0 0 0.00 0
Hello,
The "apply" function seems to behave oddly with my code below
NB : H1 is a data frame. (data in the attached file.)
# the first lines are:
1 02/01/2008 0.00 0 0 0.00 0
2 03/01/2008 0.00 0 0 0.00 0
3 04/01/2008 0.00 0 0 0.00 0
4 07/01/2008 0.00 0
Marc Schwartz wrote:
The cut() function will do what you want in a vectorized fashion. See ?cut
However, that being said, I would strongly advise that you read Frank's
page on the categorizing of continuous variables:
http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/CatContinuous
befo
The cut() function will do what you want in a vectorized fashion. See ?
cut
However, that being said, I would strongly advise that you read
Frank's page on the categorizing of continuous variables:
http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/CatContinuous
before you proceed.
HTH
Hi Alan,
You can avoid the if() else() you're using in your function by replacing it
with the recode() function in the car package. I'm pretty sure it will speed
up your function.
See ?recode after loading the car package:
require(car)
?recode
HTH,
Jorge
On Wed, Apr 22, 2009 at 2:56 PM, Alan
I'm not sure, but I think that using the "cut" function would solve your
problem?
?cut
On Wed, 22 Apr 2009 14:56:10 -0400, "Alan Cohen"
wrote:
> Hi R users,
>
> I am trying to assign ages to age classes for a large data set (123,000
> records), and using a for-loop was too slow, so I wrote a fu
Hi R users,
I am trying to assign ages to age classes for a large data set (123,000
records), and using a for-loop was too slow, so I wrote a function and used
apply. However, the function does not properly assign the first two classes
(the rest are fine). It appears that when age is one digi
on 01/20/2009 05:26 PM Czerminski, Ryszard wrote:
> Passing extra arguments to FUN=mean or median in apply
> seems fine, but when FUN=min warnings are generated?
> See below.
>
> Any ideas why?
>
> Best regards,
> Ryszard
>
> Ryszard Czerminski
> AstraZeneca Pharmaceuticals LP
>
>> m
> [,
On 21/01/2009, at 12:26 PM, Czerminski, Ryszard wrote:
Passing extra arguments to FUN=mean or median in apply
seems fine, but when FUN=min warnings are generated?
See below.
Any ideas why?
Best regards,
Ryszard
Ryszard Czerminski
AstraZeneca Pharmaceuticals LP
m
[,1] [,2]
[1,]1
Passing extra arguments to FUN=mean or median in apply
seems fine, but when FUN=min warnings are generated?
See below.
Any ideas why?
Best regards,
Ryszard
Ryszard Czerminski
AstraZeneca Pharmaceuticals LP
> m
[,1] [,2]
[1,]12
[2,]3 NA
[3,] NA NA
> apply(m, 1, median, na
16 matches
Mail list logo