similar to: Help to make a simple function

Displaying 20 results from an estimated 1000 matches similar to: "Help to make a simple function"

2003 Apr 26
0
Help to make a program
Hi all, I try to make a program for comparison between matrix cells. Here um simple example: 3 |a b a 2 |b b b 1 |a b a ------- 1 2 3 This is tabulated like this: x y sp 1 1 a 1 2 b 1 3 a 2 1 b 2 2 b 2 3 b 3 1 a 3 2 b 3 3 a Then, I need to make the follow calcule: ============================================== Change in sp levels from 1x1 area to 2x2 area:
2003 May 05
3
Help to make a for for index
Hi, I try to make a vector in a for for loop, but it dont work. Look: > a <- 0;for(i in c(1:2)) { for(j in c(1:2)) { a <- i+j; print(a)}} [1] 2 [1] 3 [1] 3 [1] 4 I try to make this a vector, like this: [1] 2 3 3 4 > a <- 0;for(i in c(1:2)) { for(j in c(1:2)) { a[j] <- i+j}}; print(a) [1] 3 4 > a <- 0;for(i in c(1:2)) { for(j in c(1:2)) { a[i] <- i+j}}; print(a) [1]
2003 Apr 28
1
[OFF] File name completation on XEmacs+ESS.
Hi, I try to make a key alias to XEmacs+ESS function Complete File Name. But I dont know the name of this funcion. Anybody know how this funcion is call? (global-set-key "\C-tab" 'name of the function Complete File Name) Thanks for all Inte Ronaldo -- To beer or not to beer. -- ShakesBeer -- | // | \\ [*****************************][*******************] ||
2003 Apr 30
1
How to calculate the x to assymptotic value and curve inflection .
Hi, I have this non-linear function: y=115.251 - 118.69 * exp(-0.123517*x) I try to discovery the x value for the assyntoptic value of y and the x value where the behavior of curve change, the inflection point. How to make this? Is poss?ble to make this on R? Thanks Ronaldo -- O Flamengo e o Bangu terminaram o jogo em 0 x 0. Quem fez o gol? A Volkswagen -- | // | \\
2003 May 01
0
How to calculate the x to assymptotic value and curve
Ronaldo Your mathematical question is of interest to me too. But I am particularly interested in a translation into American English of the pun attached to you email. Could you try to explain O Flamengo e o Bangu terminaram o jogo em 0 x 0. Quem fez o gol? A Volkswagen My rough translation into English is: Two soccer teams ended play 0 to 0. Who got the goal? A Volkswagen. I need all the
2003 Apr 22
0
Correct SE in a poisson model.
Hi all, I'm here again with my newbies questions :( I have a simple example: count of slugs in two fields. I need to make a barplot with mean and SE of mean. So I have: The mean: > tapply(slugs,field,mean) Nursery Rookery 1.275 2.275 The SE: > tapply(slugs,field,sd)/sqrt(tapply(slugs,field,length)) Nursery Rookery 0.3651264 0.3508004 If the data has been normally
2003 Feb 21
2
Help on a simple function.
Hi, I try to make a function that have two others functions inside. It is simple, but the problem is that functions inside use the same variable, but with different values. I try something like this: Teste <- function(Pdig(nlinhas),Ldig(nlinhas)) { Pdig <- function(nlinhas) { Tdig <- (15.50 + 7.45*nlinhas); (3*(Tdig*(30/3600))+1*(30*(30/3600))); } Ldig <- function(nlinhas) { Tdig
2003 Mar 05
1
Dataframe in loop
Hi, I try to make a dataframe in a loop function, but I dont have succeed. The function is something like this: for(i in c(10,12)) { expr for(j in c(1:2) { total <- c(1,2,3,4,5,6,7) nspf <- length(levels(as.factor(total))) fin <- data.frame(L=i,N=nspf) print(fin) } } This print something like this: L N 1 10 7 L N 1 10 7 L N 1 12
2003 Mar 25
0
Howto calculate MS from a unbalanced data
Hi, I make a nested lme analysis, it is ok. The estructure is: lme(y~x,random=~1|x/animal) It is no the exactly formula, but the teoretical formula. The real formula have a new variable with x/animal group. Now I try to construct a nested lme table like the traditional anova table to presentation of the data. --------------------------------------------- | Source | SS | d.f. | MS | F
2003 Apr 01
1
[OFF]- Xemacs, delete key and ESS
Hi, I use R with XEmacs and ESS, when I'm editing a R file in XEmacs, the delete key work like the Backspace key. This behaviour is only in XEmacs + ESS + R file, it dont have this behaviour on a R section (M+R). Anybody know how to make a delete key to work like the delete key?? ESS 5.1.20-2 XEmacs 21.4.6-8 Thanks for all -- You will always have good luck in your personal affairs. --
2003 Apr 21
0
Difficult to compare models
Hi, I have the follow situation in a ancova analysis: y (count data) x1 (continuous data) x2 (qualitative data) x2 have 10 levels (a,b,c,d,e,f,g,h,i,j) I make the model m1 <- glm(y~x1*x2, family=poisson) then I want to remove the levels h, i and j (make these levels with intercept = 0 and slope = 0) A make a new datafile without these levels. This new table is smallest than the
2003 Apr 29
0
Testing for scale e mu in survreg
Hi, Normally I make survival analysis using survreg in survival package. It is simple to compare curves for different levels. But in this case all curves have the same estimated scale parameter. In some cases, curves are graphically different in your behaviour. One curve is like type I curve (1/scale > 1). Other curve is like type III curve (1/scale < 1). All graphics made normal and
2003 May 06
0
Concatenate dataframe
Hi, thanks for help on index in a for for looping. its work. Now I have another doubt. I have a data.frame like this: nsps area 1 1 4 2 0 9 3 1 4 4 1 4 5 1 4 6 1 9 7 0 4 8 1 9 9 0 4 10 1 9 ... I try to make another data.frame like this: nsps area 1 4 4 2 3 9 using tapply, it work: >
2003 Apr 17
0
Howto calculate R^2 from an anconva glm
Hi, If I have the follow example: y = count data x1 = continuous data x2 = qualitative data (2 factors levels) I make a model glm(y~x1,family=poisson) The model has only one curve, to calculate r-square, I do "x1 Deviance"/"total Deviance" But in a model with x2 glm(y~x1+x2,family=poisson) I have two curves, but I dont have, using summary() or anova(), the deviance
2003 Mar 06
1
Problems with variable types.
Hi all, I have problems in a dataframe variables types. Look: from a loop function: for(...){ ... dados.fin <- rbind(dados.fin, c(L=j, A=j^2, Nsp=nsps, N=length(amosfin$SP), AmT="am",NAm=nam, AMST=amst)) dados.fin <- rbind(dados.fin, c(L=j, A=j^2,
2003 Mar 21
2
Trying to make a nested lme analysis
Hi, I''m trying to understand the lme output and procedure. I''m using the Crawley''s book. I''m try to analyse the rats example take from Sokal and Rohlf (1995). I make a nested analysis using aov following the book. > summary(rats) Glycogen Treatment Rat Liver Min. :125.0 Min. :1 Min. :1.0 Min. :1 1st Qu.:135.8
2002 Jun 21
3
generating points over a function, its possible???
Hi, I have a new (for me) situation. I have a function for one linear model: y = 9.7909-0.035*x I have the variance of system var = 13.01403 Is possible to create a random vector points of Y (simulating the real data) over this curve using the function and the variance? I need this to a discipline. I have this: | \ | \ -> y = 9.7909-0.035*x and var = 13.014 | \ | \ | \ | \
2002 Oct 10
1
CRAN mirror
Hi how I must make to officialize my mirror in the main R website? My CRAN's mirror is sited in Federal University of Vi?osa in Minas Gerais State - Brazil. The address is: http://www.termix.ufv.br/CRAN It is diary updated Bie Ronaldo -- Q: How does a hacker fix a function which doesn't work for all of the elements in its domain? A: He changes the domain. -- | //|\\
2002 May 02
2
plot survival points
Hi all, I have a little problem. I make an weibull survival analysis using the survival package. It,s OK, them I have the functions. I plot this funcions with curve(). I want to make a plot with the real survival points (proportion of alive x time) and them add the curves to points. I have the time to dead, the censor data and my trataments. To analysis the model is: model1 <-
2002 Aug 02
0
New R mirror in Brazil
Hi, I make a CRAN mirror in Brazil at Federal University of Vi?osa. The address is: http://termix.ufv.br/CRAN Every problem please send report for me. Thanks Ronaldo -- Hug me now, you mad, impetuous fool!! Oh wait... I'm a computer, and you're a person. It would never work out. Never mind. -- | //|\\ [*****************************][*******************] || ( ? ? ) [Ronaldo