Re: [R] Convert ASCII string to Hex in R (vice versa)

2008-12-21 Thread Dieter Menne
Gundala Viswanath gmail.com> writes: > Is there such a package in R? Re: Convert ASCII string to Hex in R (vice versa) Difficult to understand what you want: could be x = 32 (b = sprintf("%x",x) ) Also check hexmode/as.hexmode Dieter __ R-help@r-p

[R] post hoc comparisons of interaction means after lme

2008-12-21 Thread Lawrence Hanser
Dear Colleagues, I have run the following two models, where category has 3 levels and comp has 8 levels: mod1 <- lmer(x~category+comp+(1|id),data=impchiefsrm) mod2 <- lmer(x~category+comp+category*comp+(1|id),data=impchiefsrm) followed by: anova(mod1,mod2) The anova shows that the interaction t

Re: [R] sorting variable names containing digits

2008-12-21 Thread John Fox
Dear Gabor, Thank you (again) for this second suggestion, which does exactly what I want. At the risk of appearing ungrateful, and although the judgment is admittedly subjective, I don't find it simpler than mysort(). For curiosity, I tried some timings of the two functions for the sample problem

Re: [R] sorting variable names containing digits

2008-12-21 Thread Gabor Grothendieck
Another possibility is to use strapply in gsubfn giving a solution that is non-recursive and shorter: library(gsubfn) mysort2 <- function(s) { L <- strapply(s, "([0-9]+)|([^0-9]+)", ~ if (nchar(x)) sprintf("%9d", as.numeric(x)) else y) L2 <- t(do.call(cbind, lapply

Re: [R] sorting variable names containing digits

2008-12-21 Thread John Fox
Dear Gabor, Thanks for this -- I was unaware of mixedsort(). As you point out, however, mixedsort() doesn't cover all of the cases in which I'm interested and which are handled by mysort(). Regards, John On Sun, 21 Dec 2008 20:51:17 -0500 "Gabor Grothendieck" wrote: > mixedsort in gtools will

[R] Convert ASCII string to Hex in R (vice versa)

2008-12-21 Thread Gundala Viswanath
Dear All, Is there such a package in R? - Gundala Viswanath Jakarta - Indonesia __ 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 c

Re: [R] sorting variable names containing digits

2008-12-21 Thread Gabor Grothendieck
mixedsort in gtools will give the same result as mysort(s) but differs in the case of t. On Sun, Dec 21, 2008 at 8:33 PM, John Fox wrote: > Dear r-helpers, > > I'm looking for a way of sorting variable names in a "natural" order, when > the names are composed of digits and other characters. I kno

Re: [R] Merging two data frame with different nrows

2008-12-21 Thread Chuck Cleland
On 12/21/2008 8:32 PM, Antonio Paredes wrote: > hello- > > I'm trying to merge two data frames with different number of rows. I started > with a for loop, but it just taking to long . I wanted to ask if there is > any function in R to merge data frames with different number of rows. As the Post

[R] sorting variable names containing digits

2008-12-21 Thread John Fox
Dear r-helpers, I'm looking for a way of sorting variable names in a "natural" order, when the names are composed of digits and other characters. I know that this is a vague idea, and that sorting character strings is a complex topic, but perhaps a couple of examples will clarify what I mean: > s

[R] Merging two data frame with different nrows

2008-12-21 Thread Antonio Paredes
hello- I'm trying to merge two data frames with different number of rows. I started with a for loop, but it just taking to long . I wanted to ask if there is any function in R to merge data frames with different number of rows. -- -Tony [[alternative HTML version deleted]] _

Re: [R] png() and jpg() devices acting weird.

2008-12-21 Thread Avram Aelony
I experienced a similar problem generating PNGs on linux and found that installing a missing font library corrected the situation. Hope this helps, Avram On Dec 19, 2008, at 12:46 PM, Jeroen Ooms wrote: I use a CentOS 5.2 VPS to generate graphs through an R web- application. I generate

[R] Trouble with 'smooth' using xyplot in lattice

2008-12-21 Thread lost_ri...@excite.com
Hello, I am fairly new to R am stumped on how to get the xyplot function in the lattice package to produce a scatter plot of count data versus time, such that the count data represent 8 different groups, and the plot produced has 8 unique "smoothed" lines for the different groups. This is the

Re: [R] NA, where no NA should (could!) be!

2008-12-21 Thread Wacek Kusnierczyk
Gabor Grothendieck wrote: > > I think reproducible is the correct word and its meaning should be clear from > both its conventional meaning, see link, and the context in which its used: > http://en.wikipedia.org/wiki/Reproducibility > > It is surprising how many posters disregard this basic require

Re: [R] Combining Sweave and LaTeX-packages?

2008-12-21 Thread Gabor Grothendieck
Also check out the xtable package. On Sun, Dec 21, 2008 at 12:09 PM, Oliver Bandel wrote: > Hello, > > a while ago I asked for collaboration support > R <-> LaTeX. > > I got some answers, and Sweave was one, to use > the Hmisc package another one. > > Both have their advantages and drawbacks. >

Re: [R] Globbing Files in R

2008-12-21 Thread Prof Brian Ripley
Sys.glob is much more direct Education of you might find exploring the power of?? (e.g. ??glob) educational. On Sun, 21 Dec 2008, Douglas Bates wrote: On Sun, Dec 21, 2008 at 9:35 AM, Gundala Viswanath wrote: Dear all, For example I want to process set of files. Typically Perl's id

Re: [R] Combining Sweave and LaTeX-packages?

2008-12-21 Thread Oliver Bandel
Zitat von Frank E Harrell Jr : [...] > > But Hmisc's latex() function(s) create always *.tex-files. > > Then I have to use the include-statement by myself and also > > my working directory will be filled up with *.tex files... > > No, read the latex function's documentation more closely. Specifyi

Re: [R] Combining Sweave and LaTeX-packages?

2008-12-21 Thread Frank E Harrell Jr
Oliver Bandel wrote: Hello, a while ago I asked for collaboration support R <-> LaTeX. I got some answers, and Sweave was one, to use the Hmisc package another one. Both have their advantages and drawbacks. At the moment I would absolutely prefer Sweave, because the inclusion is done automat

[R] Combining Sweave and LaTeX-packages?

2008-12-21 Thread Oliver Bandel
Hello, a while ago I asked for collaboration support R <-> LaTeX. I got some answers, and Sweave was one, to use the Hmisc package another one. Both have their advantages and drawbacks. At the moment I would absolutely prefer Sweave, because the inclusion is done automatically, and I do not ha

Re: [R] Akaike weight in R

2008-12-21 Thread Graham Smith
> Seems pretty clear from a quick glance at that page (and in retrospect, even > from the URL itself) that Graham misspelled the package name, Try looking > for package, aod (without any caps.) Yep, mea culpa (and I have probably spelt that wrong as well), it was quick after thought as I almost ju

Re: [R] Globbing Files in R

2008-12-21 Thread Gabor Grothendieck
Try this: file.names <- dir(pattern = glob2rx("/mydir/*.txt")) for(fn in file.names) { DF <- read.table(fn, ...) ... } Another possibility is: file.names <- .. as above ... out <- lapply(file.names, function(fn) { DF <- read.table(fn, ...) ... }) out will have one component per file f

Re: [R] Akaike weight in R

2008-12-21 Thread David Winsemius
Seems pretty clear from a quick glance at that page (and in retrospect, even from the URL itself) that Graham misspelled the package name, Try looking for package, aod (without any caps.) -- David Winsemius On Dec 21, 2008, at 5:17 AM, Odette Gaston wrote: Hi Graham, Appreciate for your h

Re: [R] Globbing Files in R

2008-12-21 Thread Douglas Bates
On Sun, Dec 21, 2008 at 9:35 AM, Gundala Viswanath wrote: > Dear all, > > For example I want to process set of files. > > Typically Perl's idiom would be: > > __BEGIN__ > @files = glob("/mydir/*.txt"); > > foreach my $file (@files) { > # process the file > } > __END__ > > What's the R's way to d

Re: [R] Dataframe help

2008-12-21 Thread Oliver Bandel
Rajasekaramya gmail.com> writes: > > > Hi there, > > I have a dataframe length.unique.info > > length.unique.info > abc 12 345 > def 16 550 > lmn 6 600 > I want those names that fall under the condition (length.unique.info[,2][i] > <=5 && length.unique.info[,3][i] >=500) [...] Hello,

[R] Globbing Files in R

2008-12-21 Thread Gundala Viswanath
Dear all, For example I want to process set of files. Typically Perl's idiom would be: __BEGIN__ @files = glob("/mydir/*.txt"); foreach my $file (@files) { # process the file } __END__ What's the R's way to do that? - Gundala Viswanath Jakarta - Indonesia _

Re: [R] function prop.trend.test (stats)

2008-12-21 Thread David Winsemius
Search on: cochran-armitage trend test Goes back to the Forties or Fifties. My copy or Statistical Methods in Medical Research describes it, gives a justification, and cites: Armitage (1955) "Tests for linear trends in proportions and frequencies." Biometrics, 11, 375-386. My copy of Sne

Re: [R] How can I get the interpolated data?

2008-12-21 Thread David Winsemius
If you look at the CR.rsm object with str() you will see that it inherits from the lm class of objects. Therefore the predict.lm method will be available and if you further look at: ?predict.lm You see that all you need to do is give it a dataframe that has the variables that match up with

Re: [R] NA, where no NA should (could!) be!

2008-12-21 Thread Gabor Grothendieck
On Sun, Dec 21, 2008 at 8:52 AM, Duncan Murdoch wrote: > On 21/12/2008 7:57 AM, Gabor Grothendieck wrote: >> >> On Sun, Dec 21, 2008 at 5:42 AM, Dieter Menne >> wrote: >>> >>> Peter Dalgaard biostat.ku.dk> writes: >>> Why do so many people have such trouble with the word "reproducible"? We

Re: [R] NA, where no NA should (could!) be!

2008-12-21 Thread Duncan Murdoch
On 21/12/2008 7:57 AM, Gabor Grothendieck wrote: On Sun, Dec 21, 2008 at 5:42 AM, Dieter Menne wrote: Peter Dalgaard biostat.ku.dk> writes: Why do so many people have such trouble with the word "reproducible"? We can't reproduce that without access to weblog_by_date! In a strict sense, the

[R] function prop.trend.test (stats)

2008-12-21 Thread Paulo Barata
To the R-help list, In the documentation of the prop.trend.test function in the stats package, no bibliography has been provided which would allow one to find out the theoretical basis of that function and/or details of its implementation. May I suggest that some bibliography be included, as it

[R] How can I get the interpolated data?

2008-12-21 Thread pinwheels
Hello,everybody! I am a beginner of R. And I want to ask a question. If anybody would help me, thank you very much ahead. I want to plot something like a response surface, and I find the "rsm" package. Some commands are like this: #code head library(rsm) CR = coded.data(ChemReact, x1 ~ Time, x

Re: [R] autologistic modelling in R

2008-12-21 Thread Roger Bivand
David Katz davidkatzconsulting.com> writes: > > > Curiosity and Google lead me to this paper which may be of interest: > > Assessing the validity of autologistic regression > Carsten F. Dormann > Abstract > ... > the focal species. Autologistic regression models consistently underestimate > t

Re: [R] NA, where no NA should (could!) be!

2008-12-21 Thread Gabor Grothendieck
On Sun, Dec 21, 2008 at 5:42 AM, Dieter Menne wrote: > Peter Dalgaard biostat.ku.dk> writes: > >> Why do so many people have such trouble with the word "reproducible"? We >> can't reproduce that without access to weblog_by_date! > > In a strict sense, the example is "reproducible" as opposite to

Re: [R] NA, where no NA should (could!) be!

2008-12-21 Thread Dieter Menne
Peter Dalgaard biostat.ku.dk> writes: > Why do so many people have such trouble with the word "reproducible"? We > can't reproduce that without access to weblog_by_date! In a strict sense, the example is "reproducible" as opposite to "spurious". Reproducible research means that you can get the

Re: [R] Akaike weight in R

2008-12-21 Thread Odette Gaston
Hi Graham, Appreciate for your help, but actually I've already looked at this website, and wasn't success yet. 1st, I cannot run "*W = exp(-0.5 * Delta) / sum(exp(-0.5 * Delta))*" in the R. > *W <- exp(-0.5 * Delta) / sum(exp(-0.5 * Delta))* *note: Delta means AIC difference between models.* ** I