Hi Alexander,
I suspect that when you write "try" you mean that you try to run the
function with some value for "pid". The "unexpected symbol" error message
usually includes the offending symbol and that will probably identify the
problem.
Jim
On Mon, Oct 26, 2015 at 1:20 PM, wrote:
> Hello,
>
On 25/10/2015 10:20 PM, alexander.thoma...@louisville.edu wrote:
> Hello,
>
> I'm following an example in the book, analyzing baseball data with R, but
> it's not working for me. The example is:
We don't know what "the book" is. If this is the textbook for your
class, you should ask your instru
Hello,
I'm following an example in the book, analyzing baseball data with R, but it's
not working for me. The example is:
compute.hr <- function(pid){d <- subset(Batting.60, playerID==pid)
sum(d$HR)}
Every time I try this, it says there's an unexpected symbol. Any idea on what
the unexpected s
Pete: Please don't do people's homework for them!
At most, give them a ***hint*** only.
cheers,
Rolf Turner
On 02/19/2013 12:01 PM, Pete Brecknock wrote:
simonj16 wrote
Consider an urn that contains 10 tickets, labelled: 1,1,1,1,2,5,5,10,10,10
I want to draw with replacement n=
>
> Follow up question:
>
> Use urn.model to generate a sample y={y1,...,y25) of n=25 observed sums.
Any good?
ticket.ns<-c(1,1,1,1,2,5,5,10,10,10)
draw=NULL
for (i in 1:25){
draw[i] <- sum(sample(ticket.ns,40,replace=TRUE))
}
print(draw)
HTH
Pete
--
View this message
Hi there Petr,
Apologies for only replying to your post now - I hope the code included
below helps you out.
An alternative function documentation approach would be the one I took when
faced with a
similar problem - I wrote some functions to allow me to embed a retrievable
function specification
i
Hi
r-help-boun...@r-project.org napsal dne 17.09.2010 17:02:29:
> On 9/16/10 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,
>
>
On 9/17/10 12:46 PM, Jeff Newmiller wrote:
If having the definition of the function appear when you enter the name of the function
elicits a "hate" response, then perhaps you should not be using R. That
characteristic of R is fundamental and unlikely to change: in R everything is an object,
a
If having the definition of the function appear when you enter the name of the
function elicits a "hate" response, then perhaps you should not be using R.
That characteristic of R is fundamental and unlikely to change: in R everything
is an object, and the result of evaluating an expression is d
On 9/16/10 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 u
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 u
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
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 for
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 for me how to do that?
The help text is separate from t
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 for me how to do that?
Thanks,
D.
__
R-help@r-pr
cls59 wrote:
>
>
>
> jimdare wrote:
>>
>> Hi there,
>>
>> I have created the function below:
>>
>> pirate<-function(x){
>> a<-x-1; b<-a/5; c<-a-b;
>> d<-c-1; e<-d/5; f<-d-e;
>> g<-f-1; h<-g/5; i<-g-h;
>> j<-i-1; k<-j/5; l<-j-k;
>> m<-l-1; n<-m/5; o<-m-n;
>> final<-o/5;
>>
>> final
>> }
>>
jimdare wrote:
>
> Hi there,
>
> I have created the function below:
>
> pirate<-function(x){
> a<-x-1; b<-a/5; c<-a-b;
> d<-c-1; e<-d/5; f<-d-e;
> g<-f-1; h<-g/5; i<-g-h;
> j<-i-1; k<-j/5; l<-j-k;
> m<-l-1; n<-m/5; o<-m-n;
> final<-o/5;
>
> final
> }
>
> I want to run this function until th
Hi there,
I have created the function below:
pirate<-function(x){
a<-x-1; b<-a/5; c<-a-b;
d<-c-1; e<-d/5; f<-d-e;
g<-f-1; h<-g/5; i<-g-h;
j<-i-1; k<-j/5; l<-j-k;
m<-l-1; n<-m/5; o<-m-n;
final<-o/5;
final
}
I want to run this function until the output ('final') is an exact integer
(e.g. 893.000
Dear Alex,
Just a _minor_ change in the function "powers":
# powers
# n is the number of samples
# DATA is the ORIGINAL data set
powers=function(n,m2,n2,s2,DATA){
outp=Sample(DATA,n) # DATA was 'name' before, which doesn't make
sense
mymeans=outp$Gmean
mysds=outp$Gsd
res=t(rbind(mymeans,m
Dear Alex,
Try this:
# Data
name=read.table(textConnection("
X8 X9 X10 X102 X110 X177 X283 X284 X286 X292 X297 X306 X308 X314
0 1 000100000000
0 0 001000000010
0 1 0000000
take a look at ?mapply(); for instance, you can use something like this
(untested):
dat <- Sample(...)
mapply(Power, dat$Gmean, dat$Gsd, MoreArgs = list(alfa = 0.05, m1 = 57,
s1 = 33, n1 = 200, n2 = 100))
I hope it helps.
Best,
Dimitris
Alex99 wrote:
Hi everyone,
I have dataset which I ma
Hi everyone,
I have dataset which I make a sample of it couple of times and each time I
get the mean and standard deviation of each row for each sample. I have a
function for that, which takes the name of the file and number of times to
sample and then returns the mean and standard deviation for e
22 matches
Mail list logo