Re: [R] RODBC sqlSave with DB2

2009-05-29 Thread Prof Brian Ripley
On Fri, 29 May 2009, Elaine Jones wrote: I am running R version 2.8.1 on Windows XP OS. This works fine. (Data.frame dta is created with records from the DB2 table.): sql <- "select * from storage.testappend_slt order by uut" dta <- sqlQuery(channel,sql) But when I try to append records (fro

Re: [R] R's documentation

2009-05-29 Thread Zeljko Vrba
On Fri, May 29, 2009 at 05:20:24PM +0100, Patrick Burns wrote: > > If you find some documentation that is > confusing, then you can write a message > about it that states: > I think that some kind of a glossary would be helpful. Then I would know whether certain words or phrases are R-specific o

Re: [R] How to set a filter during reading tables

2009-05-29 Thread Juliet Hannah
One can use colClasses to set which columns get read in. For the columns you don't want you can set those to NULL. For example, cc <- c("NULL",rep("numeric",9)) myData <- read.table("myFile.txt",header=TRUE,colClasses=cc,nrow=numRows). On Wed, May 27, 2009 at 12:27 PM, wrote: > We are reading

[R] 'options=utils::recover' not working in .Rprofile or within R

2009-05-29 Thread Mark Kimpel
For years I have been using options(error = recover) either in .Rprofile or from within R for debugging purposes. The functionality of this appears to have changed and I can't recover it (no pun intended) using the ?options help page. How can I get the old functionality back, particularly from with

Re: [R] logical vector as a matrix

2009-05-29 Thread Jorge Ivan Velez
Dear Grzés, Try h[ !is.na(h) ] # or h[g] HTH, Jorge On Fri, May 29, 2009 at 2:48 PM, Grze¶ wrote: > > I have a vector like this: > h <- c(4, 6, NA, 12) > and I create the secound logical vector like this: > g <- c(TRUE, TRUE, FALSE, TRUE) > > And my problem is that I would like to get a

Re: [R] logical vector as a matrix

2009-05-29 Thread Linlin Yan
On Sat, May 30, 2009 at 2:48 AM, Grześ wrote: > > I have a vector like this: > h <- c(4, 6, NA, 12) > and I create the secound logical vector like this: > g <- c(TRUE, TRUE, FALSE, TRUE) Why don't you create vector g like this: g <- ! is.na(h) > > And my problem is that I would like to get  a new

Re: [R] Odd Behavior Out of setdiff(...) - addition of duplicate entries is not identified

2009-05-29 Thread G. Jay Kerns
Jason, On Fri, May 29, 2009 at 5:58 PM, Jason Rupert wrote: > > Jay, > > > Thanks much for the reply.    I think you are right about the prob. > Unfortunately, I was not able to find the old emails I had discussing the use > of the more powerful setdiff that essentially inherits from the base c

Re: [R] SEM/path question

2009-05-29 Thread spencerg
Dear Erin: I do not have a direct answer to your question, but the following quickly identified for me just now 244 help pages in contributed packages that mentioned either "path analysis" or "SEM", sorted to put first the package with the most such hits: pa <- RSiteSearch.function(

[R] logical vector as a matrix

2009-05-29 Thread Grześ
I have a vector like this: h <- c(4, 6, NA, 12) and I create the secound logical vector like this: g <- c(TRUE, TRUE, FALSE, TRUE) And my problem is that I would like to get a new "m" vector as a rasult "h" and "m" but with missed "NA" value, for example: m = (4,6,12) Do you have any idea?

[R] validity of means comparison: unbalanced + weights

2009-05-29 Thread Dylan Beaudette
Hi, I have a quick statistics-related question. I would like to perform a comparison of means across treatments using a linear model framework. However, my 'baseline' treatment has many more observations than either of the other two treatments and the variance within each treatment is different

Re: [R] save plm coefficients

2009-05-29 Thread spencerg
I'm not sure what you are asking, especially since I do not have access to "regaccdis". However, will something like the following do what you want? caeLvls <- c(1, 5, 10) for(i in 1:3) coef[i,2:4] <- coef(plm(ff,data=regaccdis,na.action=na.omit,model="pooling",subset=(regaccdis$caedois==cae

Re: [R] strange behavior when reading csv - line wraps

2009-05-29 Thread jim holtman
You need to supply the actual input line so we can see what is happening. Are you sure you do not have unbalanced quotes in your input (try quote='') or do you have comment characters ("#") in your input? On Fri, May 29, 2009 at 3:15 PM, Martin Tomko wrote: > Dear All, > I am observing a strange

Re: [R] code optimization problem ... using or not using "which"function

2009-05-29 Thread krzysztof . sakrejda
Why not use the 'merge' function? Krzysztof Sent via BlackBerry by AT&T -Original Message- From: jim holtman Date: Fri, 29 May 2009 20:55:12 To: Juan Carlos Laguardia Cc: Subject: Re: [R] code optimization problem ... using or not using "which" function For a start, do all

Re: [R] code optimization problem ... using or not using "which" function

2009-05-29 Thread jim holtman
For a start, do all your conversions to character and Date once outside the loop so you are not doing them for each iteration. Not exactly sure what you are doing, but it looks like with the 'and's you are only checking for the rows that are the same. You might want to use a 'match' function like

[R] Help for running R2WINBUGS in VISTA

2009-05-29 Thread satrajit roychoudhury
Dear, I am running the following R code using the R2WINBUGS package. fit<-bugs( model.file=BUGScode, data=data, inits = list(geninits1,geninits2), parameters.to.save=keepers, n.chains=nchains, n.iter=runs, n.burnin=burn, n.thin=nthin, bugs.directory="C:/Program Files/WinBUGS14" ) I p

[R] Quantile GAM?

2009-05-29 Thread Jonathan Greenberg
R-ers: I was wondering if anyone had suggestions on how to implement a GAM in a quantile fashion? I'm trying to derive a model of a "hull" of points which are likely to require higher-order polynomial fitting (e.g. splines)-- would quantreg be sufficient, if the response and predictors ar

[R] code optimization problem ... using or not using "which" function

2009-05-29 Thread Juan Carlos Laguardia
hello all, I have two data sets that share certain fields of of interest ( facility, unit, date) which I want to match up, and from this extract information from one dataset and store it in the other. my first initial idea (which I know is bad) goes like this: ## capacity and new_trayloc are

[R] Problem making a package using S4 objects.

2009-05-29 Thread Fernando Martins
Hello. I've developed an algorithm in R which I need to package. The implementation uses S4 objects and it's divided in 5 files. Everything is working fine when I load the files into the R console but when I try to make a package I get an error that I don't quite understand. Here's what I do: *1

Re: [R] Odd Behavior Out of setdiff(...) - addition of duplicate entries is not identified

2009-05-29 Thread David Winsemius
But I get: #omitted initial line which would have create an object only to be overwritten. > Test1_DF<-data.frame(HouseSize=c(1:100), LandLocation=c("Here"), Price = c("Low")) > Test2_DF<-rbind(Test1_DF, Test1_DF) > setdiff(Test1_DF, Test2_DF) HouseSize LandLocation Price 1 1

Re: [R] Odd Behavior Out of setdiff(...) - addition of duplicate entries is not identified

2009-05-29 Thread Jason Rupert
Jay, Thanks much for the reply.I think you are right about the prob. Unfortunately, I was not able to find the old emails I had discussing the use of the more powerful setdiff that essentially inherits from the base class R setdiff functionality but extends that functionality by now work

[R] RODBC sqlSave with DB2

2009-05-29 Thread Elaine Jones
I am running R version 2.8.1 on Windows XP OS. This works fine. (Data.frame dta is created with records from the DB2 table.): sql <- "select * from storage.testappend_slt order by uut" dta <- sqlQuery(channel,sql) But when I try to append records (from data.frame newdta) to the same DB2 table

Re: [R] probably simple paste question solved: please ignore

2009-05-29 Thread Bert Gunter
Actually, you still do not have what you originally specified: you have produced a character vector of length 4 where your original post indicated that you wanted a single character string seprating the four values by a space. For this you want: paste("stuff",paste(ya,collapse=" "), sep =" ") --

[R] ggplot2 date help (minor gridlines months and major grid lines years in a readable format)

2009-05-29 Thread stephen sefick
library(ggplot2) melt.updn <- (structure(list(date = structure(c(11808, 11869, 11961, 11992, 12084, 12173, 12265, 12418, 12600, 12631, 12753, 12996, 13057, 13149, 11808, 11869, 11961, 11992, 12084, 12173, 12265, 12418, 12600, 12631, 12753, 12996, 13057, 13149), class = "Date"), variable = structur

[R] possible bug in "sspir" package?

2009-05-29 Thread Mark Scheuerell
Greetings, I sent the message below to the developer of the contributed R package "sspir", but have yet to receive any response. I would be very grateful for any advice people have on the matter. Thanks, Mark Original Message Subject:possible bug in sspir? Date:

Re: [R] SEM/path question

2009-05-29 Thread William Revelle
Dear Erin, I agree with John that one should be careful about taking SEMs too seriously. For another good book on sem and path models, look at John Loehlin's book. Address = {Mahwah, N.J.}, Author = {Loehlin, John C}, Edition = {4th}, Publisher = {L. Erlbaum Asso

Re: [R] Odd Behavior Out of setdiff(...) - addition of duplicate entries is not identified

2009-05-29 Thread G. Jay Kerns
Dear Jason, On Fri, May 29, 2009 at 2:48 PM, Jason Rupert wrote: > > I think I am using the improved version of setdiff(...) that handles > data.frames, so I think some odd behavior was expected but this one is > escaping me. > > It appears that the the addition of duplicate entries is not caug

Re: [R] SEM/path question

2009-05-29 Thread John Fox
Dear Erin, Although it's very old now, I like Duncan's Introduction to Structural Equation Modeling (Academic Press, 1975); for a more complete treatment, although it too is pretty old, Bollen, Structural Equations with Latent Variables (Wiley, 1989). I have notes and other materials from a short

[R] Help installing sna on Solaris 10/Intel

2009-05-29 Thread Sul, Young L
Hi, I've been trying to install the statnet package on my Solaris 10/Intel system. I've been having problems with one of the dependencies, sna. During the compile, it always fails and complains about __builtin_isnan (please see below for output). I have tried installing this using Sun Studio 12,

Re: [R] maxtrix to permutation vector

2009-05-29 Thread Gabor Grothendieck
Try this: > m <- matrix(1:9, 3, dimnames = list(R = letters[1:3], C = LETTERS[1:3])) > as.data.frame.table(m, responseName = "Value") R C Value 1 a A 1 2 b A 2 3 c A 3 4 a B 4 5 b B 5 6 c B 6 7 a C 7 8 b C 8 9 c C 9 On Fri, May 29, 2009 at 2:08 PM, Ian Coe

Re: [R] matrix to vector

2009-05-29 Thread David Winsemius
Not sure it is really "matrix to vector" but here are a few of attempts: > abM<-matrix(1:9, nrow=3) > rownames(abM) <- letters[1:3] > colnames(abM) <- letters[4:6] > data.frame( cols=colnames(abM)[col(abM)[1:9]], rows= rownames(abM) [row(abM)[1:9]], vals=abM[1:9]) cols rows vals 1da

Re: [R] frequence of patterns in a vector

2009-05-29 Thread David Winsemius
> x <- c("ABC", "ABC", "ABC", "A02", "ABC", "RCA", "ABC", "ABC") > table(x) x A02 ABC RCA 1 6 1 > table(x)[c("ABC", "A02", "RCA")] x ABC A02 RCA 6 1 1 On May 29, 2009, at 2:15 PM, liujb wrote: Dear R users, Suppose I have a vector that consists of characters like ABC, A02, RCA,

[R] SEM/path question

2009-05-29 Thread Erin Hodgess
Dear R People: Could someone recommend a "baby book" on path analysis and SEM, please? Or if someone has an example that they use in the classroom setting, that would be very cool too. Thanks in advance, Sincerely, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematic

Re: [R] matrix to vector

2009-05-29 Thread Peter Dalgaard
Ian Coe wrote: Hi, Is there a way to convert a matrix into a vector representing all permutations of values and column/row headings with native R functions? I did this with 2 nested for loops and it took about 25 minutes to run on a ~700x700 matrix. I'm assuming there must be a smarter way

[R] apologies for the redundant emails

2009-05-29 Thread Ian Coe
Sorry about the redundant emails. I was having some email issues and did not realize they would all go through. Thanks to everybody who answered my question. Regards, Ian CONFIDENTIALITY NOTICE: This e-mail communication (inclu...{{dropped:23}} ___

[R] save plm coefficients

2009-05-29 Thread Cecilia Carmo
Hi R-helpers, I want to determine the coefficients of the following regression for several subsets, and I want to save it in a dataframe: The data is in «regaccdis», «regaccdis$caedois» is the column that defines the subsets and the function I have runned is coef(plm(ff,data=regaccdis,na.ac

[R] strange behavior when reading csv - line wraps

2009-05-29 Thread Martin Tomko
Dear All, I am observing a strange behavior and searching the archives and help pages didn't help much. I have a csv with a variable number of fields in each line. I use dataPoints <- read.csv(inputFile, head=FALSE, sep=";",fill =TRUE); to read it in, and it works. But - some lines are long an

Re: [R] maxtrix to permutation vector

2009-05-29 Thread Luc Villandre
Ian Coe wrote: Hi, Is there a way to convert a matrix into a vector representing all permutations of values and column/row headings with native R functions? I did this with 2 nested for loops and it took about 25 minutes to run on a ~700x700 matrix. I'm assuming there must be a smarter way

Re: [R] maxtrix to permutation vector

2009-05-29 Thread Gavin Simpson
On Fri, 2009-05-29 at 11:08 -0700, Ian Coe wrote: > Hi, > >Is there a way to convert a matrix into a vector representing all > permutations of values and column/row headings with native R functions? > I did this with 2 nested for loops and it took about 25 minutes to run > on a ~700x700 matr

Re: [R] maxtrix to permutation vector

2009-05-29 Thread Stavros Macrakis
Oh, I should have mentioned that the result of melt is a data.frame, not a matrix. You can convert with as.matrix if you like. I should also have shown that dimnames are carried along: > m <- matrix(1:4,2,2,dimnames=list(x=c('a','b'),y=c('x','y'))) > m y x x y a 1 3 b 2 4 > melt(m)

Re: [R] maxtrix to permutation vector

2009-05-29 Thread Romain Francois
About this; > m <- matrix( 1:9, nr = 3 ) > dimnames( m ) <- list( c("d", "e", "f"), c("a", "b", "c") ) > data.frame( row = rep( rownames(m), ncol(m)), col = rep( colnames(m), each = nrow(m)), data = as.vector(m) ) row col data 1 d a1 2 e a2 3 f a3 4 d b4 5 e

Re: [R] maxtrix to permutation vector

2009-05-29 Thread Stavros Macrakis
Not sure what you mean by "permutations" here. I think what you mean is that given a matrix m, you want a matrix whose rows are c(i,j,m[i,j]) for all i and j. You can use the `melt` function in the `reshape` package for this. See below. Hope this helps, -s > library(reshape) > me

[R] Odd Behavior Out of setdiff(...) - addition of duplicate entries is not identified

2009-05-29 Thread Jason Rupert
I think I am using the improved version of setdiff(...) that handles data.frames, so I think some odd behavior was expected but this one is escaping me. It appears that the the addition of duplicate entries is not caught by the setdiff(...). Is this expected behavior? If so, is there anot

Re: [R] Nested variables

2009-05-29 Thread Douglas Bates
On Fri, May 29, 2009 at 7:50 AM, DanielWC wrote: > Hello > I am working with a biological data including variables called Habitat and > Site, example: > Habitat     Site > Forest      Low > Forest      Low > Forest      High > Forest      High > I want to tell R that the Site variable is neste

Re: [R] remove object

2009-05-29 Thread Christos Hatzis
You can try rm(list = ls()[!(ls() %in% "index")]). -Christos > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Luc Villandre > Sent: Friday, May 29, 2009 2:06 PM > To: fernando espindola > Cc: r-help@r-project.org > Subject:

[R] matrix to vector

2009-05-29 Thread Ian Coe
Hi, Is there a way to convert a matrix into a vector representing all permutations of values and column/row headings with native R functions? I did this with 2 nested for loops and it took about 25 minutes to run on a ~700x700 matrix. I'm assuming there must be a smarter way to do this with

[R] matrix to vector

2009-05-29 Thread Ian Coe
Hi, Is there a way to convert a matrix into a vector representing all permutations of values and column/row headings with native R functions? I did this with 2 nested for loops and it took about 25 minutes to run on a ~700x700 matrix. I'm assuming there must be a smarter way to do this with

[R] frequence of patterns in a vector

2009-05-29 Thread liujb
Dear R users, Suppose I have a vector that consists of characters like ABC, A02, RCA, etc., and there are about 700 of possible characters. For example, x <- c("ABC", "ABC", "ABC", "A02", "ABC", "RCA", "ABC", "ABC") I'd like to get a frequency matrix that looks something like this: ABC 6 A02

[R] maxtrix to permutation vector

2009-05-29 Thread Ian Coe
Hi, Is there a way to convert a matrix into a vector representing all permutations of values and column/row headings with native R functions? I did this with 2 nested for loops and it took about 25 minutes to run on a ~700x700 matrix. I'm assuming there must be a smarter way to do this with

Re: [R] remove object

2009-05-29 Thread Romain Francois
fernando espindola wrote: Hi list I try to remove all object less one, this object is called index. I have many object with different names and pattern option in ls function may not remove this object why any word in index object repeats with other object. Anybody can give me one advise for

Re: [R] Still can't find missing data - How do I get NA in xtabs with factors?

2009-05-29 Thread Farley, Robert
Let's see if I understand this. Do I iterate through x <- factor(x, levels(c(levels(x), NA), exclude=NULL) for each of the few hundred variables (x) in my data frame? I tried to do this all at once and failed: > ToyData Data1 Data2 Data3 Weight 101 Sam Red Banana1.1 102 Sam Gr

Re: [R] GTK Tooltips under Linux

2009-05-29 Thread Ronggui Huang
Noted with thanks. Regards Ronggui 2009/5/29 Michael Lawrence : > > > On Thu, May 28, 2009 at 7:35 PM, Ronggui Huang > wrote: >> >> Dear all, >> >> I want to set tool-tips for a gtkButton. I use the following code >> which works under Windows. However, it doesn't work under Linux. Any >> hints?

Re: [R] remove object

2009-05-29 Thread Luc Villandre
fernando espindola wrote: Hi list I try to remove all object less one, this object is called index. I have many object with different names and pattern option in ls function may not remove this object why any word in index object repeats with other object. Anybody can give me one advise f

Re: [R] probably simple paste question

2009-05-29 Thread Gavin Simpson
On Fri, 2009-05-29 at 12:39 -0500, Erin Hodgess wrote: > Dear R People: > > I have the following vector and am using the paste command: > > > ya > [1] 57 2 8 > > paste("stuff",ya,sep=" ") > [1] "stuff 57" "stuff 2" "stuff 8" > > What I want to have is > "stuff 57 2 8" > > > I also tried: >

[R] probably simple paste question solved: please ignore

2009-05-29 Thread Erin Hodgess
Nothing like posting your snag to make you solve it! The answer is simply: > c("stuff",ya) [1] "stuff" "57""2" "8" > Sorry, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodg...@gmail.com __

[R] probably simple paste question

2009-05-29 Thread Erin Hodgess
Dear R People: I have the following vector and am using the paste command: > ya [1] 57 2 8 > paste("stuff",ya,sep=" ") [1] "stuff 57" "stuff 2" "stuff 8" What I want to have is "stuff 57 2 8" I also tried: > yb <- paste(cat("stuff",ya)) stuff 57 2 8> yb character(0) I have the feeling that

Re: [R] Backpropagation to adjust weights in a neural net when receiving new training examples

2009-05-29 Thread jude.ryan
Not that I know of. If you do come across any, let me know, or better still, email r-help. Good luck with what you are trying to do. Jude Ryan From: Filipe Rocha [mailto:filipemaro...@gmail.com] Sent: Friday, May 29, 2009 1:17 PM To: Ryan, Jude Cc: r-hel

Re: [R] strsplit

2009-05-29 Thread Henrique Dallazuanna
Try this: unlist(part)[1] or part[[1]][1] On Fri, May 29, 2009 at 2:09 PM, Nair, Murlidharan T wrote: > I am trying split a string and use one part of it to label graphs. I am > using strsplit for that. While I am able to split it, how do I access the > separated parts. > > filName<-"chrI_222

Re: [R] Backpropagation to adjust weights in a neural net when receiving new training examples

2009-05-29 Thread Filipe Rocha
Thanks a lot for your answers. I can try to implement backpropagation myself with that information. But there isnt a function or method of backpropagation of error for new examples of training only to change the already created neural net? I want to implemennt reinforcement learning... Thanks in ad

[R] strsplit

2009-05-29 Thread Nair, Murlidharan T
I am trying split a string and use one part of it to label graphs. I am using strsplit for that. While I am able to split it, how do I access the separated parts. > filName<-"chrI_2223" >part<- strsplit(filName,"\\_") > part [[1]] [1] "chrI" "2223" > part[1] [[1]] [1] "chrI" "2223" I looked up

Re: [R] Interface R <--> Processing

2009-05-29 Thread Michael Lawrence
On Fri, May 29, 2009 at 3:47 AM, wrote: > Dear Group members > > > I was wondering whether there is any interface to use processing ( > www.processing.org) to visualize R analyses? > Nothing direct, to my knowledge. As far as I know, Processing is a high-level language on top of drawing and use

[R] remove object

2009-05-29 Thread fernando espindola
Hi list I try to remove all object less one, this object is called index. I have many object with different names and pattern option in ls function may not remove this object why any word in index object repeats with other object. Anybody can give me one advise for this question Thank for

Re: [R] R's documentation

2009-05-29 Thread Gabor Grothendieck
On Fri, May 29, 2009 at 11:01 AM, Zheng, Xin (NIH) [C] wrote: > Sometimes I get confused with R's documentation. It seems the documents is > not maintained and updated well. Anyone has similar feeling? I don't mean to > offend anyone. I hope R would get better and better. But documentation is >

Re: [R] R's documentation

2009-05-29 Thread Zheng, Xin (NIH) [C]
Thanks for your information. I am curious why in 2.8.1 the document was not changed. That's easier than writing something in NEWS. But I DO see 'sum' rather than 'mean' in 2.9.0 now. It's not reverted yet as the NEWS saying. And it's still documented to use 'mean'. -Original Message-

[R] max.col specification

2009-05-29 Thread Stavros Macrakis
I'm not sure I understand the max.col spec or its rationale. In particular: * What is the significance and effect of "assuming that the entries are probabilities", as they do not seem to be limited to the interval [0,1]? * In what contexts is it useful for max.col to consider numbers within a cer

Re: [R] error message in plm

2009-05-29 Thread Prof Brian Ripley
A closure is a standard R function (that is not a primitive function). This is presumably from package plm. You called plm() with three arguments, that is subset=na.omit by the matching rules. I think you intended na.action=na.omit. na.omit is a 'closure'. On Fri, 29 May 2009, Cecilia Carm

Re: [R] R's documentation

2009-05-29 Thread Prof Brian Ripley
Which version of R is this? From the BUGS section in NEWS for R 2.9.0 patched: o median.default() was altered in 2.8.1 to use sum() rather than mean(), although it was still documented to use mean(). This caused problems for POSIXt objects, for which mean() but not

Re: [R] R's documentation

2009-05-29 Thread Patrick Burns
Zheng, Xin (NIH) [C] wrote: Sometimes I get confused with R's documentation. It seems the documents is not maintained and updated well. Anyone has similar feeling? I don't mean to offend anyone. I hope R would get better and better. But documentation is really one very important factor which coul

Re: [R] Mean of lognormal in base-2

2009-05-29 Thread Senanu Pearson
I apologize for the poor formatting of my previous post as the line breaks got stripped. I hope this is easier to read. Hi, Does anyone know what the mean value of a lognormal distribution in base-2 is? I am simulating stochastic population growth and if I were working in base-e, I would do:

[R] Mean of lognormal in base-2

2009-05-29 Thread Senanu Pearson
Hi, Does anyone know what the mean value of a lognormal distribution in base-2 is? I am simulating stochastic population growth and if I were working in base-e, I would do:lambda <- 1.1 #multiplicative growth rates <- 0.6 #stochasticity (std. dev)lognormal <- rlnorm(10, log(lambda) - (s^2)/

Re: [R] R's documentation

2009-05-29 Thread Zheng, Xin (NIH) [C]
Ok, pls take a look at '?median'. Can you see "However, the default method makes use of 'sort' and 'mean'"? Then let's look at 'median.default'. I do see 'sort'. But where is 'mean'? At first glance I didn't catch the exact point of its algorithm. Why not say more clearly that "make use of parti

Re: [R] R's documentation

2009-05-29 Thread Romain Francois
Zheng, Xin (NIH) [C] wrote: Sometimes I get confused with R's documentation. It seems the documents is not maintained and updated well. Anyone has similar feeling? I don't mean to offend anyone. I hope R would get better and better. But documentation is really one very important factor which c

Re: [R] R's documentation

2009-05-29 Thread Kjetil Halvorsen
On Fri, May 29, 2009 at 11:01 AM, Zheng, Xin (NIH) [C] < zheng...@mail.nih.gov> wrote: > Sometimes I get confused with R's documentation. It seems the documents is > not maintained and updated well. Anyone has similar feeling? I don't mean to > offend anyone. I hope R would get better and better.

Re: [R] excluding NAs in data frame without deleting rows

2009-05-29 Thread Luc Villandre
Wade Wall wrote: Hi all, I have a binary matrix with NAs included. Each row and column includes at least one NA, so I don't want to omit them. Is there a way to sum across rows and columns, ignoring the NAs but not deleting the row or column? If not, I suppose I can write a loop function, but

Re: [R] Problem loading rJava

2009-05-29 Thread Dieter Menne
phila.gov> writes: > > I finally realized I didn't have Java installed on my computer, so I > downloaded Java and tested that it works. > > I then attempted to reinstall rJava and load the package, but got this; > > utils:::menuInstallLocal() > package 'rJava' successfully unpacked and MD5 s

Re: [R] excluding NAs in data frame without deleting rows

2009-05-29 Thread Adrián Cortés
use: sum(x,na.rm=T) like this: my.row.sums <- apply(my.matrix,1,sum,na.rm=T) If you want to do across columns then use 2 instead of 1. Look at ?apply and ?sum. Adrian On Fri, May 29, 2009 at 7:46 AM, Wade Wall wrote: > Hi all, > > I have a binary matrix with NAs included. Each row and col

Re: [R] How to replace Inf by zero?

2009-05-29 Thread Sven Hohenstein
marlene marchena gmail.com> writes: > > Hi R users, > > Someone knows how to replace Infinite value by zero. I have a vector with > some Inf value and I want to substitute these values by zero to get the mean > of the components of the vector. > > Any idea? > > Many thanks, > > Marlene. H

[R] R's documentation

2009-05-29 Thread Zheng, Xin (NIH) [C]
Sometimes I get confused with R's documentation. It seems the documents is not maintained and updated well. Anyone has similar feeling? I don't mean to offend anyone. I hope R would get better and better. But documentation is really one very important factor which could attract people coming or

Re: [R] data manipulation involving aggregate

2009-05-29 Thread Gabor Grothendieck
Try this: > as.data.frame.table(xtabs(area ~ habitat + sq, DF), responseName = > "area.sum")[c(2:3, 1)] sq area.sum habitat 1 10 field 2 13 garden 3 13pond 4 10 river 5 21 field 6 22 garden 7 20pond 8 2

[R] excluding NAs in data frame without deleting rows

2009-05-29 Thread Wade Wall
Hi all, I have a binary matrix with NAs included. Each row and column includes at least one NA, so I don't want to omit them. Is there a way to sum across rows and columns, ignoring the NAs but not deleting the row or column? If not, I suppose I can write a loop function, but I have learned tha

[R] Nested variables

2009-05-29 Thread DanielWC
Hello Im am working with a biological data including variables called Habitat and Site, example: Habitat Site Forest Low Forest Low Forest High Forest High I want to tell R that the Site variable is nested within the Forest variable (that it is not a new variable). Does

Re: [R] How to replace Inf by zero?

2009-05-29 Thread Don MacQueen
Although, in this case, the which() is unnecessary. x[x==Inf] <- 0 See the online help, that is, help('[') and also the documentation, "An Introduction to R", available online at CRAN. -Don At 2:58 PM +0100 5/29/09, marlene marchena wrote: Thanks a lot Andrea, it works! Marlene. 200

[R] data manipulation involving aggregate

2009-05-29 Thread Simon Pickett
hi all, I often have a data frame like this example data.frame(sq=c(1,1,1,2,2,3,3,3,3),area=c(1,2,3,1,2,3,1,2,3),habitat=c("garden","garden","pond","field","garden","river","garden","field","field")) for each "sq" I have multiple "habitat"s each with an associated "area". I want to aggregate t

Re: [R] Backpropagation to adjust weights in a neural net when receiving new training examples

2009-05-29 Thread jude.ryan
You can figure out which weights go with which connections with the function summary(nnet.object) and nnet.object$wts. Sample code from Venables and Ripley is below: # Neural Network model in Modern Applied Statistics with S, Venables and Ripley, pages 246 and 247 > library(nnet) > attach(roc

Re: [R] How to replace Inf by zero?

2009-05-29 Thread marlene marchena
Thanks a lot Andrea, it works! Marlene. 2009/5/29 Andrea Weidacher > Hi Marlene, > > try this: > > x[which(x==Inf)] <- 0 > > Andrea. > > -- > *Von:* marlene marchena > *An:* R-help@r-project.org > *Gesendet:* Freitag, den 29. Mai 2009, 15:17:57 Uhr > *Betreff:* [R]

Re: [R] GTK Tooltips under Linux

2009-05-29 Thread Michael Lawrence
On Thu, May 28, 2009 at 7:35 PM, Ronggui Huang wrote: > Dear all, > > I want to set tool-tips for a gtkButton. I use the following code > which works under Windows. However, it doesn't work under Linux. Any > hints? Thanks. > Unfortunately, on platforms besides Windows, the event loop runs via an

Re: [R] How to replace Inf by zero?

2009-05-29 Thread ONKELINX, Thierry
Dear Marlene, Have a look at is.infinite(). Replacing them by zero is not a very bright idea if you want the mean of the resulting vector. Have a look at the example below. #create a vector x <- rnorm(100, mean = 1000) #replace 20 values with Inf x[sample(seq_along(x), 20, replace = FALSE)] <- In

[R] Problem loading rJava

2009-05-29 Thread Josef . Kardos
I am running R on Windows XP I first tried to install rJava and got this message utils:::menuInstallLocal() package 'rJava' successfully unpacked and MD5 sums checked updating HTML package descriptions then i tried this require(rJava) Loading required package: rJava Error in if (!nchar(javahome)

[R] Error messages/systemfit package

2009-05-29 Thread Axel Leroix
Hello !   I’m trying to estimate a system of equation (demand and supply) using the systemfit package.  My program is:   library(systemfit) demand <- tsyud ~ tsyud1 + tsucp + tspo + tssn supply <- tscn ~ tsyn + tsqn + tsksn + tsucp system <- list(demand=eqdemand, learning = eqsupply) labels

[R] error message in plm

2009-05-29 Thread Cecilia Carmo
Hi everyone, Could anyone tell me what means the follow error message Error in xj[i] : invalid subscript type 'closure' It happens when I run the function plm, like this: ff<-totaccz~lactivoz+varvolnegz ss<-plm(ff,data=regaccdis,na.omit) Error in xj[i] : invalid subscript type 'closure' coe

[R] How to replace Inf by zero?

2009-05-29 Thread marlene marchena
Hi R users, Someone knows how to replace Infinite value by zero. I have a vector with some Inf value and I want to substitute these values by zero to get the mean of the components of the vector. Any idea? Many thanks, Marlene. [[alternative HTML version deleted]]

[R] [R-pkgs] WriteXLS - New Version 1.7.1

2009-05-29 Thread Marc Schwartz
The updated package has been submitted to CRAN and will propagate to mirrors over the next day or so. It is maintained on R-Forge at http://r-forge.r-project.org/projects/writexls , where downloads are available as well. Package: WriteXLS Version: 1.7.1 Description: Cross-platform perl b

[R] Interface R <--> Processing

2009-05-29 Thread simon_mailing
Dear Group members I was wondering whether there is any interface to use processing (www.processing.org) to visualize R analyses? If so could somebody point me to relevant ressources? If not, are there any attempts to build such an interface / package? Best Regards, Simon -- Nur bis 31.0

Re: [R] how do I decide the best number of observations in MLE?

2009-05-29 Thread Ben Bolker
losemind wrote: > > Of course, in MLE, if we collect more and more observations data, MLE > will perform better and better. > > But is there a way to find a bound on parameter estimate errors in > order to decide when to stop collect data/observations, say 1000 > observations are great, but 50

Re: [R] Regular point pattern on multi-segment line

2009-05-29 Thread Ted Harding
On 29-May-09 11:23:15, Pascal LAFFARGUE wrote: > I need your help for the following purpose : > > I would like to create regularly spaced points on a multisegment > line (a 'psp class' object). > > A function of the spatstat library( = pointsOnLines() ) is dedicated > to that objective but the pr

[R] The R Journal volume 1, number 1, now available

2009-05-29 Thread Vincent Carey
On behalf of the editorial team, I am happy to inform you that the first issue of The R Journal is now available: http://journal.r-project.org I would like to thank team members Heather Turner, Peter Dalgaard, and John Fox for extraordinary efforts in producing this first number of the Journal.

[R] Regular point pattern on multi-segment line

2009-05-29 Thread Pascal LAFFARGUE
I need your help for the following purpose : I would like to create regularly spaced points on a multisegment line (a 'psp class' object). A function of the spatstat library( = pointsOnLines() ) is dedicated to that objective but the problem is that the probability of falling on a particular

Re: [R] IP-Address

2009-05-29 Thread Allan Engelhardt
Peter Dalgaard wrote: > Allan Engelhardt wrote: > >> [...] >> Getting rid of the conversions including the matrix(unlist) combo is >> left as an exercise (it's too hot here) >> > > Here's one way: > > con <- textConnection(as.character(a$ip)) > o <- do.call(order,read.table(con,sep=".")

Re: [R] Labeling barplot bars by multiple factors

2009-05-29 Thread Jim Lemon
Thomas Levine wrote: Ah, that makes sense. But now another two issues have arisen. Firstly, the error bars look like confidence intervals, and I'm pretty sure that they are but does some document verify this? I suppose I could check the code too. Secondly, I just read about how dynamite plots s

Re: [R] How to read a binary file bit by bit?

2009-05-29 Thread Duncan Murdoch
Inigo Pagola Barrio wrote: Hello everybody, I am trying to a read a binary file with different formats. I use the readBin function so I can read bytes, short and double numbers depending on the bytes per element in the byte stream. But now I need to read bit by bit, and join them in groups of

Re: [R] R connectivity with Oracle DB

2009-05-29 Thread Franzini, Gabriele [Nervianoms]
Hello Madan, I am rather novice as well, so I went the ODBC way. If you define an ODBC connection to Oracle, with System DSN dsn-name, the code to get the results of a query into, say, mydata is like : library(RODBC) # First of all channel <- odbcConnect("dsn-name", uid="someuser") # double quot

  1   2   >