Re: [R] 3D Plot with Date Axis?

2017-10-27 Thread David Winsemius

> On Oct 27, 2017, at 12:22 PM, Alex Restrepo  wrote:
> 
> Hello,
> 
> I would like to format the X axis of the plot created via the scatterplot3d 
> function or any other function which will work.
> 
> Here is an example of what I am trying to do:
> 
> library("scatterplot3d")
> 
> mydf=data.frame(rate=c(1,1,4,4), age=c(2,2,5,5), market_date=c('2017-01-01', 
> '2017-02-02', '2017-03-03', '2017-04-04'))
> 
> scatterplot3d(mydf$market_date, mydf$rate, mydf$age, xaxt="n")
> 
> axis.Date(1, mydf$market_date, format="%Y-%m-%d")
> 
> I tried to hide the x axis, but it looks like xaxt is not working for the 
> scatterplot3d function.

Please read the "?scatterplot3d page more carefully. I think you should be 
looking for the x.ticklabs parameter.

-- 
David.
> 
> Using the above example, could someone please provide me with some guidance 
> and help?
> 
> Many Thanks,
> 
> Alex
> 
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] Variable selection in clusters using 1-R2 ratio

2017-10-27 Thread Seeliger, Curt
Folks,
I am looking for a means for calculating the 1-R^2 ratio for variable selection 
to mimic the values of PROC VARCLUS in SAS. While there may be better methods 
for variable selection, we are trying to duplicate published  results at this 
time.

To date, I have been unable to find a way to obtain this value from 
Hmisc::varclus , stats::hclust and clustvarsel::clustvarsel.  Can any of you 
give me a leg up on a more appropriate package or suggest another means for 
obtaining the 1-R^2 ratio from the available outputs?

Thank you for your time,
cur
--
Curt Seeliger, Data Ranger
CSRA, Inc. | Contractor to ORD
seeliger.c...@epa.gov
541-754-4638


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] 3D Plot with Date Axis?

2017-10-27 Thread Alex Restrepo
Hello,

I would like to format the X axis of the plot created via the scatterplot3d 
function or any other function which will work.

Here is an example of what I am trying to do:

library("scatterplot3d")

mydf=data.frame(rate=c(1,1,4,4), age=c(2,2,5,5), market_date=c('2017-01-01', 
'2017-02-02', '2017-03-03', '2017-04-04'))

scatterplot3d(mydf$market_date, mydf$rate, mydf$age, xaxt="n")

axis.Date(1, mydf$market_date, format="%Y-%m-%d")

I tried to hide the x axis, but it looks like xaxt is not working for the 
scatterplot3d function.

Using the above example, could someone please provide me with some guidance and 
help?

Many Thanks,

Alex


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] genetics: backward haplotype transmission association algorithm

2017-10-27 Thread Bert Gunter
You may get lucky here, but I recommend that you post this instead on the
Bioconductor list, which is exactly concerned with such things.

Cheers,
Bert

Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

On Fri, Oct 27, 2017 at 6:16 AM, Troels Ring  wrote:

> Dear friends - a couple of papers in PNAS (lastly:framework for making
> better predictions by directly estimating variables' predictivity, Lo et al
> PNAS 2016; 113:14277-14282) have focused interest on mapping complex traits
> to multiple loci spread all over the genome. I have been around on the
> relevant taskview(s) I hope but fail to see that the backward haplotype
> transmission association algorithm (BHTA) first described by the authors in
> Hum Hered 2002; 53: 197-215. I wonder whether the algorithm has been
> implemented in R - primarily I ask since I fail to understand exactly how
> the algorithm works and thought R code would help there.
>
> All best wishes
>
> Troels Ring
> Aalborg, Denmark
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posti
> ng-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] genetics: backward haplotype transmission association algorithm

2017-10-27 Thread Troels Ring
Dear friends - a couple of papers in PNAS (lastly:framework for making 
better predictions by directly estimating variables' predictivity, Lo et 
al PNAS 2016; 113:14277-14282) have focused interest on mapping complex 
traits to multiple loci spread all over the genome. I have been around 
on the relevant taskview(s) I hope but fail to see that the backward 
haplotype transmission association algorithm (BHTA) first described by 
the authors in Hum Hered 2002; 53: 197-215. I wonder whether the 
algorithm has been implemented in R - primarily I ask since I fail to 
understand exactly how the algorithm works and thought R code would help 
there.


All best wishes

Troels Ring
Aalborg, Denmark

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] My function and NA Values Problem

2017-10-27 Thread Engin YILMAZ
Thanks SEZEN and BERGER

Now it is working.

My mistake <- I have written  this statement (na.rm=TRUE) to the wrong
location (after the  sum expression)

Thanks for your kindly responses

Sincerely
Engin YILMAZ

2017-10-27 10:57 GMT+03:00 Ismail SEZEN :

>
> > On 27 Oct 2017, at 10:43, Engin YILMAZ  wrote:
> >
> > Dear R Staff
> >
> > My working file is in the annex. "g1.csv"
> > I have only 2 columns. Rice and coke.
> > I try to execute following(below) function, but do not work.
> > Because "Coke" value has NA values.
> > I try to add "na.rm=True" to the function but do not work
> > How can I solve this problem with this function or another algorithm?
> > (Note: I have normally 450 columns)
> >
> > Sincerely
> > Engin YILMAZ
> >
> >
> > apply(g1, 2, function(c) sum(c==0))
> >
> > Rice Coke
> >   0   NA
>
> A simple reproduciple example always works,
>
> # create sample data
> df <- data.frame(a = round(runif(100) * 10), b = round(runif(100) * 10))
> df[which(df[,2] == 2),2] <- NA # add NA to second column
>
> apply(df, 2, function(x) sum(x == 1, na.rm = TRUE))
>
>
>


-- 
*Saygılarımla*
Engin YILMAZ

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] My function and NA Values Problem

2017-10-27 Thread Ismail SEZEN

> On 27 Oct 2017, at 10:43, Engin YILMAZ  wrote:
> 
> Dear R Staff
> 
> My working file is in the annex. "g1.csv"
> I have only 2 columns. Rice and coke.
> I try to execute following(below) function, but do not work.
> Because "Coke" value has NA values.
> I try to add "na.rm=True" to the function but do not work
> How can I solve this problem with this function or another algorithm?
> (Note: I have normally 450 columns)
> 
> Sincerely
> Engin YILMAZ
> 
> 
> apply(g1, 2, function(c) sum(c==0))
> 
> Rice Coke
>   0   NA

A simple reproduciple example always works,

# create sample data
df <- data.frame(a = round(runif(100) * 10), b = round(runif(100) * 10))
df[which(df[,2] == 2),2] <- NA # add NA to second column

apply(df, 2, function(x) sum(x == 1, na.rm = TRUE))

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] My function and NA Values Problem

2017-10-27 Thread Eric Berger
na.rm=TRUE  (you need to capitalize)


On Fri, Oct 27, 2017 at 10:43 AM, Engin YILMAZ 
wrote:

> Dear R Staff
>
> My working file is in the annex. "g1.csv"
> I have only 2 columns. Rice and coke.
> I try to execute following(below) function, but do not work.
> Because "Coke" value has NA values.
> I try to add "na.rm=True" to the function but do not work
> How can I solve this problem with this function or another algorithm?
> (Note: I have normally 450 columns)
>
> Sincerely
> Engin YILMAZ
>
>
> apply(g1, 2, function(c) sum(c==0))
>
> Rice Coke
>0   NA
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] My function and NA Values Problem

2017-10-27 Thread Engin YILMAZ
Dear R Staff

My working file is in the annex. "g1.csv"
I have only 2 columns. Rice and coke.
I try to execute following(below) function, but do not work.
Because "Coke" value has NA values.
I try to add "na.rm=True" to the function but do not work
How can I solve this problem with this function or another algorithm?
(Note: I have normally 450 columns)

Sincerely
Engin YILMAZ


apply(g1, 2, function(c) sum(c==0))

Rice Coke
   0   NA
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.