Re: [R] Factor Madness

2007-12-19 Thread Johannes Graumann
Yep, but I figured that out quite fast ;0) Thanks for giving me a hand ... you want believe a many times I skimmed the cbind help without actually seeing this ... well, it was 0:30 ... Thanks again, Joh Tony Plate wrote: Whoops, it looks like there's a typo in ?cbind (R version 2.6.0 Patched

[R] Different labels by panel in barchart

2007-12-19 Thread Richard . Cotton
Dear all, I'm analysing a survey, and creating a barchart of the different responses for each question. The questions are grouped according to a number of categories, so I'm using lattice to create a plot with each question in a category on it. The problem is that the response set for

Re: [R] Analyzing Publications from Pubmed via XML

2007-12-19 Thread Armin Goralczyk
On Dec 18, 2007 9:39 PM, David Winsemius [EMAIL PROTECTED] wrote: Armin Goralczyk [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: It's not the spaces, the problem is the tag (sorry that I didn't specify this), or maybe the string []. I am working on a Mac OS X 10.4 with R version 2.6.

Re: [R] median of binned values

2007-12-19 Thread Chuck Cleland
Martin Tomko wrote: Dear list, I have a vector (array, table row, whatever is best) of frequency values for categories (or bins), and I need to find the median category. Trivial to do by hand, but I was wondering if there is a means to do it in R in an elegant way. The obvious

[R] prop.trend.test() and Cochran-Armitage Trend test

2007-12-19 Thread R R
Hi, I was just wondering if prop.trend.test() is equivalent to the Cochran-Armitage Trend test? Thank you! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] GLM and factor in forular

2007-12-19 Thread Knut Krueger
Mark Leeds schrieb: That's because the first factor is being used as the baseline. This is explained in any intro to GLMs text. Thank you Mark, I didn't found that hint. Knut __ R-help@r-project.org mailing list

[R] array addition

2007-12-19 Thread Robin Hankin
Hi suppose I have two arrays x1,x2 of dimensions a1,b1,c1 and a2,b2,c2 respectively. I want x = x1 + x2 with dimensions c(max(a1,a2), max(b1,b2),max (c1,c2)) with x[a,b,c] = x1[a1,b1,c1] + x2[a2,b2,c2] ifa =min(a1,a2) , b=min (b1,b2), c=min(c1,c2) and the other bits either x1 or x2

Re: [R] Random forests

2007-12-19 Thread Gavin Simpson
On Tue, 2007-12-18 at 16:27 -0600, Naiara Pinto wrote: Dear all, I would like to use a tree regression method to analyze my dataset. I am interested in the fact that random forests creates in-bag and out-of-bag datasets, but I also need an estimate of support for each split. That seems hard

Re: [R] plot cummulative sum from calendar time

2007-12-19 Thread Gavin Simpson
On Wed, 2007-12-19 at 14:59 +0800, gallon li wrote: I have the following list of observations of calendar time: [1] 03-Nov-1997 09-Oct-1991 27-Aug-1992 01-Jul-1994 19-Jan-1990 12-Nov-1993 [7] 08-Oct-1993 10-Nov-1982 08-Dec-1986 23-Dec-1987 02-Aug-1995 20-Oct-1998 [13] 29-Apr-1991

Re: [R] Calculate remainer

2007-12-19 Thread Chuck Cleland
livia wrote: Hello everyone, I have got a question about a simple calculation. If I would like to calculate 50/12 and return the result as 4 and the remainer 2. Is there a function of doing this? Many thanks. ?%% to see how to get the remainder. You might put the result and remainder

[R] Help me

2007-12-19 Thread Nitish Kumar Mishra
Hello R Users, I am interested in using R to generate quantitative structure-activity relationships (QSARs) for small molecules given a set of molecular descriptors and biological data tab-delimited or excel file. In which fist value colum of each row is biological value and rest all are its

Re: [R] array addition

2007-12-19 Thread Richard . Cotton
Try this: %add% - function(x1, x2) { dim1 - dim(x1) dim2 - dim(x2) seq1 - list();for(i in 1:length(dim1)) seq1[[i]]=seq(dim1[i]) filter1 - paste(seq1, collapse=,) cmd1 - paste(out[, filter1, ], sep=) seq2 - list();for(i in 1:length(dim2)) seq2[[i]]=seq(dim2[i])

[R] randomForest() for regression produces offset predictions

2007-12-19 Thread Joshua Knowles
Hi all, I have observed that when using the randomForest package to do regression, the predicted values of the dependent variable given by a trained forest are not centred and have the wrong slope when plotted against the true values. This means that the R^2 value obtained by squaring the

[R] want to make a plot similar to ecdf

2007-12-19 Thread gallon li
I have a sample of observations: yy [1] 0. 2.3972 4.3500 -4.1972 0.6361 [6] 1.0806 5.9056 -1.8722 2.1333 -1.1806 [11] 3.6167 0.8778 8.3389 3.8417 1. [16] -3.7611 -11.6778 -2.0306

[R] Standard input and R

2007-12-19 Thread Jon Clayden
Dear all, I am trying to wrap a *nix shell script around R for a particular purpose, for which I need to get R to execute predetermined commands but retain interactivity and allow user input during their execution. A straight redirection of standard input is therefore not appropriate, and

Re: [R] plot cummulative sum from calendar time

2007-12-19 Thread John Kane
I am not sure I really understand what you want but will this work? tt-c(03-Nov-1997,09-Oct-1991,27-Aug-1992,01-Jul-1994,19-Jan-1990, 12-Nov-1993,08-Oct-1993,10-Nov-1982,08-Dec-1986,23-Dec-1987,02-Aug-1995, 20-Oct-1998,29-Apr-1991,16-Mar-1994,20-May-1991,28-Dec-1987,14-Jul-1999,

[R] unexpected behavior from gzfile and unz

2007-12-19 Thread Matthew Suderman
I get unexpected behavior from readLines() and scan() depending on how the file is opened with gzfile or unz. More specifically: file - gzfile(file.gz) readLines(file,1) [1] a\tb\tc readLines(file,1) [1] a\tb\tc close(file) It seems that the stream is rewound between calls to readLines.

[R] (no subject)

2007-12-19 Thread Jiaming Zuo
Dear R Users, I am working for the United Nations to construct a complete life table from an abridged table. I want to use the code of Hydman Filter by Rob J Hydman but an error sentence always appears and it simply doesn't run-- source(C:/R/Jamie/HymanFilter.R) Error in

[R] adding lines to a barchart

2007-12-19 Thread Spilak,Jacqueline [Edm]
Hi all I can't find what I am looking for so I am asking here. I have a dataset that looks something like this. Year season percent_below 2000 Winter 6.9179870 2000 Spring 1.6829436 2000 Summer 1.8463501 2000 Autumn 3.8184993 2001 Winter 2.8832806 2001

[R] (no subject)

2007-12-19 Thread Jiaming Zuo
Dear R Users, I am working for the United Nations to construct a complete life table from an abridged table. I want to use the code of Hydman Filter by Rob J Hydman but an error sentence always appears and it simply doesn't run-- source(C:/R/Jamie/HymanFilter.R) Error in

Re: [R] Function reference

2007-12-19 Thread Tony Plate
R does this sort of thing easily without any parse/eval acrobatics needed. E.g., you can do: stu - function(x) {return( 1 + (2*x*x) - (3*x) )} (x - 0:3) [1] 0 1 2 3 stu(x) [1] 1 0 3 10 metafun - function(FUN, data) FUN(data) metafun(stu, x) [1] 1 0 3 10 # if you want to be

Re: [R] creating a database

2007-12-19 Thread Moshe Olshansky
If all your entries are double precision then you are using 8 bytes per entry, so 20,000*n entries are just 160,000*n bytes, i.e. less than 160*n Kb. If your n is 100 you get 16 Mb which is not that much (especially if you pre-allocate it only once). So just use the matrix and don't worry! ---

[R] can optimize solve paired euqations?

2007-12-19 Thread Xin
I used the command below, but R gives me the error message--syntax error. can anyone see the mistakes I made? optimize(function(x,y) + ((327.727-(1-0.114^10)*y*(1-x)/x/(1-x^y))+(9517.336-327.727 *(1+(1-x)*(1+y)/x-327.727)))^2 + interval=c(0,1)) At the same time, I use nlm() but R gives me the

Re: [R] median of binned values

2007-12-19 Thread Moshe Olshansky
Alternatively levels(df$binname)[which(df$freq = 0.5*cumsum(df$freq)[nrow(df)])[1]] --- Chuck Cleland [EMAIL PROTECTED] wrote: Martin Tomko wrote: Dear list, I have a vector (array, table row, whatever is best) of frequency values for categories (or bins), and I need to find the median

[R] clim.pact package ncdf dependency/ netcdf.h

2007-12-19 Thread Sam McClatchie
System: Linux kernel 2.6.22-14 Ubuntu 7.10 gutsy ESS 5.3.0 on Emacs 22.1.1 R version 2.6.0 Colleagues I would like to use the user contributed package clim.pact. I'm having trouble with the dependency of clim.pact on ncdf. Like others I am finding that R CMD INSTALL does not find the netcdf.h

[R] Question about which kind of plot to use

2007-12-19 Thread Max
Hi Everyone, I've got a question about data representation. I have some psychometric data with 5 scores for 15 different groups. I've been asked to show some kind of mean plots. The data below is the mean and SD for a given group, unfortunately my employer doesn't want me posting full

Re: [R] Question about which kind of plot to use

2007-12-19 Thread Dylan Beaudette
On Wednesday 19 December 2007, Max wrote: Hi Everyone, I've got a question about data representation. I have some psychometric data with 5 scores for 15 different groups. I've been asked to show some kind of mean plots. The data below is the mean and SD for a given group, unfortunately my

Re: [R] gam() in gam package

2007-12-19 Thread Kunio takezawa
R-users E-mail: r-help@r-project.org I found the answer myself. '.Fortran(baklo,' in lo.wam() and .Fortran(bakfit,in s.wam() may carry out backfitting. But I cannot create an R code which gives the same results as those of bakfit. If someone knows the detail of bakfit algorithm, please let

Re: [R] Question about which kind of plot to use

2007-12-19 Thread Deepayan Sarkar
On 12/19/07, Dylan Beaudette [EMAIL PROTECTED] wrote: On Wednesday 19 December 2007, Max wrote: Hi Everyone, I've got a question about data representation. I have some psychometric data with 5 scores for 15 different groups. I've been asked to show some kind of mean plots. The data

Re: [R] Calculate remainer

2007-12-19 Thread Moshe Olshansky
50 %% 12 [1] 2 50 %/% 12 [1] 4 ?Arithmetic --- livia [EMAIL PROTECTED] wrote: Hello everyone, I have got a question about a simple calculation. If I would like to calculate 50/12 and return the result as 4 and the remainer 2. Is there a function of doing this? Many thanks. --

[R] mle

2007-12-19 Thread Antonio Gasparrini
Dear all, I'm trying to estimate the parameters of a special case of a poisson model, where the specified equation has an integral and several fixed parameters. I think that the MLE command in STATS4 package could be a good choice, but it's a little complicated. I've got some problems with the

Re: [R] assigning and saving datasets in a loop, with names changing with i

2007-12-19 Thread Moshe Olshansky
Won't it be simpler to do: for (i in 1:12){ data - my.fun(my.list[i])) save(data,file = paste(data,i,.RData, sep=)) } --- Marie Pierre Sylvestre [EMAIL PROTECTED] wrote: Dear R users, I am analysing a very large data set and I need to perform several data manipulations. The dataset is

Re: [R] Question about which kind of plot to use

2007-12-19 Thread Jim Lemon
Max wrote: Hi Everyone, I've got a question about data representation. I have some psychometric data with 5 scores for 15 different groups. I've been asked to show some kind of mean plots. The data below is the mean and SD for a given group, unfortunately my employer doesn't want me

[R] factor manipulation: edgelist to a matrix?

2007-12-19 Thread Christopher Marcum
Hello All, I have had considerable bad luck with attempting the following with for loops. Here is the problem: # Suppose we have a data.frame with the following data, which can be considered a type of edgelist (for those with networks backgrounds): # # V1 V2 # 1 A #