Re: [R] [OT?]R Reference Manual review/recommend

2009-05-14 Thread AG
John Kane wrote: > I don't know the book but I doubt that it is a good way to learn R. > > I'd suggest having a look at some of the documentation available on the R > site. Click on Other (in left column of page) have a look there and then > select the " contributed documentation" link to get

Re: [R] Graphical output format

2009-05-14 Thread Dieter Menne
Stats Wolf gmail.com> writes: > Postscript, however, does not have to be what I need for two reasons. > First, it does not accept some special characters from foreign > languages (exactly like PDF). You should given an example for that in pdf. I always had the impression that pdf is the most co

Re: [R] How to do a pretty panel plot?

2009-05-14 Thread Ajay Shah
On Thu, May 14, 2009 at 05:09:59PM -0700, ko...@processtrends.com wrote: > Ajay > > I have added a few minor adjustments to your code to make the panel chart you > want. > You need to adjust the par(mar) to control space between 1st and 2nd plot. Thanks! This is a step forward for me. But now:

Re: [R] About the efficiency of R optimization function

2009-05-14 Thread popo UBC
Hi Charlie, Thank you so much for suggestions!! Actually, I used the optimization toolbox in MABLAB before and I even wrote some numerical optimization programs by myself. As far as I know, some commercial optimization softwares had already replaced L-BFGS-B by more advanced algorithms, such as i

Re: [R] ode first step

2009-05-14 Thread spencerg
Have you looked at the vignette in the deSolve package? (deS <- vignette('compiledCode')) # opens a "pdf" file Stangle(deS$file) # writes an R script file to "getwd()" In spite of the name, this vignette includes an example entirely in R. By comparing it with

Re: [R] About the efficiency of R optimization function

2009-05-14 Thread cls59
popo UBC wrote: > > Hi all! > > The objective function I want to minimize contains about 10 to 20 > variables, > maybe more in the future. I never solved such problems in R, so I had no > idea about the efficiency of R's optimization functions. I know doing loop > in R is quite slow, so I am n

Re: [R] Optimization algorithm to be applied to S4 classes - specifically sparse matrices

2009-05-14 Thread spencerg
Have you considered the following: solve(qr(A), B) I have not tried this with a small toy example, and the "qr" documentation in the Matrix package seems to suggest it. This solves the optimization problem you mentioned, as noted in "http://en.wikipedia.org/wiki/Linea

[R] help on Nan error

2009-05-14 Thread Umapathy Ananthanarayanan
Hi guys My data is Tasmania txt There are *N *= 16 samples, consisting of 8 replicate cores (taken from different areas across the sandflat) from each of 2 natural 'treatments' (either disturbed "D" or undisturbed "U" by soldier crab burrowing activity. The abundances of each of *p *= 56 species

[R] About the efficiency of R optimization function

2009-05-14 Thread popo UBC
Hi all! The objective function I want to minimize contains about 10 to 20 variables, maybe more in the future. I never solved such problems in R, so I had no idea about the efficiency of R's optimization functions. I know doing loop in R is quite slow, so I am not sure whether this shortage influe

Re: [R] "Fast" correlation algorithm

2009-05-14 Thread Joshua Stults
If you need auto(cross)correlations in O(n*log(n)) rather than O(n^2) you can use an FFT. Here's a good short write-up on using the FFT for this (numerical recipes chapter): http://hebb.mit.edu/courses/9.29/2002/readings/c13-2.pdf Won't get you p values, but is faster than a normal matrix-vector

Re: [R] Sweave: Howto write real TeX formula in plot

2009-05-14 Thread cls59
Bugzilla from n...@jonasstein.de wrote: > > Thank you, Baptiste and Charlie. > I found some examples wich look great on: > http://www.texample.net/tikz/examples/ > I'm glad you found Texample! It is an excellent site that shows many practical, and beautiful, demonstrations of the types of figu

Re: [R] fitdistr for t distribution

2009-05-14 Thread Jorge Ivan Velez
Dear lagreene, See the second example in require(MASS) ?fitdistr HTH, Jorge On Thu, May 14, 2009 at 7:15 PM, lagreene wrote: > > Hi, > I was wondering if anyone could tell me how m and s are calculated for a t > distribution? > > I thought m was the sample mean and s the standard deviation-

Re: [R] How to do a pretty panel plot?

2009-05-14 Thread DKOD
Ajay Shah wrote: > > The pretty picture that I saw at: > > http://chartsgraphs.wordpress.com/2009/02/09/r-panel-chart-beats-excel-chart/#more-1096 > inspired me to try something similar. The code that I wrote is: > > --snipsnip-

Re: [R] Centering R output in Sweave/LaTeX

2009-05-14 Thread cls59
Jean-Louis Abitbol-2 wrote: > > Good Day to All, > > When sweaving the following: > > \begin{table} > \centering > <>= > ftable(ifmtm$type, ifmtm$gender, ifmtm$marche , ifmtm$nfic, > dnn=c("Type","Gender","Ambulant","Visit")) > @ > \caption{Four-way cross-tabulation on all data} > \label{tab:

Re: [R] Supplying NA or Zeros in dataframe for missing factorcombinations

2009-05-14 Thread Peter Alspach
Tena koe Karsten Does your dataframe contain multiple values for the same factor combination? If not, then using expand.grid(), followed by merge() should work. If your dataframe is DF, then the following untested code should do it: fullDF <- expand.grid(factor1=levels(DF$factor1), factor2=lev

Re: [R] Object and Classes ?

2009-05-14 Thread myshare
tried that does not seem to work, for me ? Always have to specify it fully : someclass.blah(x) On Wed, May 13, 2009 at 11:10 PM, Jeff Laake wrote: > class(x)="someclass" > > then blah(x) > > will invoke blah.someclass > > Just look at all the example code in R.  For example summary.glm for > sum

Re: [R] memory usage grows too fast

2009-05-14 Thread hadley wickham
On Thu, May 14, 2009 at 6:21 PM, Ping-Hsun Hsieh wrote: > Hi All, > > I have a 1000x100 matrix. > The calculation I would like to do is actually very simple: for each row, > calculate the frequency of a given pattern. For example, a toy dataset is as > follows. > > Col1    Col2    Col3    Co

[R] fitdistr for t distribution

2009-05-14 Thread lagreene
Hi, I was wondering if anyone could tell me how m and s are calculated for a t distribution? I thought m was the sample mean and s the standard deviation- but obviously I'm wrong as this doesn'y give the same answer. Thank you -- View this message in context: http://www.nabble.com/fitdistr-for

[R] Supplying NA or Zeros in dataframe for missing factor combinations

2009-05-14 Thread Karsten Wolf
Hi there, I am not getting anywhere near a solution, so here is my question. I have searched the archives and didn't find a solution, but maybe my search didn't use the right words. So here it is: I have a dataframe with the following structure factor1 factor2 value In the (rather large) d

Re: [R] is.variable ? is.initialized ?

2009-05-14 Thread Rolf Turner
On 15/05/2009, at 11:34 AM, myshare wrote: thanx, I forgot something how then do you check if u have something like this : exists("xxx$array") this does not seem to work !! Of course not. I don't think what you want is built in. But you can easily cobble something together: !is

Re: [R] is.variable ? is.initialized ?

2009-05-14 Thread myshare
thanx, I forgot something how then do you check if u have something like this : exists("xxx$array") this does not seem to work !! ;\ On Thu, May 14, 2009 at 11:26 PM, Rolf Turner wrote: > > On 15/05/2009, at 11:19 AM, myshare wrote: > >> hi guys, >> >> How do you check if variable is initialize

Re: [R] is.variable ? is.initialized ?

2009-05-14 Thread Rolf Turner
On 15/05/2009, at 11:19 AM, myshare wrote: hi guys, How do you check if variable is initialized/created, tried : is.nan(xxx) is.null(xxx) is.na(xxx) exists(xxx) all of them return : Error: object "xxx" not found I need true/false result ? exists("xxx") # Note the quote marks; requires th

[R] memory usage grows too fast

2009-05-14 Thread Ping-Hsun Hsieh
Hi All, I have a 1000x100 matrix. The calculation I would like to do is actually very simple: for each row, calculate the frequency of a given pattern. For example, a toy dataset is as follows. Col1Col2Col3Col4 01 02 02 00 => Freq of “02” is 0.5 02

[R] is.variable ? is.initialized ?

2009-05-14 Thread myshare
hi guys, How do you check if variable is initialized/created, tried : is.nan(xxx) is.null(xxx) is.na(xxx) exists(xxx) all of them return : Error: object "xxx" not found I need true/false result ? thanx __ R-help@r-project.org mailing list https://s

Re: [R] SQL Queries from Multiple Servers

2009-05-14 Thread Paul Gilbert
Tom Schenk Jr wrote: I use RODBC as my conduit from R to SQL. It works well when the tables are stored on one channel, e.g., channel <- odbcConnect("data_base_01", uid="", dsn="") However, I often need to match tables across multiple databases, e.g., "data_base_01" and "data_base_02". H

Re: [R] Duplicates and duplicated

2009-05-14 Thread William Dunlap
Gabor, My f2 was just wrong. It should have been f2 <- function(x, n=2){ ix<-match(x,x); tix<-tabulate(ix); ix %in% which(tix>=n) } which would be roughly the same as your f1 <- function(x, n=2) ave(x,x,FUN=length)>=n and flags all elements of x with >= n repetitions. ave() involves a cal

Re: [R] R: corrupted smoothing kernel ?

2009-05-14 Thread Rolf Turner
On 15/05/2009, at 10:04 AM, mau...@alice.it wrote: I have just installed R2.9.0 on my Windows XP system. I have followed the same installation procedure I have been using for over a year. That is installation from the "exe" file. "kernel" belongs to package "stats"which is (I think) installe

Re: [R] Duplicates and duplicated

2009-05-14 Thread William Dunlap
> -Original Message- > From: Bert Gunter [mailto:gunter.ber...@gene.com] > Sent: Thursday, May 14, 2009 2:31 PM > To: William Dunlap; 'Gabor Grothendieck'; 'christiaan pauw'; > 'jim holtman' > Cc: r-help@r-project.org > Subject: RE: [R] Duplicates and duplicated > > > Thanks, Bill. I a

[R] R: corrupted smoothing kernel ?

2009-05-14 Thread mauede
I have just installed R2.9.0 on my Windows XP system. I have followed the same installation procedure I have been using for over a year. That is installation from the "exe" file. "kernel" belongs to package "stats"which is (I think) installed by default. I loaded it but did not use the command:

Re: [R] can you tell what .Random.seed *was*?

2009-05-14 Thread G. Jay Kerns
Dear Duncan, On Thu, May 14, 2009 at 4:39 PM, Duncan Murdoch wrote: > On 5/14/2009 3:36 PM, G. Jay Kerns wrote: >> Question: >> 1) can you tell me what my original set.seed() value was?  (I wouldn't >> be able to figure it out, but maybe someone can) > > The only way I know is to test all 2^32 p

Re: [R] Duplicates and duplicated

2009-05-14 Thread Gabor Grothendieck
I don't think that that is the conclusion. All the solutions solve the original problem and the additional "requirements" may or may not be what is wanted in any particular case. The ave solution propagates the NA which seems like the right thing to do whereas the f2 solution and the duplicated s

Re: [R] Function to read a string as the variables as opposed totaking the string name as the variable

2009-05-14 Thread Bert Gunter
As Hadley said, it's complex in general: the standard approach is to assemble the arguments into a list and then use do.call -- ?do.call. Undoubtedly, there are times where this won't do either (at least not without some further tricks). -- Bert Bert Gunter Genentech Nonclinical Biostatistics

[R] mathematical model/equations for neural network in library(nnet)

2009-05-14 Thread jude.ryan
Hi All, I am trying to manually extract the scoring equations for a neural network so that I can score clients on a system that does not have R (mainframe using COBOL). Using the example in Modern Applied Statistics with S (MASS), by Venables and Ripley (VR), pages 246 and 247, I ran the follo

Re: [R] Duplicates and duplicated

2009-05-14 Thread Bert Gunter
Thanks, Bill. I also had some concerns about how reliable numeric values converted to character might be, so I'm glad to have an authoritative criticism. Of course, I was really just being cute with R's versatility. But Jim Holtman's solution seems like the best way to go, anyway, does it not?

Re: [R] Problem with viewports, print.trellis and more/newpage

2009-05-14 Thread Deepayan Sarkar
On Thu, May 14, 2009 at 1:58 PM, Sebastien Bihorel wrote: > Dear R-users, > > I have got the following problem. I need to create 4x2 arrays of xyplot's on > several pages. The plots are created within a loop and plotted using the > print function. It seems that I cannot find the proper grid syntax

Re: [R] "Fast" correlation algorithm

2009-05-14 Thread Greg Snow
Well if your matrix and vector are centered and properly scaled (and there are no missing values), then the correlations are just a crossproduct and matrix arithmetic is already fairly fast (assuming you have enough memory). -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain

[R] Problem with viewports, print.trellis and more/newpage

2009-05-14 Thread Sebastien Bihorel
Dear R-users, I have got the following problem. I need to create 4x2 arrays of xyplot's on several pages. The plots are created within a loop and plotted using the print function. It seems that I cannot find the proper grid syntax with my viewports, and the more/newpage arguments. The follow

Re: [R] automated polynomial regression

2009-05-14 Thread milton ruser
Also coef(mylm) where you can deal with coef(mylm) [1], coef(mylm)[2]... And plot(y~x, data=mydf) curve(coef(mylm)[1]+coef(mylm)[2]*x) could produce interesiting visual results :-) milton On Thu, May 14, 2009 at 2:30 PM, Dieter Wirz wrote: > Thanks Bert and Luc! > Sometimes the solutio

[R] How to do a pretty panel plot?

2009-05-14 Thread Ajay Shah
The pretty picture that I saw at: http://chartsgraphs.wordpress.com/2009/02/09/r-panel-chart-beats-excel-chart/#more-1096 inspired me to try something similar. The code that I wrote is: --snipsnip- M <- structure(list(date

[R] Problems intalling on Suse 10.3 x86_64 OS

2009-05-14 Thread PDXRugger
Alright, i am unsure of the posting rules for these types of questions but i will be as help ful as possible. My windows based system cant handle a model i am running so i am trying to install R on our Linux based machine but i have encountered the following and i dont know linux much but my intu

[R] "Fast" correlation algorithm

2009-05-14 Thread jastar
Hi, Is in R any "fast" algorithm for correlation? What I mean is: I have very large dataset (microarray) with 55000 rows and 100 columns. I want to count correlation (p-value and cor.coef) between each row of dataset and some vector (of course length of this vector is equal to number of columns of

Re: [R] can you tell what .Random.seed *was*?

2009-05-14 Thread Duncan Murdoch
On 5/14/2009 3:36 PM, G. Jay Kerns wrote: Dear R-help, Suppose I write a script that looks something like this: script.R set.seed(something) x <- rnorm(100) y <- runif(500) # bunch of other stuff save.image() ### end of script.R Now, I give you a copy of my script.R (with the set.see

Re: [R] Importing data into R and combining 2 files

2009-05-14 Thread Andy Choens
On Thu, 2009-05-14 at 10:30 -0700, Sunita22 wrote: > Hello > > I have to import 2 txt files into R. 1 file contains the data and the other > contains the header, column headings, datatypes and labels for the data. > This is your first complicating factor. > I have 2 problems: > > 1) my data fi

Re: [R] I want to avioid unnecessary value

2009-05-14 Thread Jorge Ivan Velez
Dear Grzés, I am not sure whether I fully understand your question, but try either one of the following options: # Data set from Dimitri Liakhovitski's reply df <- data.frame(kol1=c(2,9,4,3),kol2=c(5,6,6,2),kol3=c(9,6,5,1)) # Option 1 with(df, df[ kol1 != 9 & kol2 != 9 & kol3 != 9, ]) # Option

Re: [R] KNN script: Identity of specific K samples chosen?

2009-05-14 Thread Max Kuhn
> I am currently doing some prediction work using the knn script in the > 'class' package. Does anyone know a way of having R return the IDs (sample > IDs, or column IDs of the training matrix) of the 'k' samples that are > chosen by the algorithm as being nearest to a given test sample? You would

[R] can you tell what .Random.seed *was*?

2009-05-14 Thread G. Jay Kerns
Dear R-help, Suppose I write a script that looks something like this: script.R set.seed(something) x <- rnorm(100) y <- runif(500) # bunch of other stuff save.image() ### end of script.R Now, I give you a copy of my script.R (with the set.seed statement removed, of course) together wit

[R] assign unique size of point in xyplot

2009-05-14 Thread Garritt Page
Hello,I am using xyplot to try and create a conditional plot. Below is a toy example of the type of data I am working with slevel <- rep(rep(c(0.5,0.9), each=2, times=2), times=2) tlevel <- rep(rep(c(0.5,0.9), each=4), times=2) noutliers <- rep(rep(c(2,4), times=4), times=2) analysis <- as.fac

Re: [R] automated polynomial regression

2009-05-14 Thread Dieter Wirz
Thanks Bert and Luc! Sometimes the solution is close, but I did not find it I always tried mylm$Coefficients... Stupid /me. -didi BTW: many thanks to all developers of R. IMHO R is one of the most outstanding free projects! On Thu, May 14, 2009 at 7:07 PM, Bert Gunter wrote: > > -- but it i

Re: [R] Bayesian Model Averaging

2009-05-14 Thread Greg Snow
The problem is not with the BMA function, but rather that you have made the common mistake of forgetting that you are smarter than the computer. The variable Y below is a data frame (not a single numeric vector). Now a smart person like you sees a single column in the data frame and understand

Re: [R] Function to read a string as the variables as opposed to taking the string name as the variable

2009-05-14 Thread Marc Schwartz
On May 14, 2009, at 12:16 PM, Lori Simpson wrote: I am writing a custom function that uses an R-function from the reshape package: cast. However, my question could be applicable to any R function. Normally one writes the arguments directly into a function, e.g.: result=cast(table1, column1 +

Re: [R] [OT?]R Reference Manual review/recommend

2009-05-14 Thread John Kane
I don't know the book but I doubt that it is a good way to learn R. I'd suggest having a look at some of the documentation available on the R site. Click on Other (in left column of page) have a look there and then select the " contributed documentation" link to get more documentation. Hav

[R] Bayesian Model Averaging

2009-05-14 Thread David S. Schwarz
Hello R Group, Below is the code I submit: library("BMA") X <- read.table("C:/Documents and Settings/Administrator/Desktop/coding.txt",header=TRUE) Y <- read.table("C:/Documents and Settings/Administrator/Desktop/1DCS.txt",header=TRUE) IGout<- iBMA.glm(X, Y, glm.family= gaussian(), ve

Re: [R] Function to read a string as the variables as opposed to taking the string name as the variable

2009-05-14 Thread hadley wickham
On Thu, May 14, 2009 at 12:16 PM, Lori Simpson wrote: > I am writing a custom function that uses an R-function from the > reshape package: cast.  However, my question could be applicable to > any R function. > > Normally one writes the arguments directly into a function, e.g.: > > result=cast(tabl

[R] KNN script: Identity of specific K samples chosen?

2009-05-14 Thread Ryan van Laar
I am currently doing some prediction work using the knn script in the 'class' package. Does anyone know a way of having R return the IDs (sample IDs, or column IDs of the training matrix) of the 'k' samples that are chosen by the algorithm as being nearest to a given test sample? I have searched/r

[R] Function to read a string as the variables as opposed to taking the string name as the variable

2009-05-14 Thread Lori Simpson
I am writing a custom function that uses an R-function from the reshape package: cast. However, my question could be applicable to any R function. Normally one writes the arguments directly into a function, e.g.: result=cast(table1, column1 + column2 + column3 ~column4, mean) (1

Re: [R] Duplicates and duplicated

2009-05-14 Thread William Dunlap
The table()-based solution can have problems when there are very closely spaced floating point numbers in x, as in x1<-c(1, 1-.Machine$double.eps, 1+2*.Machine$double.eps)[c(1,2,3,2,3)] It also relies on table(x) turning x into a factor with the default levels=as.character(sort(x)) and that defa

Re: [R] Histogram + % of cases for a given criteria

2009-05-14 Thread S. Nunes
Hi, Thanks for the contribution. I tested the code but I got a couple or errors. I'll try to debug these in the next days. Maybe there is a simpler approach to what I am trying to do. I have a bunch of measures and a column with the success of the case (1/0). I simply want to evaluate my measure

Re: [R] Importing data into R and combining 2 files

2009-05-14 Thread Sunita Patil
Hello Yes I have used read.table("file name", sep="\t") for reading the text file Thank you On Thu, May 14, 2009 at 11:07 PM, jim holtman wrote: > What have you tried? Check the Intro manual for hints. > > ?read.table probably using sep='\t' > > On Thu, May 14, 2009 at 1:30 PM, Sunita22 wr

Re: [R] Importing data into R and combining 2 files

2009-05-14 Thread jim holtman
What have you tried? Check the Intro manual for hints. ?read.table probably using sep='\t' On Thu, May 14, 2009 at 1:30 PM, Sunita22 wrote: > > Hello > > I have to import 2 txt files into R. 1 file contains the data and the other > contains the header, column headings, datatypes and labels f

[R] Importing data into R and combining 2 files

2009-05-14 Thread Sunita22
Hello I have to import 2 txt files into R. 1 file contains the data and the other contains the header, column headings, datatypes and labels for the data. I have 2 problems: 1) my data file has mixed type of data e.g. 1 2 3 4 5 3-5 02/04/06 3 4 5 and so on, the data file is tab separated. when

[R] text() to label points in ggplot

2009-05-14 Thread stephenb
is there a way to label points in a graph using text(locator(1),"text") after ggplot() or qplot() ? > qplot(date, psavert, data = economics, geom = "line",main="jhdjd")->p > p+opts(text(locator(1),""),new=T) does not work. -- View this message in context: http://www.nabble.com/text%28%29-t

Re: [R] Duplicates and duplicated

2009-05-14 Thread jim holtman
Don't think I have seen this one come across: > x <- c(1,2,3,2,4,4,6,1) > duplicated(x) | duplicated(x, fromLast=TRUE) [1] TRUE TRUE FALSE TRUE TRUE TRUE FALSE TRUE On Thu, May 14, 2009 at 12:09 PM, Bert Gunter wrote: > ... or, similar in character to Gabor's solution: > > tbl <- table(x)

Re: [R] automated polynomial regression

2009-05-14 Thread Bert Gunter
-- but it is preferable to use the appropriate access functions: coef(mylm) ?coef Bert Gunter Nonclinical Biostatistics 467-7374 ## Now, what I believe you're looking for ; mylm$coefficients ; Cheers, -- *Luc Villandré* /Biostatistician McGill University Health Center - Montreal Child

Re: [R] automated polynomial regression

2009-05-14 Thread Luc Villandre
Dieter Wirz wrote: Dear all - We perform some measurements with a machine that needs to be recalibrated. The best calibration we get with polynomial regression. The data might look like follows: true_y <- c(1:50)*.8 # the real values m_y <- c((1:21)*1.1, 21.1, 22.2, 23.3 ,c(25:50)*.9)/0.3-5.

Re: [R] Strip labels: use xyplot() to plot columns in parallel with outer=TRUE

2009-05-14 Thread Deepayan Sarkar
On 5/9/09, John Maindonald wrote: > The following tinkers with the strip labels, where the > different panels are for different levelf of a conditioning > factor. > > tau <- (0:5)/2.5; m <- length(tau); n <- 200; SD <- 2 > x0 <- rnorm(n, mean=12.5, sd=SD) > matdf <- data.frame( >x = as.ve

[R] automated polynomial regression

2009-05-14 Thread Dieter Wirz
Dear all - We perform some measurements with a machine that needs to be recalibrated. The best calibration we get with polynomial regression. The data might look like follows: > true_y <- c(1:50)*.8 > # the real values > m_y <- c((1:21)*1.1, 21.1, 22.2, 23.3 ,c(25:50)*.9)/0.3-5.2 > # the measured

Re: [R] creating a postscript file with two xyplots

2009-05-14 Thread Deepayan Sarkar
On 5/13/09, Liati wrote: > > Hi, > Thank you for your reply. > This is exactly what I have done. > However, I would like to get the two plots next to each other (to use as one > figure). Look at ?print.trellis and its examples. -Deepayan __ R-hel

Re: [R] specify the number of decimal numbers

2009-05-14 Thread Wacek Kusnierczyk
(Ted Harding) wrote: > > This happens also when you use C's fprintf and sprintf (at any rate > in my gcc): > r's printing routines (e.g., print, sprintf, cat, anything else?) seem to rely on the underlying c sprintf, with no prior r-implemented rounding. hence they import into r whatever stand

Re: [R] specify the number of decimal numbers

2009-05-14 Thread Ted Harding
On 14-May-09 15:15:16, James W. MacDonald wrote: > Wacek Kusnierczyk wrote: >> (Ted Harding) wrote: >>> On 14-May-09 12:27:40, Wacek Kusnierczyk wrote: >>> ... but remember that sprintf introduces excel bugs into r (i.e., rounding is not done according to the IEC 60559 standard, see >

[R] Rpart - user defined split functions

2009-05-14 Thread Paolo Radaelli
Dear all, I'm writing my own method to be used in Rpart by defining the list of functions named init, split and eval. I'm following the example given in the file 'tests/usersplits.R' in the sources. By now I'm able to define the split function (and it works correctly in the tree construction) w

Re: [R] Duplicates and duplicated

2009-05-14 Thread Bert Gunter
... or, similar in character to Gabor's solution: tbl <- table(x) (tbl[as.character(sort(x))]>1)+0 Bert Gunter Nonclinical Biostatistics 467-7374 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Gabor Grothendieck Sent: Thursday, M

Re: [R] I want to avioid unnecessary value

2009-05-14 Thread Dimitri Liakhovitski
I am not sure what you are trying to achive. How about: df<-data.frame(kol1=c(2,9,4,3),kol2=c(5,6,6,2),kol3=c(9,6,5,1)) (df) new.df<-df[(!(df[[1]] %in% 9)&!(df[[2]] %in% 9)&!(df[[3]] %in% 9)),] (new.df) But why would you want to delete all the valid values in all the other columns if you have you

Re: [R] specify the number of decimal numbers

2009-05-14 Thread Wacek Kusnierczyk
James W. MacDonald wrote: > Wacek Kusnierczyk wrote: >> do they make pompous claims about their software and disregarding claims >> about others' as well? > > My mistake. I thought your concern was for the quality of the software > (quality of course being defined by a certain committee of one). Bu

[R] using multiple matrices

2009-05-14 Thread Penner, Johannes
Dear R-list, another question trying to build consensus cluster ;-) Using the package "clue" I have found a method of building consensus clusters the following way from one distance matrix: clust1 <- c("ward", "single", "complete", "average", "mcquitty", "median", "centroid") clust_res <- lapply

[R] Bayesian 2*2 table independence test

2009-05-14 Thread Christian Hennig
Dear list, I'd like to test the null hypothesis of independence in a 2*2 contingency table in a Bayesian way. As far as I can see, this can be done by the function ctable in library LearnBayes. (More precisely, a Bayes factor can be computed.) Two questions: 1) Is there any other package/func

Re: [R] specify the number of decimal numbers

2009-05-14 Thread James W. MacDonald
Wacek Kusnierczyk wrote: do they make pompous claims about their software and disregarding claims about others' as well? My mistake. I thought your concern was for the quality of the software (quality of course being defined by a certain committee of one). But it appears this is of a more per

[R] can I plot a matrix of colors?

2009-05-14 Thread dxc13
Hi all, I have a 36x14 matrix of hexadecimal coded colors (see attached file) that was created with the following code: cellcol[is.na(cellcol)] <- "#00" #Aliceblue cellcol[cellcol < 5] <- "#F0F8FF" #Skyblue1 cellcol[cellcol >= 5 & cellcol < 20] <- "#87CEFF" #Blue cellcol[cellcol >= 20 & cellc

[R] I can't install RWeka

2009-05-14 Thread Grześ
If I want to install RWeka I get an error: > library("RWeka") Error occurred during initialization of VM java.lang.OutOfMemoryError: unable to create new native thread Could you have any idea to help me? -- View this message in context: http://www.nabble.com/I-can%27t-install-RWeka-tp23542141

[R] I want to avioid unnecessary value

2009-05-14 Thread Grześ
I have a database like this: "kol1";"kol2";"kol3" ... "2";"5";"9" "9";"6";"6" "4";"6";"5"... I looking for a kod in R which let mi aviod in column unnecessary value, for example number "9". So, if I have: Kol1 2 9 4 4... after loop in R I would like to get my column like this: Kol1 2 4 4..

[R] EM algorithm for mixture of two Weibull distributions (Urgent)

2009-05-14 Thread Ndoye Abdoul aziz
Good morning. I want to estimate a mixture of two Weibull distribution by using the EM algorithm . Does it exist an available package to do that ? Or if not, Is it some avaible EM Algorithm ? Thanks Cordially Abdoul Aziz Junior NDOYE GREQAM Marseille. [[alternative HT

Re: [R] specify the number of decimal numbers

2009-05-14 Thread Wacek Kusnierczyk
James W. MacDonald wrote: > > > Wacek Kusnierczyk wrote: >> (Ted Harding) wrote: >>> On 14-May-09 12:27:40, Wacek Kusnierczyk wrote: >>> ... but remember that sprintf introduces excel bugs into r (i.e., rounding is not done according to the IEC 60559 standard, see ?round): >>

Re: [R] plotting multiple data sources

2009-05-14 Thread Greg Snow
It is not recommended to plot variables on different scales on the same graph. You can use something like par(mfrow=...) (see ?par) to stack graphs on top of each other (or next to each other, or both) for easy comparison, but each with their own scales/axes. If you have considered all that an

Re: [R] specify the number of decimal numbers

2009-05-14 Thread James W. MacDonald
Wacek Kusnierczyk wrote: (Ted Harding) wrote: On 14-May-09 12:27:40, Wacek Kusnierczyk wrote: ... but remember that sprintf introduces excel bugs into r (i.e., rounding is not done according to the IEC 60559 standard, see ?round): ns = c(0.05, 0.15) round(ns, 1) # 0.0 0.2

Re: [R] specify the number of decimal numbers

2009-05-14 Thread Wacek Kusnierczyk
(Ted Harding) wrote: > On 14-May-09 12:27:40, Wacek Kusnierczyk wrote: > >> >> ... but remember that sprintf introduces excel bugs into r (i.e., >> rounding is not done according to the IEC 60559 standard, see ?round): >> >> ns = c(0.05, 0.15) >> round(ns, 1) >> # 0.0 0.2 >> as.

Re: [R] Duplicates and duplicated

2009-05-14 Thread Gabor Grothendieck
Noting that: > ave(x, x, FUN = length) > 1 [1] FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE try this: > rbind(x, dup = ave(x, x, FUN = length) > 1) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] x 123445678 9 dup000

Re: [R] question about setClass

2009-05-14 Thread Uwe Ligges
Erin Hodgess wrote: Hi R People: I have a question about setClass please. I'm working thru "R Programming for Bioinformatics". Actually, I was wondering if there is such a thing as an updateClass, in order to change a "contains" option, please? that is, if I had setClass("dog", representat

Re: [R] corrupted smoothing kernel ?

2009-05-14 Thread Uwe Ligges
mau...@alice.it wrote: I am trying to use the "kernel" function. To understand how it works I tried out some of the examples. None of them works as shown in the following: kernel("daniell", 50) # Error in kernel("daniell", 50) : unused argument(s) (50) which works for me. Have you

[R] dissimilarities table factorial analysis

2009-05-14 Thread Lassana TOURE
I have genetic data, and I would like to do an dissimilariry table of the factorial analysis. What package should I use and the command line? Lassana TOURE [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https:

Re: [R] Simulation

2009-05-14 Thread Wacek Kusnierczyk
Stefan Grosse wrote: > Debbie Zhang schrieb: > >> Now, I am trying to obtain the sample variance (S^2) of the 1000 samples >> that I have generated before. >> >> I am wondering what command I should use in order to get the sample variance >> for all the 1000 samples. >> >> >> >> What I am ca

Re: [R] 3dscatter for linux

2009-05-14 Thread Uwe Ligges
threshold wrote: Hi, do you have any suggestions how to make 3D scatterplot, BUT under linux. Worth mentioning is the fact that 'scatterplot3d' does not load under Ubuntu 8.10. Why not? It is in pure R code, hence it is just as OS dependent as R itself. Uwe Ligges Do you know any alternat

[R] extract decision tree from rpart

2009-05-14 Thread lehe
Hi, I am using rpart for my decision stump. I am trying to extract the learned stump from the output of rpart. For example: cntrl <- rpart.control(maxdepth = 1, minsplit = learn-1, maxsurrogate = 0, usesurrogate=0, maxcompete = 1, cp = 0,

Re: [R] Data extraction problem after importation using RODBC

2009-05-14 Thread Dieter Menne
Axel Leroix wrote: > > > Then I perform an lm regression using the following code: > reg1 <-lm(data$prod~data$pri+data$cli) > summary(reg1) > Use reg1 <-lm(prod~pri+cli, data=data) instead. It is not necessary to call the data frame you read your stuff into "data", any more useful name,

Re: [R] replacing default axis labels on a plot

2009-05-14 Thread Uwe Ligges
Graves, Gregory wrote: Thanks. But ... Still don't get it. Referring explicitly to the monthname column which had many entries across many years did not work. So taking your clue I created a new variable list of names of month month.name<-list(c("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Ju

Re: [R] specify the number of decimal numbers

2009-05-14 Thread Ted Harding
On 14-May-09 12:27:40, Wacek Kusnierczyk wrote: > jim holtman wrote: >> Depending on what you want to do, use 'sprintf': >> >>> x <- 1.23456789 >>> x >> [1] 1.234568 >> >>> as.character(x) >> [1] "1.23456789" >> >>> sprintf("%.1f %.3f %.5f", x,x,x) >> [1] "1.2 1.235 1.23457" >> > ... b

Re: [R] latex.table used with mixed string and numbers

2009-05-14 Thread Dieter Menne
lehe wrote: > > I am using latex.table to write my results into a latex table. If my > results is like a matrix except that some column has strings and others > have numbers. Is it possible to feed my results into latex.table? > Such a matrix-like structure is called a dataframe. See latex in

Re: [R] replacing default axis labels on a plot

2009-05-14 Thread Graves, Gregory
Thanks. But ... Still don't get it. Referring explicitly to the monthname column which had many entries across many years did not work. So taking your clue I created a new variable list of names of month month.name<-list(c("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "N

Re: [R] Simulation

2009-05-14 Thread Linlin Yan
Since you got the most suitable way to get x, why can't you get the variances in the same way? Just like: v = vector() for (i in 1:length(x)) v[i] = var(x[[i]]) BTW, it is much better to use lapply, like this: lapply(x, var) On Thu, May 14, 2009 at 8:26 PM, Debbie Zhang wrote: > > Thanks f

Re: [R] Checking a (new) package - examples require other package functions

2009-05-14 Thread spencerg
Another way of making functions visible to examples is to list the package name as "Depends" in the package "DESCRIPTION" file. Alternatively, if you precede use in "\examples" with "library(packageName)", you should also list it as "Suggests" in "DESCRIPTION". Hope this helps. Sp

Re: [R] scatterplot3d

2009-05-14 Thread Nair, Murlidharan T
-Original Message- From: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de] Sent: Thursday, May 14, 2009 4:44 AM To: Nair, Murlidharan T Cc: r-help@r-project.org Subject: Re: [R] scatterplot3d Nair, Murlidharan T wrote: > Does anyone have any suggestion on this? I tried par(new="T")

Re: [R] Simulation

2009-05-14 Thread Stefan Grosse
Debbie Zhang schrieb: > Now, I am trying to obtain the sample variance (S^2) of the 1000 samples that > I have generated before. > > I am wondering what command I should use in order to get the sample variance > for all the 1000 samples. > > > > What I am capable of doing now is just typing in

  1   2   >