Re: [R] how to overwrite a Unary operator ?

2014-10-16 Thread PO SU
Tks for your advice,  let the ++ problem alone, how to write an Unary operator ? Is it permitted in R? suchas    a<-2 , a%+2%  will let a  be 4 . I just want to know it , i won't pollute r with it , because i know what is r .  : ) -- PO SU mail: desolato...@163.com Majored in Stati

[R] Making a very specific heatmap in R (ggplot2?)

2014-10-16 Thread Alexander Predeus
Hello All, I'm trying to figure out the (automated) way to generate heatmaps from simple data tables with annotated rows and columns. In the end, I need these files to be easily viewed in a browser. The initial data tables are simple; numbers are row-normalized (values are real numbers varying fr

Re: [R] how to overwrite a Unary operator ?

2014-10-16 Thread Rolf Turner
On 17/10/14 17:29, PO SU wrote: Dear expeRts, Now i want to know how to implement an Unary operator like i++ in cpp's synax form. e.g. 2++ will let 2 be 3 , a<-2 ,a++ ,will let a be 3 I tried this : '%++%'<-function(x){ x<<-x+1 } but it have problem, the biggest one is it seem

[R] how to overwrite a Unary operator ?

2014-10-16 Thread PO SU
Dear expeRts,   Now i want to know how to implement an Unary operator like  i++ in cpp's   synax form.   e.g.   2++  will let 2 be 3 ,  a<-2 ,a++ ,will let a be 3 I tried this :  '%++%'<-function(x){    x<<-x+1 } but it have problem, the biggest one is   it seems  the function need two params lik

Re: [R] Difference betweeen cor.test() and formula everyone says to use

2014-10-16 Thread Joshua Wiley
Hi Jeremy, I don't know about references, but this around. See for example: http://afni.nimh.nih.gov/sscc/gangc/tr.html the relevant line in cor.test is: STATISTIC <- c(t = sqrt(df) * r/sqrt(1 - r^2)) You can convert *t*s to *r*s and vice versa. Best, Josh On Fri, Oct 17, 2014 at 10:32 AM

[R] Difference betweeen cor.test() and formula everyone says to use

2014-10-16 Thread Jeremy Miles
I'm trying to understand how cor.test() is calculating the p-value of a correlation. It gives a p-value based on t, but every text I've ever seen gives the calculation based on z. For example: > data(cars) > with(cars[1:10, ], cor.test(speed, dist)) Pearson's product-moment correlation data: sp

Re: [R] HELP

2014-10-16 Thread Rolf Turner
On 17/10/14 09:01, Greg Snow wrote: I think we have a fortune candidate. Second the nomination! cheers, Rolf On Thu, Oct 16, 2014 at 12:35 AM, PIKAL Petr wrote: Hi It will be even worse with age, try to contact optician :-) If you want to get better answer you need to provide more info

Re: [R] Time outside limits

2014-10-16 Thread Clint Bowman
?rle Clint BowmanINTERNET: cl...@ecy.wa.gov Air Quality Modeler INTERNET: cl...@math.utah.edu Department of Ecology VOICE: (360) 407-6815 PO Box 47600FAX:(360) 407-7534 Olympia, WA 98504-7600 U

Re: [R] HELP

2014-10-16 Thread Greg Snow
I think we have a fortune candidate. On Thu, Oct 16, 2014 at 12:35 AM, PIKAL Petr wrote: > Hi > > It will be even worse with age, try to contact optician :-) > > If you want to get better answer you need to provide more info about your > file, what you did and how it failed. > > Cheers > Petr >

Re: [R] understanding the no-label concept

2014-10-16 Thread moonkid
> aa <- 1:5 > names(aa) <- c("Eins", "Zwei", "Drei", "Vier", "Fünf") > aa Eins Zwei Drei Vier Fünf 12345 > table(aa) 1 2 3 4 5 1 1 1 1 1 You see? It didn't work. > aa <- c(aa, 1, 2) > aa Eins Zwei Drei Vier Fünf 1234512 This is no solution for my cas

Re: [R] understanding the no-label concept

2014-10-16 Thread moonkid
On 2014-10-11 15:14 William Dunlap wrote: > You can use 'factors' to assign labels to small integer values. E.g., >> x <- c(1,2,3,4,3) >> fx <- factor(x, levels=1:5, >> labels=c("One","Two","Three","Four","Five")) table(fx) >fx > One Two Three Four Five >1 1

Re: [R] understanding the no-label concept

2014-10-16 Thread moonkid
On 2014-10-11 14:16 David Winsemius wrote: > Hmisc... Tried but has no effect on table() calls. __ 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.ht

Re: [R] Help for i-else iwth more than one alternative

2014-10-16 Thread MacQueen, Don
If I understand what you¹re trying to do, then I believe this will do the same as your little loop: opt.fc <- fc opt.fc[rmax < 0.1] <- fc1[rmax < 0.1] (this is an example of vectorization, and it¹s fundamental to how R works and the power of R) Then to extend it, use the same method opt.f

Re: [R] Time outside limits

2014-10-16 Thread daniel
Bart, Check if the following could help you. library(xts) y <- c(rnorm(10,25), rnorm(10,32),rnorm(10,25), rnorm(10,20), rnorm(10,25)); x <- seq(c(ISOdate(2000,3,20)), by = "hour", length.out = length(y)) z <- xts( y, order.by=as.POSIXct(x)) limit <- ifelse( lag(z) < 22 | z > 27, 1, 0) Daniel Me

[R] Time outside limits

2014-10-16 Thread Bart Joosen
Hi, I'm currently facing the problem that I need to write a function where I get a dataframe back which contains the time (in hours) outside the limits of a temperature sensor, each month, and for how long exactly. I wrote a for loop which check:- if a datapoint is outside the limit- if the prev

[R] Help for i-else iwth more than one alternative

2014-10-16 Thread moeby
I try to run an if-else command line where the else argument should be the corresponding value of the pmax command. # #opt.fc is the optimal forecast #rmax is the vector of the maximized r squared from pmax-command of 2 data sets containing r squares #fc1 are the estimates of

Re: [R] package installation failure virtualisation environment

2014-10-16 Thread William Dunlap
The log files may not have the name of the process ("R"), but only its process number. A good way to look at the log files in /var/log is to cause your 'Kill' problem then use 'ls -lstA' or 'ls -lstrA' in /var/log to see which ones changed recently. Bill Dunlap TIBCO Software wdunlap tibco.com O

[R] Job Opening - PhD Discovery Statistician at Cambridge, MA

2014-10-16 Thread Liu, Ray
To all: We have an immediate opening for one PhD statistician in the Analytical Innovation and Consultation group at Cambridge MA site. This group provides statistical project support and consultation services to Takeda's discovery, manufacturing, translational research, phase I clinical trial

[R] ggplot: Stacked bar/pie chart - Objects above the bar/pie

2014-10-16 Thread Gunnar Oehmichen
Hello, I would like to draw a circle on top of a pie chart (The plot does not need to fullfill scientific standards). The circle represents the relation of a reference-value in comparison to the summed values of the pie-pieces. To be able to do this I partly followed: http://rpubs.com/RobinLovelac

Re: [R] Retrieving lists of colnames

2014-10-16 Thread Vikash Kumar
Hi, It works! Only one thing we need to note is when we have only one column name as an output we do not get the results. > d=c(11:21) > e=c(51:61) > data<-data.frame(embed(1:12,2)) > data=cbind(data,d,e) > data>6 X1 X2 d e [1,] FALSE FALSE TRUE TRUE [2,] FALSE FA

Re: [R] how to loop through dataframe objects in environment

2014-10-16 Thread Jeff Newmiller
This advice works best when you use the lapply function to load your data frames to begin with. That way your like-structured data frames are grouped into one list that you can loop through without complicated use of get and assign. dtadir <- "mydatadir" fnames <- list.files( dtadir ) dtalist <

Re: [R] Retrieving lists of colnames

2014-10-16 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Vikash Kumar > Sent: Thursday, October 16, 2014 7:06 AM > To: adam.n.jenkin...@gmail.com > Cc: r-help@r-project.org > Subject: Re: [R] Retrieving lists of colnames > > Hi Adam

Re: [R] package installation failure virtualisation environment

2014-10-16 Thread rl
On 2014-10-15 15:36, William Dunlap wrote: Have you looked at recent entries in the system log files in /var/log, especially /var/log/kern.log? No such log file exist and other files in the directory do not make reference to R and any general errors (e.g. internet access). __

Re: [R] package installation failure virtualisation environment

2014-10-16 Thread rl
On 2014-10-15 09:13, Sven E. Templer wrote: did you check the connection in R via for example: head(readLines("http://cran.r-project.org/web/licenses/GPL-3";)) which should yield: [1] "GNU GENERAL PUBLIC LICENSE" [2] " Version 3, 29 June 2007" [3] "" [