Re: [R] problem with labeling plots, possibly in font defaults

2014-08-08 Thread Prof Brian Ripley
See 
http://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html#I-see-no-text-in-a-Quartz-plot_0021


And the default font is not serif ... that FAQ says it is Arial, but I 
do not know if that is current.


Mac-specific questions to R-sig-mac please.  (This must be Mac-specific 
as the default device, quartz(), is.)


On 07/08/2014 23:24, David Winsemius wrote:


On Aug 7, 2014, at 12:59 PM, Tim Blass wrote:


Hello,

I am using R 3.1.1 on a (four year old) MacBook, running OSX 10.9.4.

I just tried making and labeling a plot as follows:


x-rnorm(10)
y-rnorm(10)
plot(x,y)
title(main=random points)


which produces a scatter plot of the random points, but without the title
and without any numbers along the axes. If I then run


par(family=sans)
plot(x,y,main=plot title)


the plot has the title and the numbers on the axes (also and 'x' and 'y'
appear as default labels for the axes).

I do not know what is going on, but maybe there is some problem in the
default font settings (I don't know if that could be an R issue or an issue
specific to my Mac)?


It hasn't happened to me recently (since updating from Leopard and SnowLeapard 
to Lion)  but it used to happen pretty frequently that I would get a duplicate 
font that printed empty square boxes. (I wasn't the only one. It got reported 
several times on R-SIG-Mac.)  One could fix that sort of problem by deleting 
the offending duplicate entry using Font Book.app

Since this is happening with the default serif font,  you would probably find 
the duplicate in Times. (It used to be happening to me with Symbol.)


quartzFonts()$serif

[1] Times-Roman  Times-Bold   Times-Italic Times-BoldItalic







This is clearly not a big problem (at least for now) since I can put labels
on plots by running par(), but if it is indicative of a larger underlying
problem (or if there is a simple fix) I would like to know.

Thank you!


David Winsemius
Alameda, CA, USA



--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@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.


Re: [R] Some hpc problems with doMPI and runmpi (I know there is R-SIG-HPC)

2014-08-08 Thread Pascal Oettli
Hello,

In your email, you speak about foreach()%dopar%, but in your script,
it is foreach()%do%.

Best,
Pascal

On Thu, Aug 7, 2014 at 7:19 PM, André Ziervogel
andre.ziervo...@psychol.uni-giessen.de wrote:
 Dear R people,

 I’ve been doing some hpc using R and openmpi. Unfortunately I’ve encoutred a 
 major problem and it’s nature is hard to pin down:

 Essentially I call mpirun Rscipt … as soon as the script reaches a 
 foreach()%dopar% it halts indefinitely. I’ve attached the qsub script:

 #!/bin/bash
 #$ -S /bin/bash
 #$ -N test_14
 #$ -cwd

 #$ -V
 #$ -o /fhgfs/g61570/Spectral Databases/log/test_14_$JOB_ID
 #$ -j y
 #$ -q regular
 #$ -pe openmpi 8
 #$ -l h_rt=00:15:00
 #$ -l h_vmem=1.9G
 #$ -m eas
 #$ -M andre.ziervo...@psychol.uni-giessen.de

 module add gcc
 module add openmpi/gcc/64/1.6.5
 module add R/gcc/3.0.1

 date   #log start time

 echo Number of slots  . $NSLOTS

 mpirun Rscript /fhgfs/g61570/Spectral\ Databases/test_10.r  
 /fhgfs/g61570/Spectral\ Databases/log/test_14.Rout

 date

 exit

 and the R file:

 suppressMessages(library('doMPI'))

 skylla.cluster - startMPIcluster()
 registerDoMPI(skylla.cluster)

 cat(paste(COMM SIZE: , mpi.comm.size(0),  cluster size: , 
 clusterSize(skylla.cluster), \n,sep = ))

 tmp.time - proc.time()
 sample - foreach(i=seq(from=0, to=1000, by =1),.combine='c',.inorder=TRUE) 
 %do%
 {
 r - sqrt(i^2 + i^2) + .Machine$double.eps  * factorial(i)
 sin(r) / r
 }
 cat(paste(Processing seriell time: , \n, sep =   ))
 print(proc.time() - tmp.time)
 #print(sample)

 tmp.time - proc.time()
 sample - foreach(i=seq(from=0, to=1000, by =1),.combine='c',.inorder=TRUE) 
 %dopar%
 {
 r - sqrt(i^2 + i^2) + .Machine$double.eps  * factorial(i)
 sin(r) / r
 }
 cat(paste(Processing parallel time: , \n, sep =   ))
 print(proc.time() - tmp.time)
 #print(sample)

 closeCluster(skylla.cluster)
 # mpi.close.Rslaves()
 # mpi.exit()
 mpi.quit(save='no‘)

 Any suggestions would be highly appreciated! Thanks!

 Best

 André

 --
 Dipl. Psych André Ziervogel
 andre.ziervo...@psychol.uni-giessen.de
 --


 __
 R-help@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.




-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
R-help@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.


Re: [R] Output from file.info()$mtime

2014-08-08 Thread Prof Brian Ripley

On 07/08/2014 23:37, Fisher Dennis wrote:

R 3.1.1
OS X (and Windows)

Colleagues

I have some code that manages files.  Previously (as late as 3.1.0), the 
command:
file.info(FILENAME)$mtime == “”
yielded T/F

Now, it triggers an error:
Error in as.POSIXlt.character(x, tz, ...) :
  character string is not in a standard unambiguous format

I looked through Peter Dalgaard’s list of changes in 3.1.1 and I cannot find 
anything that would explain the change between versions.  I have fixed the 
problem.  However, I am concerned that other problems may be lurking (i.e., the 
changes might affect other commands).

Of note, I ran:
str(file.info(FILENAME)$mtime)
in both versions of R and the results did not differ

Can anyone explain what changed so that I can search my code efficiently?


Can you explain how that managed to give TRUE (sic)?  It was always a 
POSIXct timestamp, and as such is never equal  (assuming that your 
mail client mangled ASCII double quotes).


I believe the relevant report is 
https://bugs.r-project.org/bugzilla/show_bug.cgi?id=15829






Thanks in advance.

Dennis


Dennis Fisher MD
P  (The P Less Than Company)
Phone: 1-866-PLessThan (1-866-753-7784)
Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com


__
R-help@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.


[R] map column name in matrix to multiple elements

2014-08-08 Thread Adrian Johnson
Hi:
I am requesting help on matrix mapping.

I have a matrix that is 5000 rows x 3000 columns in R env.

Matrix:

   A  BC   D  E

S1   0.01 0.2  -0.3 0.8-1

S2   -21.4   2.3  3.1-2

S3   -4 -3-20.42.1



I have another excel sheet, which when I import will have two columns..


ColMapelement

A Apple
A Arcade
A Almira
B Boy
B Balloon
B Bat
C Cat
.


I want to create another matrix with elements as column names and map
 ColMap values onto elements.



new matrix:

   Apple  Arcade   AlmiraBoy   Ballon 
S1  0.01 0.010.01 0.2   0.2
S2  -2 -2-2 1.4 1.4
S3  -4 -4-4  -3  -3  ..


I have no idea how I could do this in R.  would any one help please.

Thanks

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] map column name in matrix to multiple elements

2014-08-08 Thread Sarah Goslee
Using dput() to provide your data is enormously easier.

Assuming the original column names of your data frame correspond to
the ColMap column of the second data frame, it's very straightforward:


mat - structure(list(A = c(0.01, -2, -4), B = c(0.2, 1.4, -3), C = c(-0.3,
2.3, -2), D = c(0.8, 3.1, 0.4), E = c(-1, -2, 2.1)), .Names = c(A,
B, C, D, E), class = data.frame, row.names = c(S1,
S2, S3))


matnames - structure(list(ColMap = c(A, A, A, B, B, B, C),
element = c(Apple, Arcade, Almira, Boy, Balloon,
Bat, Cat)), .Names = c(ColMap, element), class =
data.frame, row.names = c(NA, -7L))

mat - mat[, matnames$ColMap]
colnames(mat) - matnames$element



R mat
   Apple Arcade Almira  Boy Balloon  Bat  Cat
S1  0.01   0.01   0.01  0.2 0.2  0.2 -0.3
S2 -2.00  -2.00  -2.00  1.4 1.4  1.4  2.3
S3 -4.00  -4.00  -4.00 -3.0-3.0 -3.0 -2.0


Sarah

On Fri, Aug 8, 2014 at 9:04 AM, Adrian Johnson
oriolebaltim...@gmail.com wrote:
 Hi:
 I am requesting help on matrix mapping.

 I have a matrix that is 5000 rows x 3000 columns in R env.

 Matrix:

A  BC   D  E

 S1   0.01 0.2  -0.3 0.8-1

 S2   -21.4   2.3  3.1-2

 S3   -4 -3-20.42.1



 I have another excel sheet, which when I import will have two columns..


 ColMapelement

 A Apple
 A Arcade
 A Almira
 B Boy
 B Balloon
 B Bat
 C Cat
 .


 I want to create another matrix with elements as column names and map
  ColMap values onto elements.



 new matrix:

Apple  Arcade   AlmiraBoy   Ballon 
 S1  0.01 0.010.01 0.2   0.2
 S2  -2 -2-2 1.4 1.4
 S3  -4 -4-4  -3  -3  ..


 I have no idea how I could do this in R.  would any one help please.

 Thanks


-- 
Sarah Goslee
http://www.functionaldiversity.org

__
R-help@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.


[R] color palettes

2014-08-08 Thread carol white
Hi,
Is there any way to take one color of each color family from a color palettes 
like rainbow? For ex, if there are different blues differentiated by intensity, 
hue etc, taking one of them. In this case, when using rainbow(n), then how to 
select 1 color of each family, for ex 1 blue, 1 red etc? It doesn't matter 
which intensity, hue etc is taken as long as 1 color from each family is taken.


Thanks

Carol

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Output from file.info()$mtime

2014-08-08 Thread Fisher Dennis
Professor Ripley

You asked “how that managed to give TRUE? (I apologize for the mangled quotes — 
the error occurred with plain quotes).
All that I can say is that R versions = 3.1.0 allowed my code to execute 
without error.  The bug report appears to address the issue.  I typically 
review Dalgaard’s list of changes in each new version  —  it does not contain 
anything about this bug fix.

Dennis


Dennis Fisher MD
P  (The P Less Than Company)
Phone: 1-866-PLessThan (1-866-753-7784)
Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com



On Aug 8, 2014, at 1:54 AM, Prof Brian Ripley rip...@stats.ox.ac.uk wrote:

 On 07/08/2014 23:37, Fisher Dennis wrote:
 R 3.1.1
 OS X (and Windows)
 
 Colleagues
 
 I have some code that manages files.  Previously (as late as 3.1.0), the 
 command:
  file.info(FILENAME)$mtime == “”
 yielded T/F
 
 Now, it triggers an error:
  Error in as.POSIXlt.character(x, tz, ...) :
character string is not in a standard unambiguous format
 
 I looked through Peter Dalgaard’s list of changes in 3.1.1 and I cannot find 
 anything that would explain the change between versions.  I have fixed the 
 problem.  However, I am concerned that other problems may be lurking (i.e., 
 the changes might affect other commands).
 
 Of note, I ran:
  str(file.info(FILENAME)$mtime)
 in both versions of R and the results did not differ
 
 Can anyone explain what changed so that I can search my code efficiently?
 
 Can you explain how that managed to give TRUE (sic)?  It was always a POSIXct 
 timestamp, and as such is never equal  (assuming that your mail client 
 mangled ASCII double quotes).
 
 I believe the relevant report is 
 https://bugs.r-project.org/bugzilla/show_bug.cgi?id=15829
 
 
 
 
 Thanks in advance.
 
 Dennis
 
 
 Dennis Fisher MD
 P  (The P Less Than Company)
 Phone: 1-866-PLessThan (1-866-753-7784)
 Fax: 1-866-PLessThan (1-866-753-7784)
 www.PLessThan.com
 

__
R-help@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.


Re: [R] color palettes

2014-08-08 Thread David L Carlson
I would suggest not using pie charts and not trying to make 1000 color 
distinctions. Also read all of my original post and do some research.

 cols - hsv(.6, seq(0, 1, length.out=1000), .9)
 pie(1:1000, labels=, col=cols, border=NA)

David

From: carol white [mailto:wht_...@yahoo.com]
Sent: Friday, August 8, 2014 9:03 AM
To: David L Carlson
Subject: Re: [R] color palettes

Well I'm using 1000 colors in a pie chart and get the same color but different 
intensity. I can't fix myself as the number of colors are high. So what would 
you suggest?

Thanks

carol

On Friday, August 8, 2014 3:58 PM, David L Carlson 
dcarl...@tamu.edumailto:dcarl...@tamu.edu wrote:

I think your question is too vague to answer since we don't know what you are 
trying to do or how many colors you need. The easy answer is that you don't 
need to use rainbow() at all, just use color names:

mycolors - c(red, green, blue, violet)

and you will have one of each. For example, col=mycolors(2) will plot using 
green (and so will col=green). There are lots of color names in R:

 length(colors(distinct=TRUE))
[1] 502

The longer answer is that there are many color palettes and ways of selecting, 
manipulating, and choosing colors. The built in functions include palettes such 
as rainbow, heat.colors, terrain.colors, topo.colors, cm.colors, and gray and 
ways of specifying colors (in addition to using names) including rgb, hsv, and 
hcl. In addition, there are several packages for creating color palettes 
including RColorBrewer, colortools, colorspace, and munsell.

-
David L Carlson
Department of Anthropology
Texas AM University
College Station, TX 77840-4352

-Original Message-
From: r-help-boun...@r-project.orgmailto:r-help-boun...@r-project.org 
[mailto:r-help-boun...@r-project.orgmailto:r-help-boun...@r-project.org] On 
Behalf Of carol white
Sent: Friday, August 8, 2014 8:27 AM
To: r-help@r-project.orgmailto:r-help@r-project.org
Subject: [R] color palettes

Hi,
Is there any way to take one color of each color family from a color palettes 
like rainbow? For ex, if there are different blues differentiated by intensity, 
hue etc, taking one of them. In this case, when using rainbow(n), then how to 
select 1 color of each family, for ex 1 blue, 1 red etc? It doesn't matter 
which intensity, hue etc is taken as long as 1 color from each family is taken.


Thanks

Carol


[[alternative HTML version deleted]]

__
R-help@r-project.orgmailto:R-help@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.htmlhttp://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
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] color palettes

2014-08-08 Thread Sarah Goslee
You might take a look at the RColorBrewer package.

Sarah

On Fri, Aug 8, 2014 at 9:26 AM, carol white wht_...@yahoo.com wrote:
 Hi,
 Is there any way to take one color of each color family from a color palettes 
 like rainbow? For ex, if there are different blues differentiated by 
 intensity, hue etc, taking one of them. In this case, when using rainbow(n), 
 then how to select 1 color of each family, for ex 1 blue, 1 red etc? It 
 doesn't matter which intensity, hue etc is taken as long as 1 color from each 
 family is taken.


 Thanks

 Carol

-- 
Sarah Goslee
http://www.functionaldiversity.org

__
R-help@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.


[R] FW: color palettes

2014-08-08 Thread David L Carlson
I think your question is too vague to answer since we don't know what you are 
trying to do or how many colors you need. The easy answer is that you don't 
need to use rainbow() at all, just use color names:

mycolors - c(red, green, blue, violet)

and you will have one of each. For example, col=mycolors(2) will plot using 
green (and so will col=green). There are lots of color names in R:

 length(colors(distinct=TRUE))
[1] 502

The longer answer is that there are many color palettes and ways of selecting, 
manipulating, and choosing colors. The built in functions include palettes such 
as rainbow, heat.colors, terrain.colors, topo.colors, cm.colors, and gray and 
ways of specifying colors (in addition to using names) including rgb, hsv, and 
hcl. In addition, there are several packages for creating color palettes 
including RColorBrewer, colortools, colorspace, and munsell.

-
David L Carlson
Department of Anthropology
Texas AM University
College Station, TX 77840-4352


-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
Behalf Of carol white
Sent: Friday, August 8, 2014 8:27 AM
To: r-help@r-project.org
Subject: [R] color palettes

Hi,
Is there any way to take one color of each color family from a color palettes 
like rainbow? For ex, if there are different blues differentiated by intensity, 
hue etc, taking one of them. In this case, when using rainbow(n), then how to 
select 1 color of each family, for ex 1 blue, 1 red etc? It doesn't matter 
which intensity, hue etc is taken as long as 1 color from each family is taken.


Thanks

Carol

[[alternative HTML version deleted]]

__
R-help@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.

__
R-help@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.


Re: [R] color palettes

2014-08-08 Thread Mark Knecht
?rainbow
?col2rgb

rainbow(8)
col2rgb(rainbow(8)[5])

col2rgb(rainbow(8)[5])[1]
col2rgb(rainbow(8)[5])[2]
col2rgb(rainbow(8)[5])[3]

On Fri, Aug 8, 2014 at 6:26 AM, carol white wht_...@yahoo.com wrote:
 Hi,
 Is there any way to take one color of each color family from a color palettes 
 like rainbow? For ex, if there are different blues differentiated by 
 intensity, hue etc, taking one of them. In this case, when using rainbow(n), 
 then how to select 1 color of each family, for ex 1 blue, 1 red etc? It 
 doesn't matter which intensity, hue etc is taken as long as 1 color from each 
 family is taken.


 Thanks

 Carol

 [[alternative HTML version deleted]]

 __
 R-help@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.

__
R-help@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.


[R] Need help on boot strapping

2014-08-08 Thread Aravindhan, K
Dear Team,
I am getting this error while running the boot-strapping functions. 

==
mod.db.hub-glm(TOTAL~1+IPD,family=poisson,data=db)
fit-fitted(mod.db.hub)
e-residuals(mod.db.hub)
X-model.matrix(mod.db.hub)
boot.huber.fixed-function(data,indices,maxit=20) {
Y-fit+e[indices]
mod-glm(Y~X-1,family=poisson,maxit=maxit)
coefficients(mod)
}
library(boot)
db.fix.boot-boot(db,boot.huber.fixed,2000,maxit=20)
db.fix.boot
boot.ci(db.fix.boot,index=1,type=c(bca,perc,poisson))
boot.ci(db.fix.boot,index=2,type=c(bca,perc,poisson))
==

Error in eval(expr, envir, enclos) : 
negative values not allowed for the 'Poisson' family
In addition: Warning messages:
1: In dpois(y, mu, log = TRUE) : non-integer x = 25.006412
2: In dpois(y, mu, log = TRUE) : non-integer x = 26.969411
3: In dpois(y, mu, log = TRUE) : non-integer x = 66.352323
4: In dpois(y, mu, log = TRUE) : non-integer x = 61.083519
5: In dpois(y, mu, log = TRUE) : non-integer x = 20.596770
6: In dpois(y, mu, log = TRUE) : non-integer x = 43.428258
7: In dpois(y, mu, log = TRUE) : non-integer x = 1108.263554
8: In dpois(y, mu, log = TRUE) : non-integer x = 61.937982
9: In dpois(y, mu, log = TRUE) : non-integer x = 419.991213
10: In dpois(y, mu, log = TRUE) : non-integer x = 47.369133

Can you explain to me how to get rid of these ?

Thanks
Aravindhan

__
R-help@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.


[R] inverse Gaussian data transformation in R?

2014-08-08 Thread gj
Anyone know of an R package that will allow me to do an inverse 
Gaussian/Wald distribution transform of my data (reaction times)? Thanks!


__
R-help@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.


[R] boot strapping poisson getting warnings and negative values

2014-08-08 Thread K Aravindhan
Dear Team,
I am getting this error while running the boot-strapping functions. 

==
mod.db.hub-glm(TOTAL~1+IPD,family=poisson,data=db)
fit-fitted(mod.db.hub)
e-residuals(mod.db.hub)
X-model.matrix(mod.db.hub)
boot.huber.fixed-function(data,indices,maxit=20) { Y-fit+e[indices]
mod-glm(Y~X-1,family=poisson,maxit=maxit)
coefficients(mod)
}
library(boot)
db.fix.boot-boot(db,boot.huber.fixed,2000,maxit=20)
db.fix.boot
boot.ci(db.fix.boot,index=1,type=c(bca,perc,poisson))
boot.ci(db.fix.boot,index=2,type=c(bca,perc,poisson))
==

Error in eval(expr, envir, enclos) : 
negative values not allowed for the 'Poisson' family In addition: Warning 
messages:
1: In dpois(y, mu, log = TRUE) : non-integer x = 25.006412
2: In dpois(y, mu, log = TRUE) : non-integer x = 26.969411
3: In dpois(y, mu, log = TRUE) : non-integer x = 66.352323
4: In dpois(y, mu, log = TRUE) : non-integer x = 61.083519
5: In dpois(y, mu, log = TRUE) : non-integer x = 20.596770
6: In dpois(y, mu, log = TRUE) : non-integer x = 43.428258
7: In dpois(y, mu, log = TRUE) : non-integer x = 1108.263554
8: In dpois(y, mu, log = TRUE) : non-integer x = 61.937982
9: In dpois(y, mu, log = TRUE) : non-integer x = 419.991213
10: In dpois(y, mu, log = TRUE) : non-integer x = 47.369133

Can you explain to me how to get rid of these ?

Thanks
Aravindhan

__
R-help@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.


[R] glmnet, Error in apply(nz, 1, median) : dim(X) must have a positive length

2014-08-08 Thread Sheila the angel
Hello all,
In glmnet package, cv.glmnet is giving error

data(iris)
df-data.frame(iris$Sepal.Length, iris$Sepal.Width, iris$Petal.Length,
iris$Petal.Width)
x- as.matrix(df)
y- as.numeric(iris$Species)
fit = glmnet(x, y, family = multinomial, type.multinomial = grouped)
plot(fit, xvar = lambda, label = TRUE, type.coef = 2norm)
cvfit=cv.glmnet(x, y, family=multinomial, type.multinomial = grouped,
parallel = TRUE)
Error in apply(nz, 1, median) : dim(X) must have a positive length
In addition: Warning message:
from glmnet Fortran code (error code -62); Convergence for 62th lambda
value not reached after maxit=10 iterations; solutions for larger
lambdas returned

Why am I getting this error?

Thanks

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Problems installing Packages

2014-08-08 Thread Luís de Sousa
Dear Sven,

I am running into this exact some problem in Ubuntu 14.04. I have R
3.1.1 freshly installed and OpenJDK 7 (I do not need BLAS, as far as I
know).

Trying to install rj and rj.dg I get the exact same error messages as
you were getting Error: cannot determine complete Java config. Were
you able to solve this and install these packages?

Thank you,

Luís

__
R-help@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.


Re: [R] boot strapping poisson getting warnings and negative values

2014-08-08 Thread Berend Hasselman

On 08-08-2014, at 16:12, K Aravindhan vind1...@yahoo.co.in wrote:

 Dear Team,
 I am getting this error while running the boot-strapping functions. 
 

do you really have to post identical messages within 4 to 5 minutes?
One message is enough and be patient and wait!

Berend

 ==
 mod.db.hub-glm(TOTAL~1+IPD,family=poisson,data=db)
 fit-fitted(mod.db.hub)
 e-residuals(mod.db.hub)
 X-model.matrix(mod.db.hub)
 boot.huber.fixed-function(data,indices,maxit=20) { Y-fit+e[indices]
 mod-glm(Y~X-1,family=poisson,maxit=maxit)
 coefficients(mod)
 }
 library(boot)
 db.fix.boot-boot(db,boot.huber.fixed,2000,maxit=20)
 db.fix.boot
 boot.ci(db.fix.boot,index=1,type=c(bca,perc,poisson))
 boot.ci(db.fix.boot,index=2,type=c(bca,perc,poisson))
 ==
 
 Error in eval(expr, envir, enclos) : 
 negative values not allowed for the 'Poisson' family In addition: Warning 
 messages:
 1: In dpois(y, mu, log = TRUE) : non-integer x = 25.006412
 2: In dpois(y, mu, log = TRUE) : non-integer x = 26.969411
 3: In dpois(y, mu, log = TRUE) : non-integer x = 66.352323
 4: In dpois(y, mu, log = TRUE) : non-integer x = 61.083519
 5: In dpois(y, mu, log = TRUE) : non-integer x = 20.596770
 6: In dpois(y, mu, log = TRUE) : non-integer x = 43.428258
 7: In dpois(y, mu, log = TRUE) : non-integer x = 1108.263554
 8: In dpois(y, mu, log = TRUE) : non-integer x = 61.937982
 9: In dpois(y, mu, log = TRUE) : non-integer x = 419.991213
 10: In dpois(y, mu, log = TRUE) : non-integer x = 47.369133
 
 Can you explain to me how to get rid of these ?
 
 Thanks
 Aravindhan
 
 __
 R-help@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.

__
R-help@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.


Re: [R] dynamic runSum

2014-08-08 Thread Gabor Grothendieck
On Thu, Aug 7, 2014 at 9:32 AM, amarjit chandhial
a.chandh...@btinternet.com wrote:
 Hello,
 runSum calculates a running sum looking back a fixed distance n, e.g. 20.
 How do I calculate a dynamic runSum function for an xts object?
 In
 otherwords, I want to calculate a running sum at each point in time
 looking back a variable distance. In this example, values governed by
 the vector VL.

The width argument in rollapplyr in the zoo package can be a vector.
It can't be NA though so we have used 1 in those cases here and at the
end used na.omit to get rid of the junk at the beginning:

na.omit(rollapplyr(acf1, ifelse(is.na(acf1$VL), 1, acf1$VL), sum))

__
R-help@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.


[R] circlize package: some error message

2014-08-08 Thread Fix Ace
I recently tried to run some sample code from  R package: circlize,
and got an error message (please see below) =  library(circlize)  
circos.genomicInitialize(df)  df = data.frame(name = c(TP53, TP63, 
TP73), + start = c(7565097, 189349205, 3569084),
+ end = c(7590856, 189615068, 3652765),
+ stringsAsFactors = FALSE)  df name start   end
1 TP53   7565097   7590856
2 TP63 189349205 189615068
3 TP73   3569084   3652765  circos.genomicInitialize(df)  circos.clear()  
circos.genomicInitialize(df, major.by = 1) Error in seq.default(xlim[1], 
10^nchar(round(max(x2 - x1 + 1))), by =
major.by) : wrong sign in 'by' argument === And my session information:  
sessionInfo() R version 3.1.1 (2014-07-10)
Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.utf8 
  LC_NUMERIC=C [3] LC_TIME=en_US.utf8LC_COLLATE=C [5] 
LC_MONETARY=en_US.utf8LC_MESSAGES=en_US.utf8 [7] LC_PAPER=en_US.utf8   
LC_NAME=C [9] LC_ADDRESS=C  LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.utf8 LC_IDENTIFICATION=C attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base other 
attached packages:
[1] circlize_0.1.0 loaded via a namespace (and not attached): [1] 
AnnotationDbi_1.26.0Biobase_2.24.0  BiocGenerics_0.10.0 [4] 
DBI_0.2-7   DESeq2_1.4.5GenomeInfoDb_1.0.2 [7] 
GenomicRanges_1.16.3IRanges_1.22.9  RColorBrewer_1.0-5
[10] RSQLite_0.11.4  Rcpp_0.11.2 RcppArmadillo_0.4.320.0
[13] XML_3.98-1.1XVector_0.4.0   annotate_1.42.1
[16] genefilter_1.46.1   geneplotter_1.42.0  grid_3.1.1
[19] lattice_0.20-29 locfit_1.5-9.1  parallel_3.1.1
[22] splines_3.1.1   stats4_3.1.1survival_2.37-7
[25] xtable_1.7-3  ===

Wonder anyone could please help me out with this?

Thank you very much for your time.:)

[[alternative HTML version deleted]]

__
R-help@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.


[R] how to process multiple data files using R loop

2014-08-08 Thread Fix Ace
I have 16 files and would like to check the information of their first two 
lines, what I did: 


 ls(pattern=P_)
 [1] P_3_utr_source_data   P_5_utr_source_data  
 [3] P_exon_per_gene_cds_source_data   P_exon_per_gene_source_data  
 [5] P_exon_source_data    P_first_exon_oncds_source_data   
 [7] P_first_intron_oncds_source_data  P_first_intron_ongene_source_data
 [9] P_firt_exon_ongene_source_data    P_gene_cds_source_data   
[11] P_gene_source_data    P_intron_source_data 
[13] P_last_exon_oncds_source_data P_last_exon_ongene_source_data   
[15] P_last_intron_oncds_source_data   P_last_intron_ongene_source_data 



for(i in ls(pattern=P_)){head(i, 2)}

It obviously does not work since nothing came out

What I would like to see for the output is :

 head(P_3_utr_source_data,2)
  V1
1  1
2  1
 head(P_5_utr_source_data,2)
  V1
1  1
2  1

.

.
.



Could anybody help me with this?

Thank you very much for your time:)
[[alternative HTML version deleted]]

__
R-help@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.


[R] Installing manual package problem

2014-08-08 Thread James Holland
Running R 3.03 on Windows 7

I am trying to install a package from a github repository.

https://github.com/google/glassbox

I downloaded the repository as a zip file, extracted it to get the glassbox
folder and re-zipped it with 7-zip.

I then ran

#-Start code---#

install.packages(C:/Users/jholland/Downloads/glassbox.zip, repos=NULL,
type=source)

#-#

The output message said

Installing package into ‘C:/Users/jholland/Documents/R/win-library/3.0’
(as ‘lib’ is unspecified)

 library(glassbox)
Error in library(glassbox) : ‘glassbox’ is not a valid installed package

I'm not sure what I'm doing wrong.  When I look in the R library folder
(...R/win-library/3.0) I see the glassbox folder there.

I'm new to using packages not from the CRAN list so I'm trying to learn
fast.  I tried some searching and this seems to be what I'm suppossed to
do, but perhaps I need to use dev mode ?

Thank you for the help.

~James

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] how to process multiple data files using R loop

2014-08-08 Thread David Winsemius

On Aug 8, 2014, at 11:25 AM, Fix Ace wrote:

 I have 16 files and would like to check the information of their first two 
 lines, what I did: 
 
 
 ls(pattern=P_)
  [1] P_3_utr_source_data   P_5_utr_source_data  
  [3] P_exon_per_gene_cds_source_data   P_exon_per_gene_source_data  
  [5] P_exon_source_dataP_first_exon_oncds_source_data   
  [7] P_first_intron_oncds_source_data  P_first_intron_ongene_source_data
  [9] P_firt_exon_ongene_source_dataP_gene_cds_source_data   
 [11] P_gene_source_dataP_intron_source_data 
 [13] P_last_exon_oncds_source_data P_last_exon_ongene_source_data   
 [15] P_last_intron_oncds_source_data   P_last_intron_ongene_source_data 
 
 

The results from `ls()` are not actual R names but rather are character 
vectors. To promote a character value to an R language-name you need the 
`get` function:

 
 for(i in ls(pattern=P_)){head(i, 2)}
 

 for(i in ls(pattern=P_)){ head(get(i), 2)}  # Should work.

David.


 It obviously does not work since nothing came out
 
 What I would like to see for the output is :
 
 head(P_3_utr_source_data,2)
   V1
 1  1
 2  1
 head(P_5_utr_source_data,2)
   V1
 1  1
 2  1
 
 .
 
 .
 .
 
 
 
 Could anybody help me with this?
 
 Thank you very much for your time:)
   [[alternative HTML version deleted]]
 
 __
 R-help@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.

David Winsemius
Alameda, CA, USA

__
R-help@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.


Re: [R] how to process multiple data files using R loop

2014-08-08 Thread William Dunlap
  for(i in ls(pattern=P_)){ head(get(i), 2)}  # Should work.

You also need to use print(head(...)) if you want to see the printed
output from each iteration.

Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Fri, Aug 8, 2014 at 4:36 PM, David Winsemius dwinsem...@comcast.net wrote:

 On Aug 8, 2014, at 11:25 AM, Fix Ace wrote:

 I have 16 files and would like to check the information of their first two 
 lines, what I did:


 ls(pattern=P_)
  [1] P_3_utr_source_data   P_5_utr_source_data
  [3] P_exon_per_gene_cds_source_data   P_exon_per_gene_source_data
  [5] P_exon_source_dataP_first_exon_oncds_source_data
  [7] P_first_intron_oncds_source_data  P_first_intron_ongene_source_data
  [9] P_firt_exon_ongene_source_dataP_gene_cds_source_data
 [11] P_gene_source_dataP_intron_source_data
 [13] P_last_exon_oncds_source_data P_last_exon_ongene_source_data
 [15] P_last_intron_oncds_source_data   P_last_intron_ongene_source_data



 The results from `ls()` are not actual R names but rather are character 
 vectors. To promote a character value to an R language-name you need the 
 `get` function:


 for(i in ls(pattern=P_)){head(i, 2)}


  for(i in ls(pattern=P_)){ head(get(i), 2)}  # Should work.

 David.


 It obviously does not work since nothing came out

 What I would like to see for the output is :

 head(P_3_utr_source_data,2)
   V1
 1  1
 2  1
 head(P_5_utr_source_data,2)
   V1
 1  1
 2  1

 .

 .
 .



 Could anybody help me with this?

 Thank you very much for your time:)
   [[alternative HTML version deleted]]

 __
 R-help@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.

 David Winsemius
 Alameda, CA, USA

 __
 R-help@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.

__
R-help@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.


Re: [R] Installing manual package problem

2014-08-08 Thread James Holland
I re-zipped it because when I downloaded from GitHub, it had the actual
glassbox folder within the glassbox-master folder, so I zipped that
glassbox folder because my understanding was the install.package

On Aug 8, 2014, at 1:29 PM, James Holland wrote:

 Running R 3.03 on Windows 7

 I am trying to install a package from a github repository.

 https://github.com/google/glassbox

 I downloaded the repository as a zip file, extracted it to get the
glassbox
 folder and re-zipped it with 7-zip.

Why?


 I then ran

 #-Start code---#

 install.packages(C:/Users/jholland/Downloads/glassbox.zip, repos=NULL,
 type=source)


I'm a Mac user but when I look at the directory created by expanding that
zip file, it appears ready to just move/drag to the library without further
installation. It is, however, not named 'glassbox' but rather
'glassbox-master' so perhaps you forgot to rename it?


 The output message said

 Installing package into ‘C:/Users/jholland/Documents/R/win-library/3.0’
 (as ‘lib’ is unspecified)

 library(glassbox)
 Error in library(glassbox) : ‘glassbox’ is not a valid installed package

 I'm not sure what I'm doing wrong.  When I look in the R library folder
 (...R/win-library/3.0) I see the glassbox folder there.



 I'm new to using packages not from the CRAN list so I'm trying to learn
 fast.  I tried some searching and this seems to be what I'm suppossed to
 do, but perhaps I need to use dev mode ?

 Thank you for the help.

 ~James

   [[alternative HTML version deleted]]

This is a plain text mailing list.

--


David Winsemius
Alameda, CA, USA

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Logical operators and named arguments

2014-08-08 Thread Joshua Wiley
On Sat, Aug 9, 2014 at 9:56 AM, Patrick Burns pbu...@pburns.seanet.com
wrote:

 On 07/08/2014 07:21, Joshua Wiley wrote:

 Hi Ryan,

 It does work, but the *apply family of functions always pass to the first
 argument, so you can specify e2 = , but not e1 =.  For example:

  sapply(1:3, ``, e2 = 2)

 [1] FALSE FALSE  TRUE


 That is not true:


But it is passed as the first argument, not by name, but positionally.  The
reason it works with your gt() is because R with regular functions is
flexible:

 f - function(x, y) x  y
 f(1:3, x = 2)
[1]  TRUE FALSE FALSE

but primitives ARE positionally matched

 ``(1:3, 2)
[1] FALSE FALSE  TRUE
 ``(1:3, e1 = 2)
[1] FALSE FALSE  TRUE




 gt - function(x, y) x  y

  sapply(1:3, gt, y=2)
 [1] FALSE FALSE  TRUE
  sapply(1:3, gt, x=2)
 [1]  TRUE FALSE FALSE

 Specifying the first argument(s) in an apply
 call is a standard way of getting flexibility.

 I'd hazard to guess that the reason the original
 version doesn't work is because `` is Primitive.
 There's speed at the expense of not behaving quite
 the same as typical functions.

 Pat


  From ?sapply


   'lapply' returns a list of the same length as 'X', each element of
   which is the result of applying 'FUN' to the corresponding element
   of 'X'.

 so `` is applied to each element of 1:3

 ``(1, ...)
 ``(2, ...)
 ``(3, ...)

 and if e2 is specified than that is passed

 ``(1, 2)
 ``(2, 2)
 ``(3, 2)

 Further, see ?Ops

 If the members of this group are called as functions, any
argument names are removed to ensure that positional matching
is always used.

 and you can see this at work:

  ``(e1 = 1, e2 = 2)

 [1] FALSE

 ``(e2 = 1, e1 = 2)

 [1] FALSE

 If you want to the flexibility to specify which argument the elements of X
 should be *applied to, use a wrapper:

  sapply(1:3, function(x) ``(x, 2))

 [1] FALSE FALSE  TRUE

 sapply(1:3, function(x) ``(2, x))

 [1]  TRUE FALSE FALSE


 HTH,

 Josh



 On Thu, Aug 7, 2014 at 2:20 PM, Ryan rec...@bwh.harvard.edu wrote:

  Hi,

 I'm wondering why calling  with named arguments doesn't work as
 expected:

  args()

 function (e1, e2)
 NULL

  sapply(c(1,2,3), ``, e2=0)

 [1] TRUE TRUE TRUE

  sapply(c(1,2,3), ``, e1=0)

 [1] TRUE TRUE TRUE

 Shouldn't the latter be FALSE?

 Thanks for any help,
 Ryan


 The information in this e-mail is intended only for th...{{dropped:23}}


 __
 R-help@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.


 --
 Patrick Burns
 pbu...@pburns.seanet.com
 twitter: @burnsstat @portfolioprobe
 http://www.portfolioprobe.com/blog
 http://www.burns-stat.com
 (home of:
  'Impatient R'
  'The R Inferno'
  'Tao Te Programming')




-- 
Joshua F. Wiley
Ph.D. Student, UCLA Department of Psychology
http://joshuawiley.com/
Senior Analyst, Elkhart Group Ltd.
http://elkhartgroup.com
Office: 260.673.5518

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] color palettes

2014-08-08 Thread Jim Lemon
On Fri, 8 Aug 2014 06:26:35 AM carol white wrote:
 Hi,
 Is there any way to take one color of each color family from a color
 palettes like rainbow? For ex, if there are different blues 
differentiated
 by intensity, hue etc, taking one of them. In this case, when using
 rainbow(n), then how to select 1 color of each family, for ex 1 blue, 1 
red
 etc? It doesn't matter which intensity, hue etc is taken as long as 1 
color
 from each family is taken.
 
 
Hi Carol,
Since you have asked a question about a fundamental aspect of 
graphic representation, I'll try to answer it. Be warned, it will be a 
rather discursive answer.

Whenever we try to communicate information about a number of 
things, where the information is different for each thing, it is essential 
to securely link the correct information to each thing. In compact 
graphic representations such as R plots, this usually resolves to labels 
of some sort. So we could construct a pie chart of the number of 
emails sent by each person in the present discourse using the names 
of the people involved. If we simply label each sector of the resulting 
plot with the names of the people, it will be reasonably informative in 
displaying each person's contribution.

If we venture beyond the comfortable pale of the R help list and try to 
do this with something like Twitter, where I understand there may be 
thousands or even millions of contributors on a subject, the pie chart 
blurs into a chromatic dazzle with an unintelligible fringe of names. We 
might try to rescue the situation by aggregating the tweets into a few 
categories such as helpful, sarcastic and noise, but this does not solve 
the problem of how to display the comparative contributions of the 
twits involved.

So one answer to your question of How can I intelligibly label 
hundreds of things with colors? may be You can't unless your 
audience is made up of spectrographs. Plots that attempt to display 
information about too many things using line types, symbol types and 
colors often simply confuse the audience.

My feeling is that it is the responsibility of the person choosing the 
method of communication to make sure that it communicates well. So 
if we want to display something meaningful about the hypothetical 
pandemonium of tweets above, we might choose to display the 
categories (helpful, sarcastic and noise) broken down by the sex of the 
twits. Perhaps in your case you might want to break down the 
functional category of the genes you are examining by the up- or 
down-regulation of those genes in different cell types.

Your question touches things like How many letters should there be in 
the alphabet? and How many acronyms for psychological tests can 
be meaningfully used in a paragraph? At any rate, I thank you for 
giving me an idea about graphic illustration.

Jim

__
R-help@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.


Re: [R] circlize package: some error message

2014-08-08 Thread David Winsemius

On Aug 8, 2014, at 11:28 AM, Fix Ace wrote:

 I recently tried to run some sample code from  R package: circlize,
 and got an error message (please see below) =  library(circlize)  
 circos.genomicInitialize(df)  df = data.frame(name = c(TP53, TP63, 
 TP73), + start = c(7565097, 189349205, 3569084),
 + end = c(7590856, 189615068, 3652765),
 + stringsAsFactors = FALSE)  df name start   end
 1 TP53   7565097   7590856
 2 TP63 189349205 189615068
 3 TP73   3569084   3652765  circos.genomicInitialize(df)  circos.clear()  
 circos.genomicInitialize(df, major.by = 1) Error in seq.default(xlim[1], 
 10^nchar(round(max(x2 - x1 + 1))), by =
 major.by) : wrong sign in 'by' argument === And my session information:  
 sessionInfo() R version 3.1.1 (2014-07-10)
 Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.utf8   
 LC_NUMERIC=C [3] LC_TIME=en_US.utf8LC_COLLATE=C [5] 
 LC_MONETARY=en_US.utf8LC_MESSAGES=en_US.utf8 [7] LC_PAPER=en_US.utf8  
  LC_NAME=C [9] LC_ADDRESS=C  LC_TELEPHONE=C
 [11] LC_MEASUREMENT=en_US.utf8 LC_IDENTIFICATION=C attached base packages:
 [1] stats graphics  grDevices utils datasets  methods   base other 
 attached packages:
 [1] circlize_0.1.0 loaded via a namespace (and not attached): [1] 
 AnnotationDbi_1.26.0Biobase_2.24.0  BiocGenerics_0.10.0 [4] 
 DBI_0.2-7   DESeq2_1.4.5GenomeInfoDb_1.0.2 [7] 
 GenomicRanges_1.16.3IRanges_1.22.9  RColorBrewer_1.0-5
 [10] RSQLite_0.11.4  Rcpp_0.11.2 RcppArmadillo_0.4.320.0
 [13] XML_3.98-1.1XVector_0.4.0   annotate_1.42.1
 [16] genefilter_1.46.1   geneplotter_1.42.0  grid_3.1.1
 [19] lattice_0.20-29 locfit_1.5-9.1  parallel_3.1.1
 [22] splines_3.1.1   stats4_3.1.1survival_2.37-7
 [25] xtable_1.7-3  ===
 
 Wonder anyone could please help me out with this?
 
 Thank you very much for your time.:)
 
   [[alternative HTML version deleted]]

Your failure to post in plain text makes this message very difficult to read. 
Unless there is someone with more patience than I have who responds in the next 
12 hours, you might consider reposting after reading the Posing Guide.

-- 
David Winsemius
Alameda, CA, USA

__
R-help@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.


Re: [R] Installing manual package problem

2014-08-08 Thread David Winsemius

On Aug 8, 2014, at 1:29 PM, James Holland wrote:

 Running R 3.03 on Windows 7
 
 I am trying to install a package from a github repository.
 
 https://github.com/google/glassbox
 
 I downloaded the repository as a zip file, extracted it to get the glassbox
 folder and re-zipped it with 7-zip.

Why?

 
 I then ran
 
 #-Start code---#
 
 install.packages(C:/Users/jholland/Downloads/glassbox.zip, repos=NULL,
 type=source)
 

I'm a Mac user but when I look at the directory created by expanding that zip 
file, it appears ready to just move/drag to the library without further 
installation. It is, however, not named 'glassbox' but rather 'glassbox-master' 
so perhaps you forgot to rename it?

 
 The output message said
 
 Installing package into ‘C:/Users/jholland/Documents/R/win-library/3.0’
 (as ‘lib’ is unspecified)
 
 library(glassbox)
 Error in library(glassbox) : ‘glassbox’ is not a valid installed package
 
 I'm not sure what I'm doing wrong.  When I look in the R library folder
 (...R/win-library/3.0) I see the glassbox folder there.


 
 I'm new to using packages not from the CRAN list so I'm trying to learn
 fast.  I tried some searching and this seems to be what I'm suppossed to
 do, but perhaps I need to use dev mode ?
 
 Thank you for the help.
 
 ~James
 
   [[alternative HTML version deleted]]

This is a plain text mailing list.

-- 


David Winsemius
Alameda, CA, USA

__
R-help@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.


Re: [R] Logical operators and named arguments

2014-08-08 Thread Patrick Burns

On 07/08/2014 07:21, Joshua Wiley wrote:

Hi Ryan,

It does work, but the *apply family of functions always pass to the first
argument, so you can specify e2 = , but not e1 =.  For example:


sapply(1:3, ``, e2 = 2)

[1] FALSE FALSE  TRUE


That is not true:

gt - function(x, y) x  y

 sapply(1:3, gt, y=2)
[1] FALSE FALSE  TRUE
 sapply(1:3, gt, x=2)
[1]  TRUE FALSE FALSE

Specifying the first argument(s) in an apply
call is a standard way of getting flexibility.

I'd hazard to guess that the reason the original
version doesn't work is because `` is Primitive.
There's speed at the expense of not behaving quite
the same as typical functions.

Pat




From ?sapply


  'lapply' returns a list of the same length as 'X', each element of
  which is the result of applying 'FUN' to the corresponding element
  of 'X'.

so `` is applied to each element of 1:3

``(1, ...)
``(2, ...)
``(3, ...)

and if e2 is specified than that is passed

``(1, 2)
``(2, 2)
``(3, 2)

Further, see ?Ops

If the members of this group are called as functions, any
   argument names are removed to ensure that positional matching
   is always used.

and you can see this at work:


``(e1 = 1, e2 = 2)

[1] FALSE

``(e2 = 1, e1 = 2)

[1] FALSE

If you want to the flexibility to specify which argument the elements of X
should be *applied to, use a wrapper:


sapply(1:3, function(x) ``(x, 2))

[1] FALSE FALSE  TRUE

sapply(1:3, function(x) ``(2, x))

[1]  TRUE FALSE FALSE


HTH,

Josh



On Thu, Aug 7, 2014 at 2:20 PM, Ryan rec...@bwh.harvard.edu wrote:


Hi,

I'm wondering why calling  with named arguments doesn't work as
expected:


args()

function (e1, e2)
NULL


sapply(c(1,2,3), ``, e2=0)

[1] TRUE TRUE TRUE


sapply(c(1,2,3), ``, e1=0)

[1] TRUE TRUE TRUE

Shouldn't the latter be FALSE?

Thanks for any help,
Ryan


The information in this e-mail is intended only for th...{{dropped:23}}


__
R-help@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.



--
Patrick Burns
pbu...@pburns.seanet.com
twitter: @burnsstat @portfolioprobe
http://www.portfolioprobe.com/blog
http://www.burns-stat.com
(home of:
 'Impatient R'
 'The R Inferno'
 'Tao Te Programming')

__
R-help@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.


Re: [R] Installing manual package problem

2014-08-08 Thread James Holland
I re-zipped it because when I downloaded from GitHub, it had the actual
glassbox folder within the glassbox-master folder, so I zipped that
glassbox folder because my understanding was the install.package function
only works on zipped files.

And it does seem like it installed within my R library (I see the glassbox
folder in there) but the library function doesn't attach the package.

~James


On Fri, Aug 8, 2014 at 6:50 PM, David Winsemius dwinsem...@comcast.net
wrote:


 On Aug 8, 2014, at 1:29 PM, James Holland wrote:

  Running R 3.03 on Windows 7
 
  I am trying to install a package from a github repository.
 
  https://github.com/google/glassbox
 
  I downloaded the repository as a zip file, extracted it to get the
 glassbox
  folder and re-zipped it with 7-zip.

 Why?

 
  I then ran
 
  #-Start code---#
 
  install.packages(C:/Users/jholland/Downloads/glassbox.zip, repos=NULL,
  type=source)
 

 I'm a Mac user but when I look at the directory created by expanding that
 zip file, it appears ready to just move/drag to the library without further
 installation. It is, however, not named 'glassbox' but rather
 'glassbox-master' so perhaps you forgot to rename it?

 
  The output message said
 
  Installing package into ‘C:/Users/jholland/Documents/R/win-library/3.0’
  (as ‘lib’ is unspecified)
 
  library(glassbox)
  Error in library(glassbox) : ‘glassbox’ is not a valid installed package
 
  I'm not sure what I'm doing wrong.  When I look in the R library folder
  (...R/win-library/3.0) I see the glassbox folder there.


 
  I'm new to using packages not from the CRAN list so I'm trying to learn
  fast.  I tried some searching and this seems to be what I'm suppossed to
  do, but perhaps I need to use dev mode ?
 
  Thank you for the help.
 
  ~James
 
[[alternative HTML version deleted]]

 This is a plain text mailing list.

 --


 David Winsemius
 Alameda, CA, USA



[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Installing manual package problem

2014-08-08 Thread Jeff Newmiller
The obvious suggestion is to not repack the package file.

You should also be sure to read the Posting Guide, which points out that this 
is a plain text mailing list (HTML is not a what-you-see-is-what-we-see format).
---
Jeff NewmillerThe .   .  Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

On August 8, 2014 1:29:14 PM PDT, James Holland holland.ag...@gmail.com wrote:
Running R 3.03 on Windows 7

I am trying to install a package from a github repository.

https://github.com/google/glassbox

I downloaded the repository as a zip file, extracted it to get the
glassbox
folder and re-zipped it with 7-zip.

I then ran

#-Start code---#

install.packages(C:/Users/jholland/Downloads/glassbox.zip,
repos=NULL,
type=source)

#-#

The output message said

Installing package into
���C:/Users/jholland/Documents/R/win-library/3.0���
(as ���lib��� is unspecified)

 library(glassbox)
Error in library(glassbox) : ���glassbox��� is not a valid installed
package

I'm not sure what I'm doing wrong.  When I look in the R library folder
(...R/win-library/3.0) I see the glassbox folder there.

I'm new to using packages not from the CRAN list so I'm trying to learn
fast.  I tried some searching and this seems to be what I'm suppossed
to
do, but perhaps I need to use dev mode ?

Thank you for the help.

~James

   [[alternative HTML version deleted]]





__
R-help@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.

__
R-help@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.


Re: [R] how to process multiple data files using R loop

2014-08-08 Thread Rolf Turner

On 09/08/14 06:25, Fix Ace wrote:

I have 16 files and would like to check the information of their first two 
lines, what I did:



ls(pattern=P_)

  [1] P_3_utr_source_data   P_5_utr_source_data
  [3] P_exon_per_gene_cds_source_data   P_exon_per_gene_source_data
  [5] P_exon_source_dataP_first_exon_oncds_source_data
  [7] P_first_intron_oncds_source_data  P_first_intron_ongene_source_data
  [9] P_firt_exon_ongene_source_dataP_gene_cds_source_data
[11] P_gene_source_dataP_intron_source_data
[13] P_last_exon_oncds_source_data P_last_exon_ongene_source_data
[15] P_last_intron_oncds_source_data   P_last_intron_ongene_source_data


SNIP

Point of order:  You do ***NOT*** have 16 files as it stands.  The 
output from ls() indicates that you have 16 ***objects*** (presumably 
data frames) in your work space or global environment.  (If the data 
were originally in 16 separate files, these files have apparently 
already been read into R.)


If you are going to use R, learn to distinguish the relevant concepts 
and to use the appropriate terminology.  Otherwise you will confuse 
everyone, including yourself, and get things totally wrong.  It is 
really no more difficult to use correct terminology than it is to use 
incorrect terminology --- and the former has the advantage of not 
misleading all concerned.



Dave Winsemius has already told you how to solve your immediate problem, 
using get().


cheers,

Rolf Turner


--
Rolf Turner
Technical Editor ANZJS

__
R-help@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.


[R] grofit package problem inputting dataset

2014-08-08 Thread Fethe, Michael
I've recently wanted to analyze some data sets of growth curves; so, I decided 
to try out the grofit package the dataset inputting gave me some issues.


I've been trying to replicate the example from the grofit package with


R


 foo - ran.data(100, 25)

 time - foo$time
 data - foo$data


 write.csv(file=data.csv, foo)

 sink(file=sink.txt)

 foo

 sink()


also to see if there is another problem I'm missing i've used sink() to see the 
actual output of this data.


The sink call provides a dataframe object, however I'm trying to use my own 
data in this. Is there a way to create the dataframe object in excel (I've 
tried following the example from the write.csv() output).


I know there is a problem with the input method by following the .csv output 
and i could use follow the sink() output to create my data frame object; 
however, I'm not sure about how i would do this with a large dataset with lets 
say 1000 data points. Has anyone ran into this issue and is there a quick work 
around?



the sink() output


$data
  X1 X2 X3   X4   X5   X6   X7  
X8  X9 X10 X11   X12   X13   X14
   X15  X16  X17
1 Test I  A 0.06195419  0.314959772  0.398263408  0.091132317  1.012083039  
0.35122189  1.78719671  2.47453614  3.25305005 3.9829927 5.2863775 5.8576975 
7.2154323 8.501599 8.405278
2 Test I  B 0.09543701  0.441797809 -0.345308045  0.462532336  1.324153423  
1.20722268  1.71422886  2.40135394  2.79558398 3.8981917 5.3614344 5.8423570 
6.8511538 7.192188 8.344946
3 Test I  C 0.16386938 -0.178975999  0.464790443  0.325264753  0.033088580  
0.79395919  0.63525411  1.71685521  2.62738577 2.5209004 4.4535178 4.9102966 
6.8867905 6.996433 7.553863
4 Test I  D 0.14198175  0.100778235 -0.164231759 -0.322266709  0.571067561  
1.24234632  1.54056165  1.96933568  2.97097469 3.7711348 3.8414402 5.2768758 
5.6688960 7.041779 7.651093
5 Test I  E 0.25390711  0.039312093 -0.463351713  0.628339527  0.418403984  
0.56460811  1.26348242  1.56823878  1.93588943 3.3141874 3.0360158 3.7567956 
5.6896075 5.873556 6.524754
6 Test I  F 0.22319304 -0.076464713  0.074501305 -0.160924707  0.384392150  
0.76412340  1.36118116  1.50356468  2.53322106 3.4924520 4.5054475 4.6222326 
5.5347148 6.349000 7.482548
7 Test I  G 0.28095487 -0.728248588  0.479450323  0.542078371  0.757460716  
0.10292177  1.01113655  1.14448036  2.19976257 3.3030023 3.0848547 4.1877661 
5.2832997 5.485825 6.375234
8 Test I  A 0.32135093 -0.036980401 -0.068313544 -0.059620107  0.440995143  
0.48424749  0.65644521  1.38482000  2.05964880 2.2548116 2.6813025 3.5085200 
4.7988415 5.017753 5.405950
9 Test I  B 0.31930456  0.169104577  0.100637447  0.070003632  0.304209263  
1.72301034


...


$time
   [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]  
   [,9][,10][,11][,12][,13][,14][,15][,16][,17] 
   [,18][,19][,20]
  [1,] 1.105562 2.429351 3.303547 4.941900 5.370762 6.939251 7.546835 8.400435 
9.602104 10.85058 11.27732 12.12658 13.80886 14.03953 15.88684 16.63256 
17.85349 18.29452 19.94482 20.74473
  [2,] 1.842357 2.183849 3.528340 4.761010 5.610834 6.473241 7.771216 8.575116 
9.544966 10.79126 11.61007 12.91479 13.21070 14.27869 15.30520 16.32062 
17.71822 18.94936 19.58821 20.46276
  [3,] 1.787510 2.734994 3.063325 4.788528 5.676988 6.096337 7.373838 8.047332 
9.042756 10.35715 11.47604 12.84095 13.14183 14.77351 15.81132 16.63433 
17.37387 18.51372 19.83332 20.74899
  [4,] 1.074662 2.386418 3.734951 4.889867 5.994899 6.483399 7.603956 8.826142 
9.536391 10.01653 11.03079 12.60530 13.00965 14.70169 15.17157 16.75678 
17.85311 18.22975 19.28407 20.73184
  [5,] 1.748113 2.185892 3.236870 4.294671 5.093055 6.910312 7.881226 8.067719 
9.632505 10.26807 11.03523 12.75277 13.66110 14.30814 15.61313 16.62628 
17.98222 18.95378 19.46946 20.17275



the write.csv() output

data.X1 data.X2 data.X3 data.X4 data.X5 data.X6 data.X7 data.X8 data.X9
1   Test I  A   0.061954188 0.314959772 0.398263408 
0.091132317 1.012083039 0.351221894 1.787196715
2   Test I  B   0.095437013 0.441797809 -0.345308045
0.462532336 1.324153423 1.207222678 1.714228858
3   Test I  C   0.16386938  -0.1789759990.464790443 
0.325264753 0.03308858  0.793959194 0.63525411
4   Test I  D   0.141981749 0.100778235 -0.164231759
-0.3222667090.571067561 1.242346317 1.540561647
5   Test I  E   0.253907113 0.039312093 -0.463351713
0.628339527 0.418403984 0.564608113 1.263482418
6   Test I  F   0.223193041 -0.0764647130.074501305 
-0.1609247070.38439215  0.764123401 1.361181159
7   Test I  G   0.280954867 -0.7282485880.479450323 
0.542078371 0.757460716 0.102921772 1.011136548
8