Val | 11 Feb 23:52 2016
Picon

Pairing and

Hi  all,

I have SNP data set: the first column is the ID and the the
subsequent pair of columns are the alleles for each
SNP1, SNP2 and So on. Each SNP has two columns.  Based on the alleles
I want make phenotype

if the alleles  are 1 1        then  genotype is 0
                  2 2        then  genotype is 1
and if it is          1 2 or 2 1 then  genotyep is 3

This is a sample data set but the actual has 13,000 SNP(26,000columns)

Geno data
AB95 1 1 2 2 2 2 2 2 1 1
AB82 2 2 2 2 2 2 2 2 2 2
AB95 2 1 2 2 2 2 2 2 1 1
AB59 1 1 2 2 1 2 1 2 1 2
AB32 2 1 2 2 2 2 2 2 1 2
AB46 2 1 2 2 1 2 1 1 2 2
AB61 1 1 2 2 1 2 1 2 1 2
AB32 2 2 1 2 2 2 2 2 1 2
AB35 2 2 1 2 2 2 2 2 2 2
AB43 2 2 1 2 2 2 2 2 2 2

Desired output
AB95  0   1   1   1   0
AB82  1   1   1   1   1
AB95  3   1   1   1   0
AB59  0   1   3   3   3
(Continue reading)

papa legba | 11 Feb 13:43 2016
Picon

problem with rJava and install option

Hi,
So working with docker and rJava i have a freeze at the Xrs check
there is a solution that is to use the --disable-Xrs option
https://github.com/s-u/rJava/issues/63

but as i'am a beginner :  install.packages("rJava", repos='
http://cran.us.r-project.org', configure.args ="--disable-Xrs")

doesn't work and still freeze my install...

So any help welcome.

regards and thanks
Bussiere

	[[alternative HTML version deleted]]

Martyn Plummer | 11 Feb 11:25 2016

New R logo

The R logo has been revised in to be more compatible with the principles
of flat design followed by some recent user interfaces such as Microsoft
Windows >= 8 and Mac OS X >= 10.10 (Yosemite). The new logo is
available for download from the R project web site in SVG and
high-resolution PNG formats:

https://www.r-project.org/logo

Thanks to Hadley Wickham and others at RStudio for lending their graphic
design skills.

The logo is dual licensed. You may use either the Creative Commons
Attribution-ShareAlike 4.0 International license (CC-BY-SA 4.0) or the
GNU General Public License version 2 (GPL‑2). For further details,
please refer to the link above.

For the R Foundation
Martyn Plummer, Co-President

-----------------------------------------------------------------------
This message and its attachments are strictly confidenti...{{dropped:8}}

_______________________________________________
R-announce <at> r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-announce
______________________________________________
R-help <at> 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.
(Continue reading)

James Plante | 11 Feb 06:39 2016

Removing a dollar sign from a character vector

What I’ve got:
# sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.3 (El Capitan)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] XML_3.98-1.3 dplyr_0.4.3 

loaded via a namespace (and not attached):
[1] magrittr_1.5      R6_2.1.2          assertthat_0.1    rsconnect_0.4.1.4
[5] parallel_3.2.3    DBI_0.3.1         tools_3.2.3       Rcpp_0.12.3     

> str(y) #toy vector, subset of larger vector in a dataframe of ~4,600 rows.
 chr [1:5] "$1,000.00 " "$1,000.00 " "$1,000.00 " "$2,600.00 " "$2,600.00 “

y is a subset of a column in a dataframe that’s too big to post. I tried the commands listed here on the
dataframe and it didn’t work. So I’m using a small subset to find out where my error is. It’s being a
PITA, and I’m trying to solve it. What I want is a vector of numbers: 1000, 1000, 1000, 2600, 2,600. 

What I’ve tried:
> y
[1] "$1,000.00 " "$1,000.00 " "$1,000.00 " "$2,600.00 " "$2,600.00 "
> gsub("$", "", y)
(Continue reading)

Val | 11 Feb 04:10 2016
Picon

Table

Hi all,

I want create a frequency table using this :

xc1<- sample(c(1:10), 100, replace = TRUE)
xc2<- sample(c(0,1), 100, replace = TRUE)

xc3<- cbind(xc1,xc2)

tab1<- xc3[,list( d1=sum(xc2==0), d2=sum(xc2==1)),by=xc1]

but not working.

Error in `[.data.frame`(xc3, , list(d1 = sum(xc2 == 1), d2 = sum(xc2 ==  :
  unused argument (by = xc1)

any idea?

I want the result like this

xc1  d1  d2
  1  11  5
  2   5  4
  3   5  4
  4   2  5
  5   2  7
  6   7  4
  7   9  5
  8   2  6
  9   5  4
(Continue reading)

C W | 11 Feb 03:37 2016
Picon

Why two curves and numerical integration look so different?

Dear R,

I am graphing the following normal density curve.  Why does it look so
different?

# the curves
x <- seq(-2, 4, by=0.00001)
curve(dnorm(x, 2, 10^(-100)), -4, 4)  #right answer
curve(dnorm(x, 2, 10^(-100)), -3, 4)  #changed -4 to -3, I get wrong answer

Why the second curve is flat?  I just changed it from -4 to -3.  There is
no density in that region.

Also, I am doing numerical integration.  Why are they so different?

> x <- seq(-2, 4, by=0.00001)
> sum(x*dnorm(x, 2, 10^(-100)))*0.00001
[1] 7.978846e+94
> x <- seq(-1, 4, by=0.00001) #changed -2 to -1
> sum(x*dnorm(x, 2, 10^(-100)))*0.00001
[1] 0

What is going here?  What a I doing wrong?

Thanks so much!

	[[alternative HTML version deleted]]

AURORA GONZALEZ VIDAL | 10 Feb 20:34 2016
Picon

customize R code in latex

Hello,

I am struggling with the fact of include a chunk of R code in a paper,
writing in latex.

I have seen some examples using listings() but I would like to keep R
colors.

So as to do that, I have written the code in Rmarkdown and when knitr I
keep the latex file so I obtain the attached files.

But, in order to fit in the paper, I would like to modify the dimensions of
the chunk (make it smaller) and also put it inside a black box.

Do you have any advise?

Thank you very much in advance.

------
Aurora González Vidal
Phd student in Data Analytics for Energy Efficiency

Faculty of Computer Sciences
University of Murcia

 <at> . aurora.gonzalez2 <at> um.es
T. 868 88 7866
www.um.es/ae
Attachment (theData-iq.pdf): application/pdf, 156 KiB
(Continue reading)

Peter Lomas | 10 Feb 21:18 2016
Picon

Calculate average of many subsets based on columns in another dataframe

Hello, I have a dataframe with a date range, and another dataframe
with observations by date.  For each date range, I'd like to average
the values within that range from the other dataframe.  I've provided
code below doing what I would like, but using a for loop is too
inefficient for my actual case (takes about an hour).  So I'm looking
for a way to vectorize.

set.seed(345)
date.range <- seq(as.POSIXct("2015-01-01"),as.POSIXct("2015-06-01"),
by="DSTday")
observations <- data.frame(date=date.range, values=runif(152,1,100) )
groups <- data.frame(start=sample(date.range[1:50], 20), end =
sample(date.range[51:152], 20), average = NA)

#Potential Solution (too inefficient)

for(i in 1:NROW(groups)){
 groups[i, "average"] <- mean(observations[observations$date >=
groups[i, "start"] & observations$date <=groups[i, "end"], "values"])
}

As an extension to this, there will end up being multiple value
columns, and each range will also identify which column to average.  I
think if I can figure out the first problem I can try to extend it
myself.

Thanks,
Peter

(Continue reading)

Archbold Muhle | 10 Feb 18:29 2016
Picon

Installing Rstudio Addinexamples

Kindly assist. I run the below command in Rstudio
> devtools::install_github("rstudio/addinexamples")
and get the following error
Downloading GitHub repo rstudio/addinexamples <at> masterfrom URL
https://api.github.com/repos/rstudio/addinexamples/zipball/masterError in
curl::curl_fetch_memory(url, handle = handle) :   Timeout was reached 		 	   		  
	[[alternative HTML version deleted]]

Fox, John | 10 Feb 17:29 2016
Picon
Picon

Re: Help required for Rcmdr

Dear Sekhar,

I'm sorry that you're experiencing these problems. Although you haven't said so directly, I assume that
you aren't able to use install.packages() to install *any* CRAN packages, not just the Rcmdr package.

Downloading and unpacking the Rcmdr zip file doesn't install the package. You can install the zip-file
binary package from the R Windows GUI via the "Packages > Install package(s) from local zip files" menu,
but that too won't really help because it won't install the many CRAN packages on which the Rcmdr depends.

As I said earlier, my guess is that you're experiencing a problem with a firewall, proxy server, or HTTPS. If
the latter (which was Vito's problem), you can easily solve the problem by using an HTTP CRAN server in
preference to the default HTTPS: 

Enter the command chooseCRANmirror(useHTTPS=FALSE) at the R Console > prompt and select a CRAN mirror -- I
suggest the first (0-Cloud) mirror. Then issue the command install.packages("Rcmdr"), as before.

If that doesn't work, I'm afraid I don't have other suggestions.

You appear to have sent this message only to me, not to r-help. That not a good idea for several reasons, not
least of which is that people who have other suggestions won't see your message. I'm cc'ing this response
to r-help.

Best,
 John

> -----Original Message-----
> From: Sekhar Venkatesan [mailto:venkatesansekhar <at> gmail.com]
> Sent: February 10, 2016 12:03 AM
> To: Fox, John <jfox <at> mcmaster.ca>
> Subject: Re: [R] Help required for Rcmdr
(Continue reading)

Fox, John | 10 Feb 17:47 2016
Picon
Picon

Re: Help required for Rcmdr

Dear Sekhar,

> -----Original Message-----
> From: Sekhar Venkatesan [mailto:venkatesansekhar <at> gmail.com]
> Sent: February 10, 2016 11:37 AM
> To: Fox, John <jfox <at> mcmaster.ca>
> Subject: RE: [R] Help required for Rcmdr
> 
> Tks and sorry for inadvertently sending to u alone

And you apparently just did that again, so again I'm cc'ing to r-help.

> In any case I hv tried all
> over again but to no avail Regards Sekhar

I assume that  by "tried all over again" you mean you tried again with an HTTP rather than HTTPS CRAN mirror and
that didn't work.

I'm afraid that I'm out of ideas.

Maybe someone else will have a suggestion.

John

> 
> On Feb 10, 2016 9:59 PM, "Fox, John" <jfox <at> mcmaster.ca
> <mailto:jfox <at> mcmaster.ca> > wrote:
> 
> 
> 	Dear Sekhar,
(Continue reading)


Gmane