Kumar Mainali | 9 Oct 07:15 2015

Help with color.scale {plotrix}

Hi Jim and others:

I needed color code for some color gradients in color.scale function. I
found that the following translates to green to yellow to
red: c(0,1,1),c(1,1,0),0. How does this string translate to the color
gradient? I would like to know the gradient code for red to yellow, yellow
to green and other ranges.

Kumar Mainali

Postdoctoral Associate
Department of Biology
University of Maryland, College Park

	[[alternative HTML version deleted]]

Curtis Browne | 9 Oct 01:37 2015

Help using "replicate()" for two commands

I would like to essentially do a randomization p-test (10,000 replications in this case) to check how often
I would see a linear correlation in my data as strong or stronger than I did with the original data (with a
correlation value of 0.9796619). The code which I thought would work is below:

sum(replicate(10000,data$Scram <- sample(data$Changeinmass,10, replace = FALSE); with(data,cor(Current,data$Scram))>=0.9796619))/10000

With the error:

Error: unexpected ';' in "sum(replicate(10000,data$Scram <- sample(data$Changeinmass,10, replace = FALSE);"

Is there any method of replicating both the function of assigning a random sample of the data to a column, and
the function of then performing a Pearson correlation test between data$Current and data$Scram?

	[[alternative HTML version deleted]]

David Winsemius | 9 Oct 03:07 2015

Re: regex - extracting 2 numbers and " from strings

On Oct 8, 2015, at 4:50 PM, Omar André Gonzáles Díaz wrote:

> David, it does work but not in all cases:

It should work if you change the "+" to  "*" in the last capture class. It makes trailing non-digit characters
entirely optional.

> sub("(^.+ )(\\d+)([\"]|[']{2})(.*$)", "\\2\\3", b)
 [1] "40''" "40''" "49\"" "49\"" "28\"" "40\"" "32''" "32''" "40\"" "55\""
[11] "40\"" "24\"" "42''" "50\"" "48\"" "48\"" "48\"" "48''" "50\"" "50''"
[21] "50\"" "55\"" "55''" "55\"" "55''" "55\"" "65''" "65\"" "65''" "75\""

Moral of the story: Always post an example with the necessary complexity.
> This is now my b vector, after your solution:
> b <- c("40''", "40''", "49\"", "49\"", "HAIER TELEVISOR LED LE28F6600 28\"", 
> "40\"", "32''", "32''", "40\"", "55\"", "HAIER TV LED LE40B8000 FULL HD 40\"", 
> "24\"", "42''", "HAIER TELEVISOR LED LE50K5000N 50\"", "48\"", 
> "48\"", "48\"", "48''", "50\"", "50''", "50\"", "55\"", "55''", 
> "55\"", "55''", "55\"", "65''", "SAMSUNG SMART TV 65JU6500 LED UHD 65\"", 
> "65''", "75\"")
> 2015-10-08 18:14 GMT-05:00 David Winsemius <dwinsemius <at> comcast.net>:
> On Oct 8, 2015, at 3:45 PM, Omar André Gonzáles Díaz wrote:
> > Hi I have a vector of 100 elementos like this ones:
> >
(Continue reading)


regex - extracting 2 numbers and " from strings

Hi I have a vector of 100 elementos like this ones:

a <- c("SMART TV LCD FHD 70\" LC70LE660", "LED FULL HD 58'' LE58D3140")

I want to put just the (70\") and (58'') in a vector b.

This is my try, but is not working:

b <- grepl('^[0-9]{2}""$',a)

Any hint is welcome, thanks.

	[[alternative HTML version deleted]]

bgnumis bgnum | 8 Oct 22:07 2015

Smoth matplot

   Hi all,

I have a matrix data and I use to plot matplot, it is suposed each column
is a temporal series. As you see in the example the matrix o data have
"peaks" I want to plot (using matplot or what yoy can say me) this matrix
but with and smoothed line envoloving the values of the matrix so when
plotted all the appearce of the lines will be smoth bell. Do you think is
it possible.

Can anyone suggest to make a tranform?

Could be smotthing the lines plotted (columns) will be achieved but not
suere if it is possible.

       [,1]      [,2]      [,3]      [,4]     [,5]      [,6]      [,7]
[1,] 100.00000 100.00000 100.00000 100.00000 100.0000 100.00000 100.00000
[2,] 100.54163  99.23893 100.77238  98.95058 100.2250  99.18830 100.18801
[3,]  99.61230 102.12813  99.34499  97.52805 101.8252  99.97846  95.91478
[4,] 102.04546 100.38053 100.80122 100.10281 100.4912  98.04112 101.17684
[5,]  97.27201 100.19247 100.43301 101.04954 102.9921  98.25110  98.31890
[6,] 103.68170 104.95366  99.03839  99.81437 100.7232 102.47300  99.17555
[1,] 100.00000
[2,] 101.10791
[3,] 102.90392
[4,] 100.16137
[5,] 100.98710
[6,]  99.09212

	[[alternative HTML version deleted]]
(Continue reading)

Kishor Tappita | 8 Oct 20:59 2015

Re: rpart cutpoint interpretation

Thank you so much for the clarification Terry.

On Thu, Oct 8, 2015 at 6:03 PM, Therneau, Terry M., Ph.D. <therneau <at> mayo.edu
> wrote:

> The cutpoint is on the predictor, so the interpretation is the same as it
> is for any other rpart model.  The subjects with predictor < cutpoint form
> one group and those > cutpoint the other.  The cutpoint is chosen to give
> the greatest difference in "average y" between the groups.  For poisson
> "averge y" is an event rate.
> On 10/08/2015 05:00 AM, r-help-request <at> r-project.org wrote:
>> I am trying to derive cutpoint/threshold with a poisson distributed
>> dependent variable. I know how to interpret cutpoint with binary dependent
>> variable based on direction. Can some on help me to intrepret cutpoint for
>> poisson case with one independent variable with the derived threshold.

	[[alternative HTML version deleted]]

Dawn | 8 Oct 19:32 2015

can't install DESEq2 on Mac


I can't install DESEq2 on my iMac, as follows:

> source("http://bioconductor.org/biocLite.R")
Bioconductor version 3.1 (BiocInstaller 1.18.4), ?biocLite for help
> biocLite("DESeq2")
BioC_mirror: http://bioconductor.org
Using Bioconductor version 3.1 (BiocInstaller 1.18.4), R version 3.2.2.
Installing package(s) ‘DESeq2’
Error: Line starting '<!DOCTYPE HTML PUBLI ...' is malformed!

Can you please help that? Thank you!

	[[alternative HTML version deleted]]

R-help <at> r-project.org mailing list -- To UNSUBSCRIBE and more, see
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Michael Ashton | 8 Oct 18:49 2015

Attaching a pdf file to an email generated with sendmailR?

For some time I have been using sendmailR to generate a simple message when a report was done running.

Recently, I started adding a couple of pertinent statistics in the body of the email.

Now, I've finally decided that what the heck, I ought to simply attach the report itself to the email. The
report is generated as a pdf file.

I can't seem to get this to work in any simple way with mime_part; if I specify a path to the file it simply
assumes that "P:/blablabla/thefile.pdf" is a message I want to put in a text file attachment.

I assume I am doing something incorrectly and likely something simple. But maybe there is a clever trick I am
missing. My send line is simply:


where body is something like this:

body <- list("Here's your stupid file",mime_part(x="P:/partofpath/ thefile.pdf",name="file.pdf"))

Any suggestions are welcome!



This email and any attachments are confidential and inte...{{dropped:9}}

Luca Meyer | 8 Oct 20:06 2015

How to remove the grid around the plot(ca(...)) function?

Hello R-experts,

Could anyone suggest how I can remove the grid coming out of the
plot(ca(...)) function?

For instance I have:

v1 <- c(10,15,20,15,25)
v2 <- c(23,4,7,12,2)
v3 <- c(10,70,2,3,7)
d1 <- data.frame(v1,v2,v3)
rownames(d1) <- c("B1","B2","B3","B4","B5")
plot(ca(d1), mass = c(TRUE,FALSE), xlab="", ylab="")

As you can I could remove the X and Y axis label, but basically I am
looking for a chart containing only the data points - with relative inertia
represented by their size - and labels with no extra lines or number, any
clue on how I can do that?

Thank you,


	[[alternative HTML version deleted]]

Yongnam Kim | 8 Oct 16:20 2015

suppress to bring value label with spss.system.file

Hello all,

I know how to suppress to bring value labels from SPSS when importing sav
file using foreign package by "use.value.labels = FALSE" in read.spss
function. But, I don't know how to do the same thing when using memisc pkg,
in particular, with the spss.system.file function.

Many thanks!

	[[alternative HTML version deleted]]

Сергей С. | 8 Oct 17:05 2015

​ use of PPML (Poisson Pseudo Maximum Likelihood)

Dear Colleagues!

We use R for research. We would like to perform calculations (gravity model
of trade) with the
use of PPML (Poisson Pseudo Maximum Likelihood).

Please explain:

1. What package in R enables us to make calculations in accordance with the

We used the command

with the parameter


Does this command procedure PPML? If not, then what command allows us to
use PPML?

2. For calculations using a linear model the quality factor is R^2. What is
the analogue of this indicator for PPML in system R?

Thank you very much in advance!

	[[alternative HTML version deleted]]

(Continue reading)