Re: [R] Comparing values of different columns: Error: level sets of factors are different

2014-10-17 Thread David Winsemius
On Oct 17, 2014, at 1:21 PM, Chichi Shu wrote: > Hi, R listers, > I¡¯m trying to compare a value of a row in a column to values of previous > rows in another column in a loop. ¡°i¡± is just from first row to the last > row. j is an another looping controller indicating the rows that row[i] will

[R] Comparing values of different columns: Error: level sets of factors are different

2014-10-17 Thread Chichi Shu
Hi, R listers, I��m trying to compare a value of a row in a column to values of previous rows in another column in a loop. ��i�� is just from first row to the last row. j is an another looping controller indicating the rows that row[i] will be compared to and j will be rows before row[i]. I want

Re: [R] [survMisc]: error message in examples of comp()

2014-10-17 Thread William Dunlap
If you execute the command options(useFancyQuotes=FALSE) before calling comp(s1) that error should go away. dQuote() was being used inappropriately - its value depends on the option "useFancyQuotes" so should really only be used for messages or text that machines don't have to parse. Bill Dunla

Re: [R] [survMisc]: error message in examples of comp()

2014-10-17 Thread David Winsemius
On Oct 17, 2014, at 1:39 PM, Gerrit Eichner wrote: > Hello, list members, > > I have tried to contact the maintainer of the survMisc package, but my > message could not be delivered. I can't get survMisc package to work as > expected or documented, respectively. Maybe one of you has an idea re

[R] [survMisc]: error message in examples of comp()

2014-10-17 Thread Gerrit Eichner
Hello, list members, I have tried to contact the maintainer of the survMisc package, but my message could not be delivered. I can't get survMisc package to work as expected or documented, respectively. Maybe one of you has an idea regarding the following problem: When, e.g., trying to execut

[R] Microsoft fighting against cxxfunction() and winning

2014-10-17 Thread Rainer K. SACHS
Running Windows 7, 64 bit (but also including, I think, 32 bit R files) RStudio 0.98.501 win-library 3.1 Getting error messages, probably related to add_path, for the following example script; I did look within RStudio and on the internet but can't understand the errors, let alone fix them, so any

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

2014-10-17 Thread JLucke
The distribution of the statistic $ndf * r^2 / (1-r^2)$ with the true value $\rho = zero$ follows an $F(1,ndf)$ distribution. So the t-test is the correct test for $\rho=0$. Fisher's z is an asymptotically normal transformation for any value of $\rho$. Thus Fisher's z is better for testing $

Re: [R] {car} outlierTest looses p/q values

2014-10-17 Thread John Fox
Dear Phil, Yes, that's a bit clearer. One can invent data configurations where certain studentized residuals are undefined. For example, try the following: y <- c(0, 0, 0, 0, 0, 1) x <- 1:6 xx <- (1:6 - 3.5)^2 rstudent(lm(y ~ x)) rstudent(lm(y ~ xx)) plot(x, y) plot(xx, y) The plots should clar

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

2014-10-17 Thread David Winsemius
On Oct 17, 2014, at 1:06 AM, PO SU wrote: > > Tks for your alternative way's details. but like you mentioned in graphics > package, i still wonder how to overload an operator which can pass one param > like +2 . > There seems exists some examples for my needing. But i try to find them but > w

Re: [R] assigning letter to a column

2014-10-17 Thread Monaly Mistry
Thank you for your help David, will make sure to check the documentation. Best, Monaly On Fri, Oct 17, 2014 at 3:27 PM, David L Carlson wrote: > Minor correction, given your code, values less than 3 will be coded as "S" > since they are less than 15.23. In the code I suggested, values less tha

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

2014-10-17 Thread Greg Snow
You may be interested in looking at Reference Classes/objects (see ?setRefClass). This is a form of OO programming that is more similar to C++ and Java. You could create a counter object that you could then increment with syntax like: x$inc() x$inc(5) The first would increment by the default (1

Re: [R] {car} outlierTest looses p/q values

2014-10-17 Thread John Fox
Dear Phil, After reading your posting several times, I still don't understand what you did. As usual, having a reproducible example illustrating the error would be a great help. I do have a guess about the source of the error: glm() failed in some way for the problematic case. Best, John ---

Re: [R] assigning letter to a column

2014-10-17 Thread David L Carlson
Minor correction, given your code, values less than 3 will be coded as "S" since they are less than 15.23. In the code I suggested, values less than 3 will be coded as missing (NA). David C -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On B

Re: [R] assigning letter to a column

2014-10-17 Thread David L Carlson
I think it is doing exactly what you have told it to do, but that is probably not what you want it to do. First, you do not need a loop since the ifelse() function is vectorized. Read the manual page and the examples carefully. Also you are coding ifelse() as if it were the same as if() {} else

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

2014-10-17 Thread Jeff Newmiller
As the Posting Guide indicates, this is a text-only mailing list, and small, reproducible (self-contained) examples of R code are expected. You are not getting much response because what you sent is not what we see, and we cannot tweak code you do not share. -

[R] assigning letter to a column

2014-10-17 Thread Monaly Mistry
Hi, I'm having trouble with assigning a letter to a column based on the value of another column. Since I have separate data files I've saved then into one folder and I'm reading them in separately into the function. The code is below. #F= fast; S= slow; I1= Intermediate score 1; I2=Intermediate

Re: [R] need help for error "incompatible dimensions"

2014-10-17 Thread PIKAL Petr
Hi Your .R attachment did not come through. Included txt file did not have headers. Maybe you just want cor(whatever is the name of your numeric object) Cheers Petr > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Swapnil

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

2014-10-17 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] how to overwrite a Unary operator ?

2014-10-17 Thread PO SU
Tks for your alternative way's details. but like you mentioned in graphics package, i still wonder how to overload an operator which can pass one param like +2 . There seems exists some examples for my needing. But i try to find them but without any results. can you show me some examples from i

[R] need help for error "incompatible dimensions"

2014-10-17 Thread Swapnil Khobragade
Hello, I m R user trying to map and find correlation between two entities i.e. time and usability of cup from log file, but its showing error while compilation. Is there any specific package(s) by means of which I can effectively run the code meant for different dimensions computation?

[R] {car} outlierTest looses p/q values

2014-10-17 Thread Phil
Hi guys, I came across a strange phenomena and can't figure out why it happens by myself so here we go. I got a dataframe which consists of double numbers which I want to check, row-wise if there are outliers in the rows. So I iterate over the rows and create a glm using the numbers of that

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

2014-10-17 Thread peter dalgaard
This is pretty much standard. I'm quite sure that other stats packages do likewise and I wouldn't know who "everyone" is. It is not unheard of that textbook authors give suboptimal formulas in order not to confuse students, though. The basic point is that the t transformation gives the exact di

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

2014-10-17 Thread Benno Pütz
On 17 Oct 2014, at 06:29, PO SU wrote: > e.g. 2++ will let 2 be 3 That would not even work in C ... While I use this in C, I second Rolf on the general issue. Benno__ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

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

2014-10-17 Thread David Winsemius
On Oct 16, 2014, at 10:36 PM, PO SU wrote: Tks for your advice, let the ++ problem alone, how to write an Unary operator ? Is it permitted in R? suchasa<-2 , a%+2% will let a be 4 . OK, that's just wrong. Oh, OK, just for fun, as it were: inc <- function(x) { eval.parent(subs