Re: [R] RAxML using R

2014-12-30 Thread Luigi Marongiu
Dear Ista, that sos package is certainly something, didn't know there was one! It turned out that ips is written by the same person who wrote phyloch, so the latter must have been an alpha version of the former. The raxml function worked from ips worked fine -- just a matter of defining the

[R] online classes/certifications?

2014-12-30 Thread Subba Rao
Hi, Are there any good online classes/certifications for R programming and Data Analytics? Thank you in advance for any information. Subba Rao __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

[R] Chaining multiple replacement functions in R

2014-12-30 Thread Daniel Gabrieli
I cross posted this on Stack Overflow: http://stackoverflow.com/questions/27694466/chaining-multiple-replacement-functions-in-r I am using R to work with a large JS object (using the library rjsonio). As such, I have a lot of nested lists, which are getting somewhat cumbersome to work with. I

[R] to create a fuction for removing outlier

2014-12-30 Thread Methekar, Pushpa (GE Transportation, Non-GE)
Hi all, Thanks for your support. sorry for inconvenience cause due to lack of information. here is my all r- program . read in data raw=read.csv(file.choose(),header = T, stringsAsFactors=FALSE) str(raw) conversion from factor to numeric of xs raw$Engine.Speed -

Re: [R] to create a fuction for removing outlier

2014-12-30 Thread PIKAL Petr
Hi Without going to deeply to your code; your data seems to be numeric, but for some reason you read them as character. You shall consult read.csv help and your original data. They probably have some feature which prevent them to be read correctly. To your question, what you want can be

Re: [R] Add labels to my geom_hlines...

2014-12-30 Thread PIKAL Petr
Hi I get error ggplot(data=d.oran)+geom_line(aes(x=Tarih,y=EUROUSD))+geom_hline(data=d.oran.ist,yintercept=x_bar[1]+c(-3:3)*std_sap[1],color=c(red,green,blue,black,blue,green,red),linetype=dashed,lwd=1) Error in get(x, envir = this, inherits = inh)(this, ...) : object 'x_bar' not found with

Re: [R] Memory hungry routines

2014-12-30 Thread ALBERTO VIEIRA FERREIRA MONTEIRO
Thanks to Duncan, Hadley and Henrik. Duncan, I used Rprof and could pinpoint the critical routine that was doing the memory crash. Henrik, you got it right: the culprit was a big matrix of integers, but where some of its fields are filled with -Inf and Inf. This matrix is global, it's used only

Re: [R] Chaining multiple replacement functions in R

2014-12-30 Thread Duncan Murdoch
On 29/12/2014 4:41 PM, Daniel Gabrieli wrote: I cross posted this on Stack Overflow: http://stackoverflow.com/questions/27694466/chaining-multiple-replacement-functions-in-r I am using R to work with a large JS object (using the library rjsonio). As such, I have a lot of nested lists,

Re: [R] online classes/certifications?

2014-12-30 Thread Ista Zahn
I'm certain a google search will be sufficient to answer this question. Best, Ista On Mon, Dec 29, 2014 at 4:05 PM, Subba Rao kv...@tanucoo.com wrote: Hi, Are there any good online classes/certifications for R programming and Data Analytics? Thank you in advance for any information.

[R] rle with data.table - is it possible?

2014-12-30 Thread Kate Ignatius
I'm trying to use both these packages and wondering whether they are possible... To make this simple, my ultimate goal is determine long stretches of 1s, but I want to do this within groups (hence using the data.table as I use the set key option. However, I'm I'm not having much luck making this

[R] Include zero density on unsampled species

2014-12-30 Thread Diego Pujoni
Dear R experts, how are you? I have a data bank in long format as below: species monthyear plotdensity sp1 1 2001 1 39 sp2 1 2001 1 6 sp3 1 2001 1 17

Re: [R] Chaining multiple replacement functions in R

2014-12-30 Thread Daniel Gabrieli
That is really helpful. I am trying to get the rmatch function to return the position of the 'name' instead of the value. So rmatch(app, FirsKey) would return c(3,3,1). Then app[[c(3,3,1)]] - 'new value' would be perfect. On Tue, Dec 30, 2014 at 6:43 AM, Duncan Murdoch

[R] FW: R demos or tutorials

2014-12-30 Thread Joseph Racine
To whom is may concern, I am interested in working with R, and just downloaded the windows installation. Unfortunately when I tried to run some demos, I received an error (Error: could not find function demo). Any suggestions? Also, if you have some tutorial packages to help gain some

Re: [R] FW: R demos or tutorials

2014-12-30 Thread Jeff Newmiller
If you entered demo() at the R prompt and got the stated error then I would venture that your installation is faulty. Another function that should work is sessionInfo() and the output of that function can be helpful to us in troubleshooting. However, I would strongly consider looking

[R] Three-way mosaic residual plot with survey data

2014-12-30 Thread Mast, Brent D
Hi. I want to produce a three-way mosaic residual plot with survey data. I'm using the mosaic function from the vcd package for the plot, and the svytable function from the survey package to produce the contingency table. Here is my code for a two-way table (that works) and a three-way table

[R] R example codes for direct standardization of rates (Reference: Thoma's Lumley's survey package)

2014-12-30 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Hello, I am looking for R example codes to compute age-standardized death rates by smoking and psychological distress status using person-years of observation created from the National Health Interview Survey Linked Mortality Files. Any help with the example codes or references will be

[R] Interesting article on R

2014-12-30 Thread Ben Tupper
Hi, In case you missed it... http://www.nature.com/news/programming-tools-adventures-with-r-1.16609 Cheers, Ben Ben Tupper Bigelow Laboratory for Ocean Sciences 60 Bigelow Drive, P.O. Box 380 East Boothbay, Maine 04544 http://www.bigelow.org __

Re: [R] R example codes for direct standardization of rates (Reference: Thoma's Lumley's survey package)

2014-12-30 Thread Anthony Damico
hi pradip hope you're doing well! these two scripts have age adjustment calculations, but neither are specific to nhis. the nhanes example is probably closer to what you're trying to do :)

Re: [R] R example codes for direct standardization of rates (Reference: Thoma's Lumley's survey package)

2014-12-30 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Hi Anthony, Thank you for sending me your well-documented R scripts that are meant for age-adjusted rate calculations. I will keep you posted on the implementation of these scripts in the context of my analyses. Pradip Pradip K. Muhuri, PhD SAMHSA/CBHSQ 1 Choke Cherry Road, Room 2-1071

Re: [R] Three-way mosaic residual plot with survey data

2014-12-30 Thread Achim Zeileis
On Tue, 30 Dec 2014, Mast, Brent D wrote: Hi. I want to produce a three-way mosaic residual plot with survey data. I'm using the mosaic function from the vcd package for the plot, and the svytable function from the survey package to produce the contingency table. Here is my code for a

Re: [R] Chaining multiple replacement functions in R

2014-12-30 Thread Daniel Gabrieli
This is what I came up with (to make the recursive function return the position of the 'name' and still be able to chain the calls together). I am not sure if this is a great way to do it... but it seems to be working... rmatch.pos - function(object, name, seq=NA, level=NULL){ ##return the

[R] simplify code for dummy coding of factors

2014-12-30 Thread Michael Friendly
In a manuscript, I have the following code to illustrate dummy coding of two factors in a contingency table. It works, but is surely obscured by the method I used, involving outer() to find equalities and 0+outer() to convert to numeric. Can someone help simplify this code to be more

Re: [R] simplify code for dummy coding of factors

2014-12-30 Thread John Fox
Hi Michael, At first I thought that as.numeric() would do it, but that loses the matrix structure. Here are two solutions; I think that I prefer the second. --- snip (dummy.hair - outer(haireye.df$Hair, + levels(haireye.df$Hair), function(x, y) as.numeric(x

Re: [R] simplify code for dummy coding of factors

2014-12-30 Thread David Winsemius
On Dec 30, 2014, at 3:05 PM, Michael Friendly wrote: In a manuscript, I have the following code to illustrate dummy coding of two factors in a contingency table. It works, but is surely obscured by the method I used, involving outer() to find equalities and 0+outer() to convert to

Re: [R] simplify code for dummy coding of factors

2014-12-30 Thread Richard M. Heiberger
I like this very simple version. Note that you don't need as.data.frame(). model.matrix(Freq ~ Hair + Eye, data=haireye, contrasts.arg=list(Hair=diag(4), Eye=diag(4))) On Tue, Dec 30, 2014 at 6:05 PM, Michael Friendly frien...@yorku.ca wrote: In a manuscript, I have the following code to

Re: [R] simplify code for dummy coding of factors

2014-12-30 Thread Jeff Newmiller
More comprehensible depends on context, which we don't have. You could be simply trying to illustrate the logic of the transformation (solution 1 below) or providing a recipe which by its brevity is (perhaps?) memorable (solution 2 below). Solution 1: appendDummys - function( DF, keycol,

Re: [R] simplify code for dummy coding of factors

2014-12-30 Thread Michael Friendly
On 12/30/14 7:16 PM, Richard M. Heiberger wrote: I like this very simple version. Note that you don't need as.data.frame(). model.matrix(Freq ~ Hair + Eye, data=haireye, contrasts.arg=list(Hair=diag(4), Eye=diag(4))) Thanks to all who replied to this question. model.matrix() was what I had

Re: [R] simplify code for dummy coding of factors

2014-12-30 Thread Richard M. Heiberger
It can handle one more simplification step # Rich Heiberger, removing intercept, including haireye data haireye.df - cbind( as.data.frame(haireye), model.matrix(Freq ~ Hair + Eye, data=haireye, contrasts.arg=list(Hair=diag(4), Eye=diag(4)))[,-1] ) haireye.df On Tue, Dec 30,

Re: [R] Moving average

2014-12-30 Thread jim holtman
Try this: x - read.csv(text = Date,Open,High,Low,Close,Volume,Adj Close + 2014-12-26,162.27,163.09,162.01,162.34,1912200,162.34 + 2014-12-24,162.88,162.99,161.61,161.82,1868100,161.82 + 2014-12-23,162.23,162.90,161.61,162.24,4043300,162.24 + 2014-12-22,158.33,161.91,158.33,161.44,4682500,161.44,

[R] Problem in R2WinBUGS

2014-12-30 Thread thanoon younis
Dear all members I have a problem with the code below when i wanted to change the continuous random variables to mixed ordered categorical and dichotomous as follow #transform theta to ordinal variables yo - array(0, dim=c(i,5,100)) for(j in 1:5){ if(v[j] 0.25){

[R] which is faster for or apply

2014-12-30 Thread Karim Mezhoud
Hi All, I would like to choice between these two data frame convert. which is faster? for(i in 1:ncol(DataFrame)){ DataFrame[,i] - as.numeric(DataFrame[,i]) } OR DataFrame - as.data.frame(apply(DataFrame,2 ,function(x) as.numeric(x))) Thanks Karim

Re: [R] Problem in R2WinBUGS

2014-12-30 Thread Berend Hasselman
On 31-12-2014, at 08:27, thanoon younis thanoon.youni...@gmail.com wrote: Dear all members I have a problem with the code below when i wanted to change the continuous random variables to mixed ordered categorical and dichotomous as follow #transform theta to ordinal variables yo -

Re: [R] which is faster for or apply

2014-12-30 Thread Berend Hasselman
On 31-12-2014, at 08:40, Karim Mezhoud kmezh...@gmail.com wrote: Hi All, I would like to choice between these two data frame convert. which is faster? for(i in 1:ncol(DataFrame)){ DataFrame[,i] - as.numeric(DataFrame[,i]) } OR DataFrame -