Florent D. | 1 Dec 01:51 2011
Picon

Re: how to call a function for each row

if you want to store the result in a column of your data.frame:

within(df, Y <- 6*X1+7*X2+8*X3)

On Wed, Nov 30, 2011 at 9:59 AM, David L Carlson <dcarlson <at> tamu.edu> wrote:
> Isn't this even easier?
>
>> X1 <- c(1:3)
>> X2 <- c(3, 4, 6)
>> X3 <- c(5, 6, 1)
>> Y <- 6*X1 + 7*X2 + 8*X3
>> Y
> [1] 67 88 68
>
> Or if you really need a function:
>
>> MakeY <- function(x, y, z) 6*x + 7*y + 8*z
>> MakeY(X1, X2, X3)
> [1] 67 88 68
>
>
> ----------------------------------------------
> David L Carlson
> Associate Professor of Anthropology
> Texas A&M University
> College Station, TX 77843-4352
>
>
>
> -----Original Message-----
(Continue reading)

Dustin Fife | 1 Dec 03:50 2011
Picon

FIML with missing data in sem package

Is there a way to use full information maximum likelihood (FIML) to
estimate missing data in the sem package? For example, suppose I have a
dataset with complete information on X1-X3, but missing data (MAR) on X4.
Is there a way to use FIML in this case? I know lavaan and openmx allow you
to do it, but I couldn't find anything in the documentation for the sem
package. Thanks!

--

-- 
Dustin Fife
Graduate Student
Quantitative Psychology
University of Oklahoma

	[[alternative HTML version deleted]]

Axel Urbiz | 1 Dec 04:48 2011
Picon

Random Forests in R

I understand the original implementation of Random Forest was done in
Fortran code. In the source files of the R implementation there is a note
"C wrapper for random forests:  get input from R and drive  the Fortran
routines.". I'm far from an expert on this...does that mean that the
implementation in R is through calls to C functions only (not Fortran)?

So, would knowing C be enough to understand this code, or Fortran is also
necessary?

Thanks for your help

Axel.

	[[alternative HTML version deleted]]

Ben Madin | 1 Dec 04:56 2011
Picon

R logo in eps formt

G'day all,

Sorry if this message has been posted before, but searching for R is always difficult...

I was hoping for a copy of the logo in eps format? Can I do this from R, or is one available for download?

cheers

Ben
Matt Cooper | 1 Dec 04:56 2011
Picon

R endnote entry

I know citation() gives the R citation to be used in publications. Has
anyone put this into endnote nicely? I'm not very experienced with
endnote, and the way I have it at the momeny the 'R Development Core
Team' becomes R. D. C. T. etc.

Cheers.

Luke Miller | 1 Dec 05:12 2011
Picon

Re: R endnote entry

I have R entered as a "computer program", and in the Programmer Name field
I write it as:

R Development Core Team,

Notice the comma after Team. That seems to be the key to getting Endnote to
treat the whole thing as a surname that doesn't get abbreviated.

On Wed, Nov 30, 2011 at 10:56 PM, Matt Cooper <mattcstats <at> gmail.com> wrote:

> I know citation() gives the R citation to be used in publications. Has
> anyone put this into endnote nicely? I'm not very experienced with
> endnote, and the way I have it at the momeny the 'R Development Core
> Team' becomes R. D. C. T. etc.
>
> Cheers.
>
> ______________________________________________
> R-help <at> r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

--

-- 
___________________________
Luke Miller
Postdoctoral Researcher
Marine Science Center
(Continue reading)

Peter Langfelder | 1 Dec 06:32 2011
Picon

Re: Random Forests in R

On Wed, Nov 30, 2011 at 7:48 PM, Axel Urbiz <axel.urbiz <at> gmail.com> wrote:
> I understand the original implementation of Random Forest was done in
> Fortran code. In the source files of the R implementation there is a note
> "C wrapper for random forests:  get input from R and drive  the Fortran
> routines.". I'm far from an expert on this...does that mean that the
> implementation in R is through calls to C functions only (not Fortran)?
>
> So, would knowing C be enough to understand this code, or Fortran is also
> necessary?

I haven't seen the C and Fortran code for Random Forest but I
understand the note to say that R code calls some C functions that
pre-process (possibly re-format etc) the data, then call the actual
Random Forest method that's written in Fortran, then possibly
post-process the output and return it to R. It would imply that to
understand the actual Random Forest code, you will have to read the
Fortran source code.

Best,

Peter

nsaraf | 1 Dec 01:48 2011
Picon

R code

Hi everybody,

I am unable to resolve this error using the following for loop. Would
appreciate help. The same loop works with for(i in 1:92) strangely. I
checked the .raw input file and everything is kosher, even Line 547
mentioned in the error message.

I wonder if there is any problem with the paste function.

Thanks very much in advance.

**********************
for(i in 1:93)
{
inputdta<- read.table(file=gsub(" ","",paste("JSR_network_[",i,"].RAW"),
fixed=TRUE), header=TRUE)
colnames(inputdta) <- c("jsrid","firmid","jsrstart","injsr")
print(nrow(inputdta))
}

***************
Message: Error in scan(file, what, nmax, sep, dec, quote, skip, nlines,
na.strings, : line 547 did not have 4 elements

--
View this message in context: http://r.789695.n4.nabble.com/R-code-tp4125904p4125904.html
Sent from the R help mailing list archive at Nabble.com.
	[[alternative HTML version deleted]]

(Continue reading)

T.D. Rudolph | 1 Dec 04:22 2011
Picon

Re: Average of Two Matrices


What if you have over 50 matrices and you don't want to write them all out
one-by-one?  I know there's something really quite simple, but I haven't
found it yet!...

--
View this message in context: http://r.789695.n4.nabble.com/Average-of-Two-Matrices-tp860672p4126615.html
Sent from the R help mailing list archive at Nabble.com.

chenandfuok | 1 Dec 06:37 2011
Picon

error in ZIGP package and optim

Dear all: I am trying to use the response.zigp and est.zigp from the ZIGP
package. Firstly, I generated a simple data via response.zigp and then I try
to fit them by est.zigp function, this is the code:
---------------------------------
> library(ZIGP)
> #try-ZIGP-1
> n<-100
> X<-matrix(c(rep(1,n),runif(n*2,0,1)),n,3)
> W<-matrix(c(rep(1,n),rbinom(n,1,0.5)),n,2)
> Z<-matrix(c(rep(1,n),rbinom(n,1,0.5)),n,2)
> beta<-c(1,-2,1)
> alpha<-c(1,1.5)
> gamma<-c(-1,2)
> y<-response.zigp(X,W,Z,beta,alpha,gamma)
> x1<-as.vector(X[,1])
> x2<-as.vector(X[,2])
> x3<-as.vector(X[,3])
> w1<-as.vector(W[,1])
> w2<-as.vector(W[,2])
> z1<-as.vector(Z[,1])
> z2<-as.vector(Z[,2])
> fm.X<-~x1+x2+x3
> fm.W<-~1
> fm.Z<-~z1+z2
> est.zigp(y,fm.X,fm.W,fm.Z,Offset=rep(1,length(y)),init=FALSE)
-----------------------------
Then I get the *error:*
----------------------------
Error in optim(par = start.delta, fn = loglikelihood.zigp, gr = gradient,  : 
  initial value in 'vmmin' is not finite
(Continue reading)


Gmane