[R] From Java to R OOP

2013-03-25 Thread Francisco J. Bido
Hi, I'm new to OOP in R so please forgive the naiveness of some of the questions. Here are a couple of them. It would be great if you can contrast to OOP in Java. 1. R's S4 appears to centered around a dispatch mechanism which in my understanding is just a way to implement polymorphism. Now,

[R] Columns perfectly aligned with the column names

2013-03-25 Thread Stefano Sofia
Dear R users, I need to export a data frame, and I would like to have all the columns perfectly aligned with the column names. At the time being, the output is not satisfactory. Here below there is a real example, with the R commands that I am using. Is it possible? How can I do? place MDI

Re: [R] From Java to R OOP

2013-03-25 Thread R. Michael Weylandt
On Mon, Mar 25, 2013 at 6:51 AM, Francisco J. Bido b...@mac.com wrote: Hi, I'm new to OOP in R so please forgive the naiveness of some of the questions. Here are a couple of them. It would be great if you can contrast to OOP in Java. Java is not the end-all of OOP (in fact S is a good bit

[R] Automatic script for updating packages in R

2013-03-25 Thread Twaha Mlwilo
Hello all,Good day,Internet access have been a problem , and learning R forced to download packages manual.I have google for script for automatic R update didnt getPlease any one with help?am using ubuntu 12.04R-2.5.3Thank you

Re: [R] Columns perfectly aligned with the column names

2013-03-25 Thread PIKAL Petr
Hi Your code is not reproducible but it probably does not matter. You use tab as separator which means the file is readable directly by spreadsheet programmes (Excel). Reading them as text shall be OK unless some values are not so long that they exceed predefined tabs or unless they have some

Re: [R] Automatic script for updating packages in R

2013-03-25 Thread PIKAL Petr
Hi Strange, I thought that only Windows users are sending Html mail and providing sparse info describing their problems. I presume, you use 2.15.3 R version. There is some readme in Ubuntu CRAN repository and if you followed that and fail it would be necessary to provide at least what you

[R] How to use RWeka with Multilayer Perceptron?

2013-03-25 Thread Rui Esteves
Hello, I have a serialized Multilayer Perceptron trained using weka. I would like to use R to re-evaluate the model. How can I do this? I could not find an example of RWeca that applies to Multilayer Perceptron. Thanks, Rui __ R-help@r-project.org

[R] plot Raster

2013-03-25 Thread Alaios
Dear all, I am trying to plot an image so I am trying this through raster layer. You can copy paste the following require('raster') Data-matrix(data=rnorm(900,80,20),nrow=30,ncol=30) rasterData-raster(Data) lengthOut-5 xAxisFrequencies-seq(800,900,length.out=lengthOut) plot(rasterData,

[R] How to copy current line in Tinn-R

2013-03-25 Thread Fabio Berzaghi
Hello All, A very simple question about Tinn-R. I am able to use the send line shortcut, but I want to be able to just copy the current line to the clipboard and then paste in the current document or somewhere else. It's so tedious to select the whole line and then copy it. Thanks

[R] Weighted Kaplan-Meier estimates with R (with confidence intervals)?

2013-03-25 Thread rm
As part of a research paper, I would like to draw both weighted and unweighted Kaplan-Meier estimates, the weight being the ’importance’ of the each project to the mass of projects whose survival I’m trying to estimate. I know that the function survfit in the package survival accepts weights and

[R] cursor after txtProgressBar

2013-03-25 Thread Jinsong Zhao
Hi there, I am using R 2.15.2 under Win7 64. I hope to display progress bar when I am running a loop. After the loop exit, the cursor is at the right margin of the window. How can I make it to the left margin? Here is the minimal example code. combn.bar - function(n, m) { n - choose(n,

Re: [R] Need help to plot clara results [clustering]

2013-03-25 Thread Martin Maechler
capricy gao capri...@yahoo.com on Thu, 21 Mar 2013 06:07:12 -0700 writes: I am going to use clara for� gene expression analysis, so tried to play around with the examples from R document: http://127.0.0.1:10699/library/cluster/html/clara.html Everything looked fine

[R] %*% what does this mean

2013-03-25 Thread Shane Carey
Hi I was working with a script and I came across this %*%. What does this mean? Thanks -- Shane [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] %*% what does this mean

2013-03-25 Thread Blaser Nello
Matrix Multiplication ?%*% -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Shane Carey Sent: Montag, 25. März 2013 13:31 To: r-help@r-project.org Subject: [R] %*% what does this mean Hi I was working with a script and I came

Re: [R] %*% what does this mean

2013-03-25 Thread Duncan Murdoch
On 13-03-25 8:31 AM, Shane Carey wrote: Hi I was working with a script and I came across this %*%. What does this mean? Thanks help(%*%) will tell you. Duncan Murdoch __ R-help@r-project.org mailing list

Re: [R] Weighted Kaplan-Meier estimates with R (with confidenceintervals)?

2013-03-25 Thread Blaser Nello
The two confidence intervals should be different. In the first model you have 3 failures and the second one you have 300. More failures results in narrower confidence intervals. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of

Re: [R] Automatic script for updating packages in R

2013-03-25 Thread Gergely Daróczi
Hi, you might also want to check out some nice helpers of the opencpu and opencpu.tools packages made by Jeroen Ooms: https://raw.github.com/jeroenooms/opencpu.tools/master/R/install.all.packages.R Best, Gergely On 25 March 2013 11:21, Twaha Mlwilo uddessy2...@hotmail.com wrote: Hello

Re: [R] Help on dendrogram reorder

2013-03-25 Thread Adams, Jean
On Fri, Mar 22, 2013 at 1:48 PM, capricy gao capri...@yahoo.com wrote: as.dendrogram ?reorder.dendrogram Jean [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] Automatic script for updating packages in R

2013-03-25 Thread Robert Baer
try, update.packages(ask='graphics', checkBuilt=TRUE) ?update.packages ?download.file ?url # file:// URLs On 3/25/2013 6:09 AM, PIKAL Petr wrote: Hi Strange, I thought that only Windows users are sending Html mail and providing sparse info describing their problems. I presume, you use

Re: [R] Double condition

2013-03-25 Thread zuzana zajkova
Hi, To Mason: I like your idea with reshaping the dataframe. I've read the paper and checked the help for the cast function, but I wasn't able to reshape it to wanted form, which as you mentioned would be (column names): jul timedtime ddawn.noon ddawn.midnight ddusk.noon ddusk.midnight

Re: [R] Weighted Kaplan-Meier estimates with R (with confidenceintervals)?

2013-03-25 Thread rm
Say, that I have two observations, one from time 0 to time 50, and a second from time 0 to time 100, both of which are known to have failed, i.e. no censoring. I would like to give double the weight to the second observation. This is what I’ve tried to implement in the both pieces of code. Both

[R] Double condition

2013-03-25 Thread zuzana zajkova
Hi Rui, thank you for your code, but unfortunately it doesn't work correctly. What I got is this: subz jultimedtime fixddawnddusk day 101608 15006 2011-02-01 19:14:49 19.24694 noon 7.916667 19.88333 1 101609 15006 2011-02-01 19:24:49 19.41361

Re: [R] Double condition

2013-03-25 Thread Rui Barradas
Hello, I believe the following solves your problem. It's a bit more complicated but with the sample dataset you've provided the result is as wished. tmp - lapply(split(subz, subz$time), function(x) { i1 - which(as.character(x$fix) == noon)[1] i2 - which(as.character(x$fix)

Re: [R] Weighted Kaplan-Meier estimates with R (with confidenceintervals)?

2013-03-25 Thread Milan Bouchet-Valat
Le lundi 25 mars 2013 à 05:55 -0700, rm a écrit : Say, that I have two observations, one from time 0 to time 50, and a second from time 0 to time 100, both of which are known to have failed, i.e. no censoring. I would like to give double the weight to the second observation. This is what

[R] Obtaining the internal integer codes of a factor XXXX

2013-03-25 Thread Dan Abner
Hi everyone, I understand the process of obtaining the internal integer codes for the raw values of a factor (using as.numeric() as below), but what is the best way to obtain these codes for the levels() of a factor (since the as.numeric() results don't really make clear which code maps to which

[R] count NAs with aggregate

2013-03-25 Thread Timo Stolz
Dear members of this list, I'd like to count missing values using the aggregate function. Something like this: count_nas - function(arg1) { return(sum(is.na(arg1))) } aggregate(cbind(var1, var2, var3) ~ subject + time, data = mydataset, count_nas) It's not working: I end up with a

Re: [R] Obtaining the internal integer codes of a factor XXXX

2013-03-25 Thread Bert Gunter
Why do you think you need to do this? (Feel free to ignore, however). -- Bert On Mon, Mar 25, 2013 at 8:37 AM, Dan Abner dan.abne...@gmail.com wrote: Hi everyone, I understand the process of obtaining the internal integer codes for the raw values of a factor (using as.numeric() as below),

Re: [R] Double condition

2013-03-25 Thread zuzana zajkova
Hi, although it takes some 10 minutes to do the calculation (the original dataframe has more than 100 000 rows..), it seems to work ok. Thanks for your time and help, Zuzana On 25 March 2013 15:37, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, I believe the following solves your problem.

Re: [R] Read text file in R

2013-03-25 Thread arun
Hi, Try this: con-file(Routallnew.txt)  Lines1- readLines(con)  close(con) indx-rep(rep(c(TRUE,FALSE),each=2),24) Lines2-Lines1[!grepl([A-Za-z],Lines1)] res-read.table(text=paste(gsub(^\\s+,,Lines2[indx]),gsub(^\\s+,,Lines2[!indx])),sep=,header=FALSE) nm1-unlist(strsplit(gsub(^

[R] error installing RcppClassic

2013-03-25 Thread C Lin
Anyone knows what does this error means? library(RcppClassic) Error in gzfile(file, rb) : cannot open the connection I thought I installed the package successfully: install.packages('RcppClassic') Installing package(s) into ‘C:/Program Files/R/library’ (as ‘lib’ is unspecified) also

Re: [R] Obtaining the internal integer codes of a factor XXXX

2013-03-25 Thread Duncan Murdoch
On 25/03/2013 11:37 AM, Dan Abner wrote: Hi everyone, I understand the process of obtaining the internal integer codes for the raw values of a factor (using as.numeric() as below), but what is the best way to obtain these codes for the levels() of a factor (since the as.numeric() results don't

Re: [R] count NAs with aggregate

2013-03-25 Thread Rui Barradas
Hello, The problem seems to be with the formula interface. # Make up some data var1 - rnorm(100) var2 - rnorm(100) var3 - rnorm(100) subject - sample(4, 100, replace = TRUE) time - sample(10, 100, replace = TRUE) var1[sample(100, 10)] - NA var2[sample(100, 10)] - NA var3[sample(100, 10)] - NA

Re: [R] Obtaining the internal integer codes of a factor XXXX

2013-03-25 Thread Rui Barradas
Hello, Though I have the same doubt as Bert, the following seems to make more sense. seq_along(levels(fdata)) Hope this helps, Rui Barradas Em 25-03-2013 15:37, Dan Abner escreveu: Hi everyone, I understand the process of obtaining the internal integer codes for the raw values of a

Re: [R] Obtaining the internal integer codes of a factor XXXX

2013-03-25 Thread William Dunlap
I would like to add that using the labels argument without a levels argument in factor(), fdata-factor(c(b,b,c,a,b,c),labels=c(I,II,III)) is a dangerous way to make your factor. Consider what would happen if the 4th input value were not a but was d or if you were in a locale where the sort

Re: [R] Read text file in R

2013-03-25 Thread arun
res[res$EN==min(res$EN),] #   m1 n1  m  n cterm1_P0L cterm1_P0H  c11  c12   c1   c2 alpha beta   T_error #25  9  4 13 12  0.6302494  0.7565041 0.03 0.07 0.15 0.15   0.1  0.2 0.4403712 #27  9  4 13 12  0.6302494  0.7565041 0.03 0.07 0.15 0.20   0.1  0.2 0.4473437 #33  9  4 13 12  0.6302494 

[R] Plot Matrix with Data

2013-03-25 Thread Alaios
Hi , I would like to use ggplot2 to plot a matrix as an image. You can copy paste the following Data-matrix(data=rnorm(900,80,20),nrow=30,ncol=30) lengthOut-5 Lengths- 15 library(reshape2) library(ggplot2) tdm - melt(Data) ggplot(tdm, aes(x = Var2, y = Var1, fill =

[R] nested 'while' loops

2013-03-25 Thread Sahana Srinivasan
Hi everyone, I'm using the following code to go over every element of a data frame (row wise). The problem I am facing is that the outer 'x' variable is not incrementing itself, thus, only one row of values is obtained, and the program does not proceed to the next row. This is the code:

Re: [R] nested 'while' loops

2013-03-25 Thread Sahana Srinivasan
Hi, sorry that got sent without the output : Please ignore the aligning in the input, I am re-adding that here as well : 1GENEACDEFGHIKLMNPQRSTVWY2amt:Amet_00012902334171612422939635201325342732312 3amt:Amet_000219315421218835254372613914212030084 Output:

Re: [R] nested 'while' loops

2013-03-25 Thread Berend Hasselman
On 25-03-2013, at 18:43, Sahana Srinivasan sahanasrinivasan...@gmail.com wrote: Hi everyone, I'm using the following code to go over every element of a data frame (row wise). The problem I am facing is that the outer 'x' variable is not incrementing itself, thus, only one row of values is

Re: [R] nested 'while' loops

2013-03-25 Thread Sahana Srinivasan
while(x=21) { while(y=rown) { n-as.numeric(df[[y]][x]); if(n0) { while(k=lim) { k-k+1; } # while loop for k closes opdf[[y]][x]-sum; } # if statement closes y-y+1; } #while for y closes x-x+1; } #while with x

Re: [R] nested 'while' loops

2013-03-25 Thread Patrick Burns
Your immediate problem is that 'y' is not reset to 1. Easier code to write would be to use 'for' loops rather than 'while' loops. Better still would be to use neither if possible. I suspect that you are in Circle 3 of 'The R Inferno'. http://www.burns-stat.com/documents/books/the-r-inferno/

Re: [R] error installing RcppClassic

2013-03-25 Thread David Winsemius
On Mar 25, 2013, at 9:09 AM, C Lin wrote: Anyone knows what does this error means? library(RcppClassic) Error in gzfile(file, rb) : cannot open the connection I thought I installed the package successfully: install.packages('RcppClassic') Installing package(s) into ŒC:/Program

[R] gamma regression zeros

2013-03-25 Thread Sören Prehn
Dear all, I have a problem with gamma regression (glm - family = Gamma) and zeros in R. The problem is the following when I try to estimate a dataset without zeros (endogenous variable) there is no problem. However, if I try to do the same with zeros I always get an error message. In STATA and

Re: [R] Reading dataset in R

2013-03-25 Thread Zjoanna
Hi Arun, I finally got the output file (attached here). It has multiple rows. could you help me read it in R? On Fri, Mar 22, 2013 at 3:35 PM, arun kirshna [via R] ml-node+s789695n4662243...@n4.nabble.com wrote: Hi, Try this: con-file(Rout2122.text) Lines1- readLines(con) close(con)

[R] About name of list elements

2013-03-25 Thread Andrew Lin
Hi folks, I am starter for R. While I tried list as following: l - list() l$foo NULL l$foobar - 1 l$foo [1] 1 Apparently, foo and foobar are different name for elements in list (actually foo does not exist). But why they are sharing same value? Thanks a lot! Max [[alternative

[R] Newbie code to count runs of up or down moves

2013-03-25 Thread Newbie1234
There are probably many mistakes with this code. I am used to coding in C with a debugger, so I am very new to coding in R without one and different syntax. My code in the upper left panel of R Studio isz-c(3,1,4,5,2,1,0,3,5,8)zlength(z)y-c(0,0,0,0,0,0,0,0,0,0)ylength(y)zdiff =

Re: [R] Newbie code to count runs of up or down moves

2013-03-25 Thread Newbie1234
My apologies, I didn't realize checking HTML format would produce unreadable text. WIll repost after some more thought to the problem. Thank you. -- View this message in context: http://r.789695.n4.nabble.com/Newbie-code-to-count-runs-of-up-or-down-moves-tp4662423p4662431.html Sent from the

[R] Faster way of summing values up based on expand.grid

2013-03-25 Thread Dimitri Liakhovitski
Hello! # I have 3 vectors of values: values1-rnorm(10) values2-rnorm(10) values3-rnorm(10) # In real life, all 3 vectors have a length of 25 # I create all possible combinations of 4 based on 10 elements: mycombos-expand.grid(1:10,1:10,1:10,1:10) dim(mycombos) # Removing rows that contain pairs

Re: [R] Faster way of summing values up based on expand.grid

2013-03-25 Thread Dimitri Liakhovitski
This is another method I can think of, but it's also slow: for(i in 1:nrow(mycombos)){ # i=1 indexes=rep(0,10) myitems-unlist(mycombos[i,1:4]) indexes[myitems]-1 mycombos$sum1[i]-sum(values1 * indexes) mycombos$sum2[i]-sum(values2 * indexes) mycombos$sum3[i]-sum(values3 * indexes) }

Re: [R] Faster way of summing values up based on expand.grid

2013-03-25 Thread Jorge I Velez
Hi Dimitri, If I understood correctly, the following will do: system.time(sum1 - apply(mycombos, 1, function(x) sum(values1[x]))) system.time(sum2 - apply(mycombos, 1, function(x) sum(values2[x]))) system.time(sum3 - apply(mycombos, 1, function(x) sum(values3[x]))) cbind(sum1, sum2, sum3) HTH,

Re: [R] About name of list elements

2013-03-25 Thread Joshua Wiley
Hi Max, This is known as fuzzy matching. When using `$`, if R can uniquely match the element name based on what is typed, it returns it. Thus, in your example, foo uniquely matches foobar, but if you had foobar, foobox, $foo would not be a unique match. Cheers, Josh On Mon, Mar 25, 2013 at

Re: [R] Faster way of summing values up based on expand.grid

2013-03-25 Thread Dimitri Liakhovitski
Thank you so much, Jorge. I checked and your method is at least 200 times faster than mine! Exactly what I was looking for. Dimitri On Mon, Mar 25, 2013 at 5:49 PM, Jorge I Velez jorgeivanve...@gmail.comwrote: Hi Dimitri, If I understood correctly, the following will do: system.time(sum1 -

Re: [R] About name of list elements

2013-03-25 Thread Sarah Goslee
If you use the shortcut $ then R will use partial matching to hunt for the list element you mean. l$fo will also match. l[[foo]] will not match - the full subsetting construct doesn't use partial matching. I think the intro to R covers this, and you can also see ?$ ?[[ Sarah On Monday, March

Re: [R] About name of list elements

2013-03-25 Thread Bert Gunter
Hello Starter Before posting, please read relevant Help files! ?$ where it tells you: x$name is equivalent to x[[name, exact = FALSE]]. Also, the partial matching behavior of [[ can be controlled using the exact argument. ..etc. -- Bert On Mon, Mar 25, 2013 at 12:21 PM, Andrew Lin

[R] Reassign Multiple Factors to same Factor Value

2013-03-25 Thread Lorenzo Isella
Dear All, Probably something very easy, but I am looking for the most efficient ways to achieve this. Consider the following snippet y-c('a','b','c','d','e','f','g') x-rnorm(length(y)) df-data.frame(y,x) leading to df$y [1] a b c d e f g Levels: a b c d e f g Now, I would like to replace

Re: [R] Newbie code to count runs of up or down moves

2013-03-25 Thread Sarah Goslee
This is unreadable. Please repost in plain text, ideally NOT using Nabble, and please also tell us what you're trying to accomplish. Sarah On Monday, March 25, 2013, Newbie1234 wrote: There are probably many mistakes with this code. I am used to coding in C with a debugger, so I am very new

Re: [R] Newbie code to count runs of up or down moves

2013-03-25 Thread Marc Schwartz
In full agreement with Sarah's comments. That being said, the Magic 8 Ball has the following in the little window for the OP: ?rle Regards, Marc Schwartz On Mar 25, 2013, at 2:44 PM, Sarah Goslee sarah.gos...@gmail.com wrote: This is unreadable. Please repost in plain text, ideally NOT

Re: [R] Reassign Multiple Factors to same Factor Value

2013-03-25 Thread Ista Zahn
Hi Lorenzo, On Mon, Mar 25, 2013 at 6:18 PM, Lorenzo Isella lorenzo.ise...@gmail.com wrote: Dear All, Probably something very easy, but I am looking for the most efficient ways to achieve this. Consider the following snippet y-c('a','b','c','d','e','f','g') x-rnorm(length(y))

Re: [R] About name of list elements

2013-03-25 Thread Peter Ehlers
To the OP: Sooner or later most R beginners are bitten by this all too convenient shortcut. As an R newbie, think of R as your bank account: overuse of $-extraction can lead to undesirable consequences. It's best to acquire the '[[' and '[' habit early. Peter Ehlers On 2013-03-25 12:43, Bert

Re: [R] Reassign Multiple Factors to same Factor Value

2013-03-25 Thread soon yi
or just levels(df$y)[5:7]-others Ista Zahn wrote Hi Lorenzo, On Mon, Mar 25, 2013 at 6:18 PM, Lorenzo Isella lt; lorenzo.isella@ gt; wrote: Dear All, Probably something very easy, but I am looking for the most efficient ways to achieve this. Consider the following snippet

[R] CP in rpart library

2013-03-25 Thread Alberto Cebollada
Can anyone help me to compute manually de CP cost-parameter in library rpart when the command printcp is executed in a Classification tree?? Thank you very much Alberto Cebollada Solanas Grupo de Genética de Micobacterias (http://genmico.unizar.es/) CIBERes - CIBER Enfermedades Respiratorias

[R] GAM model with interactions between continuous variables and factors

2013-03-25 Thread Antonio P. Ramos
Hi all, I am not sure how to handle interactions with categorical predictors in the GAM models. For example what is the different between these bellow two models. Tests are indicating that they are different but their predictions are essentially the same. Thanks a bunch, gam.1 -

Re: [R] GAM model with interactions between continuous variables and factors

2013-03-25 Thread Antonio P. Ramos
Just to clarify: gam.1 has wealth inside the smooths and as a fixed effect predictor while gam.2 only have wealth inside the smooths. Thanks On Mon, Mar 25, 2013 at 6:09 PM, Antonio P. Ramos ramos.grad.stud...@gmail.com wrote: Hi all, I am not sure how to handle interactions with

Re: [R] GAM model with interactions between continuous variables and factors

2013-03-25 Thread Joshua Wiley
Hi Antonio, If wealth is a factor variable, you should include the main effect in the model, as the smooths will be centered. Cheers, Josh On Mon, Mar 25, 2013 at 6:09 PM, Antonio P. Ramos ramos.grad.stud...@gmail.com wrote: Hi all, I am not sure how to handle interactions with

Re: [R] Reassign Multiple Factors to same Factor Value

2013-03-25 Thread arun
Hi, You could also try: library(plyr) df1- df df2- df  df$y-revalue(df$y,c(e=others,f=others,g=others)) df$y #[1] a  b  c  d  others others others #or df1$y-mapvalues(df1$y,from=c(e,f,g),to=rep(others,3)) levels(df1$y) #[1] a  b  c  d  others #or

Re: [R] GAM model with interactions between continuous variables and factors

2013-03-25 Thread Antonio P. Ramos
Just to clarify: I should include wealth - the categorical variable - as a fixed effects *and* within the smooth using the argument by. It that correct? thanks a bunch On Mon, Mar 25, 2013 at 6:18 PM, Joshua Wiley jwiley.ps...@gmail.comwrote: Hi Antonio, If wealth is a factor variable, you

Re: [R] GAM model with interactions between continuous variables and factors

2013-03-25 Thread Joshua Wiley
Yep that's exactly right! :) On Mon, Mar 25, 2013 at 6:22 PM, Antonio P. Ramos ramos.grad.stud...@gmail.com wrote: Just to clarify: I should include wealth - the categorical variable - as a fixed effects *and* within the smooth using the argument by. It that correct? thanks a bunch On Mon,

Re: [R] GAM model with interactions between continuous variables and factors

2013-03-25 Thread Antonio P. Ramos
Thanks! On Mon, Mar 25, 2013 at 6:25 PM, Joshua Wiley jwiley.ps...@gmail.comwrote: Yep that's exactly right! :) On Mon, Mar 25, 2013 at 6:22 PM, Antonio P. Ramos ramos.grad.stud...@gmail.com wrote: Just to clarify: I should include wealth - the categorical variable - as a fixed effects

[R] Problem with nested for-loop

2013-03-25 Thread Curtis Burkhalter
Hello, I'm working on a problem using nested for-loops and I don't know if it's a problem with the order of the loops or something within the loop so any help with the problem would be appreciated. To briefly set up the problem. I have 259 trees (from 11 different species, of unequal count for

[R] Converting 2D matrix to 3D array

2013-03-25 Thread Robert A'gata
Hi, I would like to create M paths of 2 correlated brownian motion incrementals where each path is of length N. I use mvrnorm to create all the increments, i.e. h - 1.0; COV - matrix(c(1,0,0,1),nrow=2); dW- h * t(mvrnorm(n=N*M,mu=c(0,0),Sigma=COV)); The next step is that I'd like to

Re: [R] gamma regression zeros

2013-03-25 Thread Ben Bolker
Sören Prehn Prehn at iamo.de writes: Dear all, I have a problem with gamma regression (glm - family = Gamma) and zeros in R. The problem is the following when I try to estimate a dataset without zeros (endogenous variable) there is no problem. However, if I try to do the same with zeros I

[R] Can you help with local source file instalation?

2013-03-25 Thread mjchi168
Hi R, I tried to install one local source package---qtl into R, but failed with the following message. I am using Macbook OS 10.8.3 with Xcode 4.6.1. ld: warning: directory not found for option '-L/usr/local/lib' ld: library not found for -lgfortran collect2: ld returned 1 exit status make: ***

Re: [R] Distance calculation

2013-03-25 Thread arun
Hi Elisa, Based on the formula you gave, this is what I got: dat1- read.csv(rate.csv,sep=,) res- do.call(cbind,lapply(seq_len(nrow(dat1)),function(i) do.call(rbind,lapply(split(rbind(dat1[i,],dat1[-i,]),1:nrow(rbind(dat1[i,],dat1[-i,]))), function(x)