Re: [R] Mistake in German Error message for friedman.test

2013-04-09 Thread P Ehlers
On 2013-04-09 7:35, kais...@med.uni-duesseldorf.de wrote: There are two misspellings in the german Error message for friedman test: Fehler in friedman.test.default(cont$score, group = cont$goup, blocks = cont$cont) : y, Gruppen und blöcke müssen die sekbe Länge haben The correct spellin

Re: [R] Log analysis with R

2013-01-04 Thread P Ehlers
In Canada we use sawmills to process logs. Or we carve them into totem poles. Or we carve dugout canoes. Of course, sometimes we burn them in order to keep warm. Peter Ehlers On 2013-01-04 10:50, peter dalgaard wrote: On Jan 4, 2013, at 18:41 , jim holtman wrote: what type of logs are you tr

Re: [R] Plotmath bug or my misunderstanding?

2012-05-13 Thread P Ehlers
Bert: inline On 2012-05-13 7:43, Bert Gunter wrote: Peter/David: 1. For some reason, I didn't see Peter's reply on r-help. 2. To Peter: Aha!! Let me play this back to you. In text(1,1,labels=expression(atop(atop(sigma,"some text"),"another level")),cex = 2) The (outer) whole atop() specifi

Re: [R] lattice - change background strip color in one panel

2011-05-27 Thread P Ehlers
On 2011-05-27 0:48, Coen van Hasselt wrote: Hello, I would like to change the background color in only -one- of the strips in a multipanel lattice xyplot, from the default yellow-brown color. Until now, I only managed to change the background strip color in all of the strips using the par.settin

Re: [R] Averaging uneven measurements by time with uneven numbers of measurements

2011-05-05 Thread P Ehlers
On 2011-05-05 14:20, Schatzi wrote: I do not want smoothing as the data should have jumps (it is weight left in feeding bunker). I was thinking of maybe using a histogram-like function and then averaging that. Not sure if this is possible. (It would be useful to include your original request -

Re: [R] Using $ accessor in GAM formula

2011-05-05 Thread P Ehlers
Gene, David has given you the preferred code. I just want to point out that the $-accessor is often not the best thing to use. Both dat[["y"]] and dat[, "y"] will work just fine. Peter Ehlers On 2011-05-05 12:06, David Winsemius wrote: On May 5, 2011, at 1:08 PM, Gene Leynes wrote: This is

Re: [R] quantmod's addTA plotting functions

2011-05-05 Thread P Ehlers
already knows the information one is looking for. If you don't know it, the help files are not very helpful. This is a good example. In fact, it's two good examples. I didn't know that I had to look at another page, and I (still) don't know what it means to wrap plot calls in

Re: [R] quantmod's addTA plotting functions

2011-05-05 Thread P Ehlers
On 2011-05-05 0:47, Russ Abbott wrote: Hi, I'm having trouble with quantmod's addTA plotting functions. They seem to work fine when run from the command line. But when run inside a function, only the last one run is visible. Here's an example. test.addTA<- function(from = "2010-06-01") {

Re: [R] na.omit - Is it working properly?

2011-05-03 Thread P Ehlers
Kalicin, Sarah wrote: \begin{quote} I have a work around for this, but can someone explain why the first example does not work properly? I believed it worked in the previous version of R, by selecting just the rows=200525 and omitting the na's. \end{quote} You can prove this statement by providin

Re: [R] UNIX-like "cut" command in R

2011-05-02 Thread P Ehlers
Mike Miller wrote: On Mon, 2 May 2011, Gabor Grothendieck wrote: On Mon, May 2, 2011 at 10:32 PM, Mike Miller wrote: On Tue, 3 May 2011, Andrew Robinson wrote: try substr() OK. Apparently, it allows things like this... substr("abcdef",2,4) [1] "bcd" ...which is like this: echo "abcde

Re: [R] How two compare two matrixes

2011-03-04 Thread P Ehlers
Alaios wrote: That's the problem Even a 10*10 matrix does not fit to the screen (10 columns do not fit in one screen's row) and thus I do not get a well aligned matrix printed. I don't see why you would want to do this, but you could always invoke two instances of R and create one matrix in o

Re: [R] lattice custom axis function -- right side margins

2011-03-03 Thread P Ehlers
Timothy W. Hilton wrote: To clarify the trouble I'm having with ylab.right, I am not getting an error message; the right-side label just does not appear on the plot. Maybe this is mac-specific. On Windows, the label shows up just fine. You might be able to make it appear by adjusting the 'vjust

Re: [R] lattice: How to increase space between ticks and labels of z-axis?

2011-03-03 Thread P Ehlers
Marius Hofert wrote: Dear expeRts, How can I increase the space between the ticks and the labels in the wireframe plot below? I tried some variations with par.settings=list(..) but it just didn't work. Marius, I tried setting the 'distance' parameter, but that was less than satisfactory. On

Re: [R] Creating a weighted sample - Help

2011-03-02 Thread P Ehlers
LouiseS wrote: Hi I'm new to R and most things I want to do I can do but I'm stuck on how to weight a sample. I have had a look through the post but I can't find anything that addresses my specific problem. I am wanting to scale up a sample which has been taken based on a single variable (perf

Re: [R] how to delete empty levels from lattice xyplot

2011-03-02 Thread P Ehlers
Dennis Murphy wrote: Hi: On Wed, Mar 2, 2011 at 1:52 PM, John Smith wrote: Hello All, I try to use the attached code to produce a cross over plot. There are 13 subjects, 7 of them in for/sal group, and 6 of them in sal/for group. But in xyplot, all the subjects are listed in both subgraphs.

Re: [R] transform table to matrix

2011-03-02 Thread P Ehlers
Scott Chamberlain wrote: This thread seems freakishly similar to what you are askingScott Even to the point of including the same typo as well as proof that neither poster bothered to read the posting guide. Great spot, Scott! Peter Ehlers http://tolstoy.newcastle.edu.au/R/help/06/07/3

Re: [R] ls.diag and lsfit very basic question

2011-01-23 Thread P Ehlers
MM wrote: Hello, Is the "std.dev" component of ls.diag( lsfit(x,y) ) the sample standard deviation of the residuals of the fit? I have ls.diag(lsfit(xx,yy))$std.dev different from sd(lsfit(xx,yy)$residuals) where xx and yy are vectors of 5 elements. Compare ls.diag(lsfit(xx,yy))$std

Re: [R] meaning of formula in aggregate function

2011-01-23 Thread P Ehlers
Den wrote: Dear Dennis Thank you very much for your comprehensive reply and for time you've spent dealing with my e-mail. Your kindly explanation made things clearer for me. After your explanation it looks simple. lapply with chosen options takes small part of cycle with same id (eg. df[df$id==

Re: [R] meaning of formula in aggregate function

2011-01-22 Thread P Ehlers
Den wrote: Dear R community Recently, dear Henrique Dallazuanna literally saved me solving one problem on data transformation which follows: (n_, _n, j_, k_ signify numbers) SOURCE DATA: id cycle1 cycle2 cycle3 … cycle_n 1 c c c c 1 m

Re: [R] Surprising behavior using seq()

2010-11-15 Thread P Ehlers
Vadim Patsalo wrote: Patrick and Bert, Thank you both for you replies to my question. I see how my naïve expectations fail to floating point arithmetic. However, I still believe there is an underlying problem. It seems to me that when asked, c(7.7, 7.8, 7.9) %in% seq(4, 8, by=0.1) [1] TRUE

Re: [R] Version 2.12.0 exe file

2010-11-15 Thread P Ehlers
Morris Anglin wrote: I have R version 2.9.1 on my computer and the anlaysis is not working because I need to update to R version 2.12.0 the latest release. The person incharge of IT tried to download R version 2.12.0 but .exe file referenced in install isn't there -What might we be doing

Re: [R] cannot see the y-labels (getting cut-off)

2010-11-15 Thread P Ehlers
jim holtman wrote: increase the margins on the plot: par(mar=c(4,7,2,1)) plot(1:5,y,ylab='',yaxt='n' ); axis(2, at=y, labels=formatC(y,big.mark=",",format="fg"),las=2,cex=0.1); That's what I would do, but if you want to see how cex works, use cex.axis=0.5. Check out ?par. -Peter Ehlers

Re: [R] R package 'np' problems

2010-11-15 Thread P Ehlers
Chris Carleton wrote: Hi List, I'm trying to get a density estimate for a point of interest from an npudens object created for a sample of points. I'm working with 4 variables in total (3 continuous and 1 unordered discrete - the discrete variable is the character column in training.csv). When I

Re: [R] plot options including formatting axes

2010-11-12 Thread P Ehlers
Jannis wrote: Hi Sachin, please read the posting guide and include a reproducible example of what you want to do. For your first question you should have a look at ?axis. Supplying the 'at' argument with the positions of the desired marks and the 'labels' with text strings like '10.000$' sh

Re: [R] unknown dimensions for loglm

2010-11-08 Thread P Ehlers
Jason Hwa wrote: Dear R-help community, I am working with multidimensional contingency tables and I am having trouble getting loglm to run on all dimensions without typing out each dimension. I have generated random data and provided output for the results I want below: d1.c1 <- rnorm(20,

Re: [R] is this matrix symmetric

2010-11-07 Thread P Ehlers
Jun Shen wrote: Hi, I have this symmetric matrix, at least I think so. col1 col2 col3 [1,] 0.20 0.05 0.06 [2,] 0.05 0.10 0.03 [3,] 0.06 0.03 0.08 or structure(c(0.2, 0.05, 0.06, 0.05, 0.1, 0.03, 0.06, 0.03, 0.08 ), .Dim = c(3L, 3L), .Dimnames = list(NULL, c("var1", "var2", "var3"))) B

Re: [R] Axes=F and plotting dual y axes

2010-07-28 Thread P Ehlers
Johnson, Cedrick W. wrote: That worked. Stupid me forgot that I had the stock ticker 'F' assigned in my workspace. Well.. guess I'll hit myself with a 2x4 now.. Thanks for your help guys.. No, don't do that. Instead, calculate how much time you saved by typing 'F' instead of 'FALSE' and how

Re: [R] categorical vs numerical

2009-12-04 Thread P Ehlers
If your group sizes are not too large, I would use jittered stripcharts. They're more informative than boxplots and much less subject to misinterpretation. One warning, I'm not fond of the default pch=0. -Peter Ehlers DispersionMap wrote: What ways are there to plot categorical vs numerical dat

Re: [R] barchart() {Lattice} help.

2009-11-26 Thread P Ehlers
As I wrote earlier: "I had to add the rectangles= and points= arguments to auto.key to get the same key as you had earlier." and the relevant line in the code was: auto.key = list(space = 'right', rectangles=TRUE, points=FALSE) -Peter Ehlers Peng Cai wrote: Hello Peter and David, Thanks f

Re: [R] How to deal with this :" object ' obs' not found.

2009-10-02 Thread P Ehlers
Oops, missed a square bracket: ttx1[order(-ttx1[,"obs"]),] -Peter Ehlers P Ehlers wrote: You don't need to attach. But you do need to mention what kind of object ttx1 is. I had (foolishly) assumed that it was dataframe, but I see that it's a matrix. So try this: tt

Re: [R] How to deal with this :" object ' obs' not found.

2009-10-02 Thread P Ehlers
You don't need to attach. But you do need to mention what kind of object ttx1 is. I had (foolishly) assumed that it was dataframe, but I see that it's a matrix. So try this: ttx1[order(-ttx1[,"obs"),] -Peter Ehlers Hyo Lee wrote: Ok. I just figured out what the problem was. I had to attach()

Re: [R] How to deal with this :" object ' obs' not found.

2009-10-02 Thread P Ehlers
Try sortedx1=ttx1[order(-ttx1$obs),] (and ask yourself where obs lives) -Peter Ehlers Hyo Lee wrote: Hi guys, I need your help. I'm trying to sort the data by the variable "obs". This is how I tried to sort the data below. The problem is, I have a variable name "obs"; this is.. a counter va

Re: [R] how do i retain decimal values

2009-08-02 Thread P Ehlers
You've already been pointed to options(digits=); here's another way: since your data appear to be limited to 2 decimals, why not select your noise from UNIF(0, 0.001)? More importantly, are you really trying to do correlation between the values you're showing us? What do you hope to learn from su

Re: [R] data structure with coefficients, and call from lm()

2007-10-01 Thread P Ehlers
John, Jim has shown how to accomplish what you want. Here's a slight variation (for a single model): y <- rnorm(20) x <- runif(20) z <- runif(20) fm <- lm(y ~ x + z) m <- cbind(NA, coef(summary(fm))) colnames(m)[1] <- deparse(formula(fm)) print(m, na.print = "") - Peter Ehlers jim holtman wr

Re: [R] Shapiro-Welch W value interpretation

2007-09-30 Thread P Ehlers
Omar Baqueiro wrote: > Hello, > > I have tested a distribution for normality using the Shapiro-Welch > statistic. The result of this is the following: > > > Shapiro-Wilk normality test > > data: mydata > W = 0.9989, p-value = 0.8791 > > > I know that the p-value > 0.05 (for my purpos

Re: [R] Arrows Pointing to Curve

2007-09-27 Thread P Ehlers
You might also look at ?Arrows in package IDPmisc and ?p.arrows in package sfsmisc. - Peter Ehlers > --- Lorenzo Isella <[EMAIL PROTECTED]> wrote: > >> Dear All, >> I hope this is not a FAQ, but my online research was >> not fruitful. >> Consider a standard 2D plot generated with the >> "plot

Re: [R] Legend

2007-09-26 Thread P Ehlers
How about a <- .33 b <- .55 legend("bottom", fill=c("red","blue"), legend=c(bquote(p == .(a)), bquote(p == .(b))), bty="n") or look at ?substitute - Peter Ehlers stat stat wrote: > I have following syntax for putting a legend : > > legend("bottom", fill=c("red","blue"), legend=expression(

Re: [R] Plotting numbers at a specified decimal length on a plot()

2007-09-23 Thread P Ehlers
I find sprintf() useful for this. Compare lab <- rnorm(8) plot(1:10) text(2:9, 2:9, lab) with lab2 <- sprintf("%4.2f", lab) plot(1:10) text(2:9, 2:9, lab2) - Peter Ehlers Matthew Dubins wrote: > Hi there, > > I want to figure out how to plot means, with 2 decimal places, of any Y > variable

Re: [R] Plotmath issue superscript "-"

2007-09-20 Thread P Ehlers
Yes, sorry, I should have said that I was on Windows. In a UTF-8 locale, you could try \u2013 in place of \x96. The character is an endash. Peter Ehlers Scionforbai wrote: > Hallo, > >> If you need a subscript as well, I like >> >> plot(0, main=quote({NO^'\x96'}[3])) > > > I tried this but I

Re: [R] Plotmath issue superscript "-"

2007-09-20 Thread P Ehlers
If you need a subscript as well, I like plot(0, main=quote({NO^'\x96'}[3])) Peter Ehlers Peter Dalgaard wrote: > Gavin Simpson wrote: >> Dear List, >> >> I'm trying to typeset some chemical ions in axis labels. These have both >> super and subscript components, and for some, I need a superscri

Re: [R] MAD

2007-09-18 Thread P Ehlers
If you read ?mad you will find this phrase: "median of the absolute deviations from the median" Note the first word. I think you're too focused on the last word. Peter Ehlers Nair, Murlidharan T wrote: > > -Original Message- > From: Deepayan Sarkar [mailto:[EMAIL PROTECTED] > Sent: Mo