HI Arun and all
>my function is:
>aj.fun <- function(j, i, X, z, E, beta0, beta1){
+ n <- length(X)
+ iX <- order(X)
+ iz <- order(z)
+ e1 <- -(beta)*z[ iz[1:(i - 1)] ]
+ numer <- E[j] - sum( X[ iX[1:(i - 1)] ] * exp(e1) )
+ e2 <- -(beta)*z[ iz[i:n] ]
+ denom <- sum( exp(e2) )
+ numer/denom
+ }
>
Please do keep your replies on the R help list.
On Tue, Aug 7, 2012 at 4:17 PM, hafida goual wrote:
>
> HI
>>
>>I know my questions are debile, but please I'm debutante.
>
>>> source("functionaj")
> Error in file(filename, "r", encoding = encoding) :
> cannot open the connection
> In addition:
HI,
Suppose, I have a function like this:
fun1<-function(x){
ifelse(x[1]<0,
sum(x[min(which(x<0)):(which.max(x>0)-1)]),
sum(x[min(which(x<0)):max(which(x<0))])
)
}
#And I save it as "aj.fun" (-- filename)
#Then,
>source("aj.fun")
> fun1
function(x){
ifelse(x[1]<0,
sum(x[min(which(x<0)):(whic
On Tue, Aug 7, 2012 at 11:26 AM, hafida wrote:
> Hi
>
>>i have aproblem withe execution of my function
>
>>first, i wrote my function in the script of R
>>nom_fonction <- function(arg1[=expr1], arg2[=expr2], ...){
> bloc d'instructions
> }
>
>> when i want to have the result i mean the laste inst
4 matches
Mail list logo