[R] Difference between drop1() vs. anova() for Gaussian glm models

2015-07-20 Thread Karl Ove Hufthammer
graphics grDevices utils datasets [6] methods base loaded via a namespace (and not attached): [1] tools_3.2.1 -- Karl Ove Hufthammer E-mail: k...@huftis.org Jabber: huf...@jabber.no __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more

Re: [R] Border width on symbols plotted with the lattice package

2013-02-10 Thread Karl Ove Hufthammer
ilai skreiv: Like this ? xyplot(4:5~4:5, groups=4:5, lex = 5 , par.settings = simpleTheme(cex=10, pch=21, lwd=5), auto.key=TRUE) Thanks, both David and ilai. The ‘lex’ solution seems to work very well. -- Karl Ove Hufthammer E-mail: k...@huftis.org Jabber: huf...@jabber.no

[R] Border width on symbols plotted with the lattice package

2013-02-08 Thread Karl Ove Hufthammer
' correctly applied. How can I fix this? Or is it simply a bug in the 'lattice' package? Karl Ove Hufthammer Output of 'sessionInfo()': R version 2.15.2 (2012-10-26) Platform: x86_64-w64-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=Norwegian-Nynorsk_Norway.1252 [2] LC_CTYPE=Norwegian

Re: [R] Tukey HSD plot with lines indicating (non-)significance

2013-01-15 Thread Karl Ove Hufthammer
, position=position_jitter(width=.1)) + geom_segment(aes(x=lstart, xend=lend, y=y, yend=y, linetype=nodraw), lindat) -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] Tukey HSD plot with lines indicating (non-)significance

2013-01-15 Thread Karl Ove Hufthammer
Thanks for the suggested code! It’s a very nice way of displaying most aspects of the data and the HSD tests/CIs. The graphical display is probably to big for inclusion in journal articles, but works well for displaying the results when working with the data. Regards, Karl Ove Hufthammer ty

Re: [R] Sparse dataframes?

2013-01-15 Thread Karl Ove Hufthammer
-- Karl Ove Hufthammer E-mail: k...@huftis.org Jabber: huf...@jabber.no __ 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

[R] Tukey HSD plot with lines indicating (non-)significance

2013-01-14 Thread Karl Ove Hufthammer
)) Is there such a function available in R? -- Karl Ove Hufthammer __ 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

Re: [R] Tukey HSD plot with lines indicating (non-)significance

2013-01-14 Thread Karl Ove Hufthammer
(trt = Tukey)) plot(l.mmc) (It looks best on data where the group means aren’t very close; otherwise the labels might overlap.) -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] POSIXlt and daylight savings time

2012-09-05 Thread Karl Ove Hufthammer
:00:00 in your local timezone, so you’re trying to specifiy a point in time that just didn’t exist. If you really want to do this, use the UTC timezone, by setting the ‘tz’ argument in as.POSIXct/as.POSIXlt to UTC (or GMT). -- Karl Ove Hufthammer E-mail: k...@huftis.org Jabber: huf...@jabber.no

[R] Parameter scaling problems with optim and Nelder-Mead method (bug?)

2012-08-18 Thread Karl Ove Hufthammer
] stats graphics grDevices utils datasets methods base -- Karl Ove Hufthammer __ 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

Re: [R] Parameter scaling problems with optim and Nelder-Mead method (bug?)

2012-08-18 Thread Karl Ove Hufthammer
on the values chosen for later iterations, while their (absolute) values seems to have *no* effect on the initial simplex (but their relative values do have an effect, and a correct effect, AFAICS). Karl Ove Hufthammer la. den 18. 08. 2012 klokka 07.32 (-0700) skreiv Bert Gunter: Well, I'm

[R] Importing name/value formatted data

2012-03-06 Thread Karl Ove Hufthammer
don’t know what this type of data format is called. -- Karl Ove Hufthammer __ 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

Re: [R] Bug or feature? sum(c(a, b, c)) != (a + b + c)

2011-08-24 Thread Karl Ove Hufthammer
/viewdoc/download?doi=10.1.1.103.344rep=rep1type=pdf -- Karl Ove Hufthammer __ 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

Re: [R] Clean up a scatterplot with too much data

2011-08-02 Thread Karl Ove Hufthammer
(smoothScatter) example(sunflowerplot) library(hexbin) example(hexbinplot) (And do remove the outliers before plotting.) -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] Plotting question

2011-08-02 Thread Karl Ove Hufthammer
) for an idea about it could look (ignore the marginal plots). Of course, do use the lattice or the ggplot2 package, not the coplot function. Too bad you have 10 groups and not 9 (or 12), BTW ... :-/ -- Karl Ove Hufthammer __ R-help@r-project.org mailing

Re: [R] Binning numbers into integer-valued intervals (or: a version of cut or cut2 that makes sense)

2011-07-26 Thread Karl Ove Hufthammer
-- Karl Ove Hufthammer __ 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] Binning numbers into integer-valued intervals (or: a version of cut or cut2 that makes sense)

2011-07-25 Thread Karl Ove Hufthammer
attached base packages: [1] splines stats graphics grDevices utils datasets methods [8] base other attached packages: [1] Hmisc_3.8-3 survival_2.36-9 loaded via a namespace (and not attached): [1] cluster_1.14.0 grid_2.13.1 lattice_0.19-30 -- Karl Ove Hufthammer

Re: [R] inside p value 'e'

2011-07-25 Thread Karl Ove Hufthammer
Dieter Menne wrote: I have like 5.075e-12 , 3.207e-05, 7.438e-07 and 9.393e-08 *** , i dont know what number they are http://en.wikipedia.org/wiki/Floating_point Or use ‘format’ in R. Example: format(5.075e-8, scientific=FALSE) -- Karl Ove Hufthammer

Re: [R] text mining analysis and word visualization of pdfs

2011-05-18 Thread Karl Ove Hufthammer
(ggplot2) HTH. -- Karl Ove Hufthammer __ 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

Re: [R] %in% operator - NOT IN

2011-05-09 Thread Karl Ove Hufthammer
Dan Abner wrote: I am attempting to use the %in% operator with the ! to produce a NOT IN type of operation. Just use the ‘%nin‰’ operator in the ‘Hmisc’ package. :-) -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] Quiz: Who finds the nicest form of X_1^\prime?

2011-04-13 Thread Karl Ove Hufthammer
Marius Hofert wrote: Haha, I found a hack (using the letter l): plot(0,0,main=expression(italic(X)[1]^bolditalic(l))) Why cheat when you can use a *real* prime character: plot(0, 0, main=expression(paste(italic(X)[1],\u2032))) -- Karl Ove Hufthammer

Re: [R] Segfaults of eigen

2011-02-21 Thread Karl Ove Hufthammer
and blas-atlas did not solve the issue. This issue seems the reason that example(svm) creates segfaults, too. FWIW, this does *not* crash R on my system, running 2.12.2 RC with GotoBLAS2. -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https

Re: [R] Subset according to groups NA proportion within specific variables

2011-02-21 Thread Karl Ove Hufthammer
(x))/nrow(x) ) newdf = ddply(df, .(x), na.prop) Now you can use ‘subset’ on ‘newdf’ to obtain the required rows. (For very large data sets it may be better to not create an entire data frame in ‘na.prop’, duplicating the data in ’df’, but instead just return the proportion.) -- Karl Ove

Re: [R] Segfaults of eigen with blas-atlas at x86_64-pc-linux-gnu systems

2011-02-21 Thread Karl Ove Hufthammer
/R-admin.html#BLAS and especially http://cran.r-project.org/doc/manuals/R-admin.html#Shared-BLAS -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] Applying multiple functions to one object

2011-02-10 Thread Karl Ove Hufthammer
should have known about this, as I use the ‘plyr’ package daily. It doesn’t handle multiple objects though, AFAICS, so hopefully the function Vettorazzi and I created is of some use too. :) -- Karl Ove Hufthammer __ R-help@r-project.org mailing list

Re: [R] Frequency plot --- stacked symbols

2011-02-08 Thread Karl Ove Hufthammer
’ package. Note that both packages define a ‘dots’ function, and one of them with mask the other if you load both packages. You might also be interested in the ‘stem’ function (part of the default R packages). -- Karl Ove Hufthammer __ R-help@r-project.org

Re: [R] strange behavior of panel.abline inside a for-loop

2011-02-08 Thread Karl Ove Hufthammer
[and not at x=i]. Why? No, it’s printed at x=i, which is 10 at the end of the loop. You can see this by changing i to for example 5 and rerunning ‘plot.list[[3]]’. -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] please hep in uniform distribution

2011-02-08 Thread Karl Ove Hufthammer
Woo wrote: So I done it by sum(BA^2), but I'm not sure if there is anther way to calculate the number of cases in the distribution or what I have done is fine What you have done is fine. -- Karl Ove Hufthammer __ R-help@r-project.org mailing list

Re: [R] Applying multiple functions to one object

2011-02-04 Thread Karl Ove Hufthammer
0.9726821 0.7661752 gamma 0.5556737 0.4678005 Hope someone else will find it useful too. -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] how to learn more from R

2011-02-04 Thread Karl Ove Hufthammer
, but note that more become available when you load new packages (try the ‘rgl’, ‘lattice’ and ‘animation’ packages for some nice graphical demos). -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] Applying multiple functions to one object

2011-02-02 Thread Karl Ove Hufthammer
, typeof, class) -- Karl Ove Hufthammer __ 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

Re: [R] nlminb doesn't converge and produce a warning

2011-01-21 Thread Karl Ove Hufthammer
), rep(0.01, 3), rep(-Inf, : unrecognized control element(s) named `maxit' ignored Just increase the maximum number of iterations. Which you tried to do, but didn’t succeed in, as the above warnings shows. The argument is called ‘iter.max’, not ‘max.iter’. -- Karl Ove Hufthammer

[R] table on factors with non-ASCII characters *extremely* slow on Windows

2011-01-19 Thread Karl Ove Hufthammer
could use something like res=tabulate(x.fac.nascii, nbins=nlevels(x.fac.nascii)) names(res)=levels(x.fac.nascii) though I’m not entirely sure the internal structure of factors is guaranteed to be so that this will always work. Any comments or suggestions? -- Karl Ove Hufthammer

Re: [R] CSV value not being read as it appears

2011-01-17 Thread Karl Ove Hufthammer
for this. If you run the result through the ‘latex’ function, you get an even nicer output, with small histograms for each numerical variable. -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] CSV value not being read as it appears

2011-01-17 Thread Karl Ove Hufthammer
Peter Ehlers wrote: It is hardly R's fault that Excel users routinely commit crimes against data. A ‘fortune’ candidate? -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] From polynomial to function

2011-01-12 Thread Karl Ove Hufthammer
*Math.polynomial* [10] Ops.polynomial* plot.polynomial* points.polynomial* [13] predict.polynomial* print.polynomial*solve.polynomial* [16] summary.polynomial* Summary.polynomial* -- Karl Ove Hufthammer

Re: [R] 3d topographic map

2010-07-30 Thread Karl Ove Hufthammer
, col=map.colours(dat.mat))) -- Karl Ove Hufthammer __ 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

Re: [R] Help required with png graphic production as text has shadows?

2010-04-13 Thread Karl Ove Hufthammer
’ this depends on your platform. For Windows, I believe you have to turn off ClearType for fonts. For Linux, see ?X11.options. -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] tm[,-1]

2010-03-11 Thread Karl Ove Hufthammer
and failed dismally... Sorry. Please type: ?[ -- Karl Ove Hufthammer __ 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

Re: [R] Deltas or changes

2010-03-09 Thread Karl Ove Hufthammer
On Tue, 9 Mar 2010 05:37:52 -0800 (PST) ManInMoon xmoon2000 @googlemail.com wrote: How can I generate a vector of differences between each elemtn of an vector? diff(x) -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] Graphing a piece-wise defined function

2010-03-08 Thread Karl Ove Hufthammer
=function(x) ifelse(x = 0, x^2, 0) curve(f, -2, 4) -- Karl Ove Hufthammer __ 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

Re: [R] Three most useful R package

2010-03-04 Thread Karl Ove Hufthammer
. But that package will not be useful until the hardware support is available. Such a package but without the hardware support would certainly be useful. (For LaTeX we have the 'nag' package, with a similar functionality.) -- Karl Ove Hufthammer __ R-help

Re: [R] Newb question re. read.table...

2010-03-04 Thread Karl Ove Hufthammer
, data=con) -- Karl Ove Hufthammer __ 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

Re: [R] Three most useful R package

2010-03-03 Thread Karl Ove Hufthammer
On Tue, 2 Mar 2010 15:13:54 -0500 Ralf B ralf.bie...@gmail.com wrote: 1) What are your 3 most useful R package? and plyr ggplot2 lattice -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] Three most useful R package

2010-03-03 Thread Karl Ove Hufthammer
On Wed, 3 Mar 2010 09:26:32 +0100 Karl Ove Hufthammer k...@huftis.org wrote: 1) What are your 3 most useful R package? and plyr ggplot2 lattice And since 'lattice' already is in the 'recommended' set, and therefore included in R by default, I'd like to add one more package: sos

Re: [R] : Three most useful R package

2010-03-03 Thread Karl Ove Hufthammer
/StatReport/summary.pdf -- Karl Ove Hufthammer __ 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

Re: [R] two questions for R beginners

2010-03-02 Thread Karl Ove Hufthammer
should include a brief discussion on 'str'. But sometimes even 'str' can fool you from discovering the real underlying structure of an object, e.g. for data frames. The solution is to use 'unclass' first. -- Karl Ove Hufthammer __ R-help@r-project.org

Re: [R] Thougt I understood factors but??

2010-03-02 Thread Karl Ove Hufthammer
On Mon, 1 Mar 2010 14:23:04 -0500 Liaw, Andy andy_l...@merck.com wrote: Indeed this is one of the (few, I believe) traps of R, Oh, no; there are many more: http://www.burns-stat.com/pages/Tutor/R_inferno.pdf :-) -- Karl Ove Hufthammer __ R-help@r

Re: [R] why a text editor?

2010-03-02 Thread Karl Ove Hufthammer
in all *good* text editors. -- Karl Ove Hufthammer __ 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

Re: [R] two questions for R beginners

2010-03-02 Thread Karl Ove Hufthammer
not). (And yes, I know that it's *documented* that it returns a named vector.) On the other hand, perhaps it is surprising that 'mean' works on data frames at all. :-) -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] two questions for R beginner

2010-03-02 Thread Karl Ove Hufthammer
and SPSS Users http://www.springer.com/statistics/computanional+statistics/book/978-0- 387-09417-5 R for Stata Users http://www.springer.com/statistics/computanional+statistics/book/978-1- 4419-1317-3 (I have not, so I don't know how good they are.) -- Karl Ove Hufthammer

Re: [R] question to define a matrix with some vectors with different lengths

2010-03-02 Thread Karl Ove Hufthammer
with the missing elements? -- Karl Ove Hufthammer __ 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

Re: [R] Random real numbers

2010-03-02 Thread Karl Ove Hufthammer
On Tue, 2 Mar 2010 11:51:39 +0100 frederik vanhaelst frederik.vanhae...@gmail.com wrote: How could i generate random real numbers between 0 en 2*pi? Ten such numbers from the uniform distribution: 2*pi*runif(10) -- Karl Ove Hufthammer __ R-help@r

Re: [R] two questions for R beginners

2010-03-01 Thread Karl Ove Hufthammer
. a few of the examples of the 'xyplot' function in 'lattice'. -- Karl Ove Hufthammer __ 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

Re: [R] Odp: two questions for R beginners

2010-03-01 Thread Karl Ove Hufthammer
' all the time (though sometimes I rewrite the code to use 'aggregate' or 'tapply' later, because of speed issues). -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] two questions for R beginners

2010-03-01 Thread Karl Ove Hufthammer
=9780521694247 -- Karl Ove Hufthammer __ 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] two questions for R beginners

2010-03-01 Thread Karl Ove Hufthammer
On Mon, 1 Mar 2010 11:02:59 +0100 Karl Ove Hufthammer k...@huftis.org wrote: * What were your biggest misconceptions or stumbling blocks to getting up and running with R? Also I found it quite confusing that One more thing that still trips me up sometimes. '$' works on data frames

Re: [R] two questions for R beginners

2010-03-01 Thread Karl Ove Hufthammer
the object *as if* it were a data frame. It's a very comfortable way of working. -- Karl Ove Hufthammer __ 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

Re: [R] two questions for R beginners

2010-03-01 Thread Karl Ove Hufthammer
Sepal.Length Sepal.Width Petal.Length Petal.Width 5.84 3.057333 3.758000 1.199333 d3$Sepal.Width [1] 3.5 d4$Sepal.Width Error in d4$Sepal.Width : $ operator is invalid for atomic vectors -- Karl Ove Hufthammer __ R-help@r

Re: [R] two questions for R beginners

2010-03-01 Thread Karl Ove Hufthammer
just work like you expect them to. -- Karl Ove Hufthammer __ 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

Re: [R] two questions for R beginners

2010-03-01 Thread Karl Ove Hufthammer
(as.character(pi)) It works fine in the US, but not in Europe. :) Hint: Try options(OutDec=,) -- Karl Ove Hufthammer __ 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

Re: [R] Dock graphs when using R in Eclipse with StatET plug In

2010-03-01 Thread Karl Ove Hufthammer
the 'RMI/JRI' interface on a non-ASCII system, though, so I usually use the 'Rterm' interface (which doesn't support the popup feature or any other feature that depend on feedback *from* R to Eclipse). -- Karl Ove Hufthammer __ R-help@r-project.org mailing

Re: [R] density estimates for fixed points

2010-02-16 Thread Karl Ove Hufthammer
=bandwidth.nrd(x)/4' and 'h2=bandwidth.nrd(y)=4'. Note that, depending on the number of coordinates you need to calculate the kernel density esimate at, it may be faster to use the first solution and just discard the estimates you don't need. (It will use a lot more memory, though.) -- Karl Ove

Re: [R] lint for R? and debugging

2010-02-16 Thread Karl Ove Hufthammer
On Tue, 16 Feb 2010 08:00:09 -0500 Esmail esmail...@gmail.com wrote: And along the same lines, any type of interactive debugging utility for R? See this article in R News: 'Debugging Without (Too Many) Tears' http://cran.r-project.org/doc/Rnews/Rnews_2003-3.pdf#page=29 -- Karl Ove Hufthammer

Re: [R] strange behaviour of median

2010-02-04 Thread Karl Ove Hufthammer
(use 'sapply' or 'apply' for that), but it's certainly surprising and confusing behaviour. I think 'median' should either be changed to work on data frames, or to produce a warning when used on data frames. -- Karl Ove Hufthammer __ R-help@r

Re: [R] strange behaviour of median

2010-02-04 Thread Karl Ove Hufthammer
On Thu, 4 Feb 2010 12:04:32 +0100 Karl Ove Hufthammer k...@huftis.org wrote: It's not exactly a bug, since 'median' is not documented to work on data frames (use 'sapply' or 'apply' for that), Note that this is slightly more complicated than what would appear at first sight. Both 'sapply

Re: [R] difference between ' and

2010-01-27 Thread Karl Ove Hufthammer
read about the difference between = and - and I thought that there might be a difference here too in some cases. Well, you can use ' but not inside (without escaping). Also, you can use but not ' inside '' (without escaping). -- Karl Ove Hufthammer

Re: [R] Online R documentation

2010-01-14 Thread Karl Ove Hufthammer
On Fri, 8 Jan 2010 16:35:25 +0100 Karl Ove Hufthammer k...@huftis.org wrote: Well, I was thinking of better integration with the help pages, e.g., having each image appear right after the code that generated it, having larger images (perhaps at approx. the default window size for graphs

Re: [R] Fitting chi-squared distribution

2010-01-08 Thread Karl Ove Hufthammer
On Fri, 8 Jan 2010 14:39:34 +0100 Trafim Vanishek rdapam...@gmail.com wrote: I would like to ask if there is a simple was in R to fit the chi-squared distribution to the empirical data? Sure. Use the 'fitdistr' function in the 'MASS' package. -- Karl Ove Hufthammer

Re: [R] Online R documentation

2010-01-08 Thread Karl Ove Hufthammer
://www.metaresearch.de/exlib/;, would be nice. -- Karl Ove Hufthammer __ 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

Re: [R] Online R documentation

2010-01-08 Thread Karl Ove Hufthammer
/ -- Karl Ove Hufthammer __ 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 figure out which the version of split is used?

2009-12-11 Thread Karl Ove Hufthammer
to use it. Would you please give me a working example? Typing 'split' shows a nice example ... :-) -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] How to figure out which the version of split is used?

2009-12-10 Thread Karl Ove Hufthammer
is not of type data.frame, Date or POSIXct, split.default will be called? Yes. See ?UseMethod -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] Convert a list of N dataframes to N dataframes

2009-12-09 Thread Karl Ove Hufthammer
) Are you perhaps looking for ?attach ? -- Karl Ove Hufthammer __ 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

[R] Subset of time observations where timediff 60 secs

2009-12-07 Thread Karl Ove Hufthammer
following the first time value, and thus may include times with values that are closer than 60 seconds. I also considered round.POSIXct and trunc.POSIXct, but these are not appropriate either, for obvious reasons. So, any ideas how to do this in an elegant and efficient way? -- Karl Ove

Re: [R] Problem with Cannot compute correct p-values with ties

2009-12-02 Thread Karl Ove Hufthammer
://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

Re: [R] Joint density kde2d works improperly?

2009-12-02 Thread Karl Ove Hufthammer
, which should usually *not* sum to 1. -- Karl Ove Hufthammer __ 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

Re: [R] assigning values to parameters, based on different names

2009-12-01 Thread Karl Ove Hufthammer
On Tue, 01 Dec 2009 12:45:18 + Jannis bt_jan...@yahoo.de wrote: I am wondering whether there is a way to tell R to assign a value of parameter X to parameter B while the actual name of parameter X is given by parameter C. Like this: Yes. See ?get. -- Karl Ove Hufthammer

Re: [R] Ggplot2: Elegant Graphics for Data Analysis (Use R) (2009 Paperback)

2009-11-30 Thread Karl Ove Hufthammer
, and information on various details of ggplot2 that aren't really documented anywhere else. And it uses colours throughout. Too bad it's not available in PDF form anymore, though. -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https

Re: [R] Scaling variables to positive values using scale() or performing BoxCox on negative data

2009-11-30 Thread Karl Ove Hufthammer
Ove Hufthammer __ 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] Remark on tapply().

2009-11-30 Thread Karl Ove Hufthammer
? (The answer should be fairly obvious, but it's an easy mistake to make.) -- Karl Ove Hufthammer __ 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

Re: [R] Is there a function to test if all the elements in a vector are unique

2009-11-30 Thread Karl Ove Hufthammer
On Tue, 1 Dec 2009 14:48:04 +1100 Remko Duursma remkoduur...@gmail.com wrote: any(duplicated(c(1,2,2))) or anyDuplicated(c(1,2,2)) which is slightly more efficient. -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] How to compute Rolling analysis of Standard Deviation using ZOO package?

2009-11-27 Thread Karl Ove Hufthammer
On Fri, 27 Nov 2009 15:19:11 +0800 Saji Ren saji@gmail.com wrote: I want to get a rolling estimation of the stdev of my data. There is a 'runsd' in the 'caTools' package which does exactly this. -- Karl Ove Hufthammer __ R-help@r-project.org

Re: [R] Kerning issues with CairoPDF

2009-11-26 Thread Karl Ove Hufthammer
Karl Ove Hufthammer wrote: I'm using CairoPDF to generate PDF (because of its font embedding and support for transparent colours). However, at least on my (Windows) system, the text it outputs seems to have completely wrong kerning. Here's an example: CairoPDF(test.pdf) plot(rnorm(100

[R] Kerning issues with CairoPDF

2009-11-25 Thread Karl Ove Hufthammer
] LC_TIME=Norwegian-Nynorsk_Norway.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] Cairo_1.4-5 loaded via a namespace (and not attached): [1] tools_2.10.0 -- Karl Ove Hufthammer

Re: [R] Natural colours for topographic data

2009-11-25 Thread Karl Ove Hufthammer
very nice. Perhaps I’ll even write a general function for generating topographic colour scales, based on this. (It might be a while before it’s ready, though.) -- Karl Ove Hufthammer http://huftis.org/ Jabber: k...@huftis.org __ R-help@r-project.org

Re: [R] Loess Fit

2009-11-24 Thread Karl Ove Hufthammer
for you. Then this function can give the predictions for various x values. Why not use 'predict.loess' (i.e., 'predict' on a loess object) directly? -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] Natural colours for topographic data

2009-11-24 Thread Karl Ove Hufthammer
, green and blue values) makes it not very useful for this purpose. -- Karl Ove Hufthammer __ 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

Re: [R] Method

2009-11-24 Thread Karl Ove Hufthammer
this, it turns out that the 'length' solution is about 10 times faster than the 'tail' solution. :-( -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

[R] Natural colours for topographic data

2009-11-23 Thread Karl Ove Hufthammer
negative values to water colours and positive values to land colours. -- Karl Ove Hufthammer __ 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

Re: [R] Problem with sqlSave

2009-11-20 Thread Karl Ove Hufthammer
*don't* want to retain the old data, why do you set append = TRUE? -- Karl Ove Hufthammer __ 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

Re: [R] Classification

2009-11-20 Thread Karl Ove Hufthammer
solution, just remove the 'sort': match(x,unique(x)) -- Karl Ove Hufthammer __ 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

Re: [R] reduce matrix

2009-11-18 Thread Karl Ove Hufthammer
] There are the same number of zero elements in each row of A so dimension of B will not be a problem. This should work: B=matrix(t(A)[t(A)!=0], nrow=nrow(A), byrow=TRUE) -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] Writing a data frame in an excel file

2009-11-18 Thread Karl Ove Hufthammer
on it it gives the error i wrote before saying that Results already exists, is there a way to avoid that? See the help page for 'sqlSave': ?sqlSave More specifically, take a look at the 'append' and 'safer' arguments. -- Karl Ove Hufthammer __ R-help@r

Re: [R] One basic question - combining two conditions

2009-11-17 Thread Karl Ove Hufthammer
is called '' in R. Try ?'' to display the help page. You might also be interested in ?ifelse and ?if -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] Arguments for Plot()

2009-11-17 Thread Karl Ove Hufthammer
for 'plot.default'. -- Karl Ove Hufthammer __ 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

Re: [R] Weighted descriptives by levels of another variables

2009-11-16 Thread Karl Ove Hufthammer
functions like describe {Hmisc}. 'describe' outputs a list, not just a vector. To get the actual values as vectors, you have to extract them, e.g.: describe(x)$counts describe(x)$values -- Karl Ove Hufthammer __ R-help@r-project.org mailing list

Re: [R] Plotting Histogram using histogram() and for loop and I want to save the histogram individually ... HELP

2009-11-16 Thread Karl Ove Hufthammer
. If you use an editor with syntax highlighting, it is easy to spot these types of errors. -- Karl Ove Hufthammer __ 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

Re: [R] simulated correlated vectors

2009-11-13 Thread Karl Ove Hufthammer
. -- Karl Ove Hufthammer __ 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] Plotting Histogram using histogram() and for loop and I want to save the histogram individually ... HELP

2009-11-13 Thread Karl Ove Hufthammer
On Thu, 12 Nov 2009 19:10:52 -0800 (PST) ychu066 ychu066 @aucklanduni.ac.nz wrote: And I also want to save each histogram in each separate pdf file using the following codes ?. png(hist.png[i]) dev.off() Try png(paste(hist,i,.png,sep=) instead. -- Karl Ove Hufthammer

  1   2   >