[R] R from Java (cluster heatmaps)

2010-02-26 Thread Rameswara Sashi Kiran Challa
Hello All, I am trying to get cluster heatmaps using R from Java in my application. I got the Rserve using which I am able to make TCP/IP connection to R. I am trying to send a double[][] array (say 5x8 dimensions) to R and convert it into matrix using as.matrix() function in R. Is it correct to

[R] Help Computing Probit Marginal Effects

2010-02-26 Thread Cardinals_Fan
Hi, I am a stata user trying to transition to R. Typically I compute marginal effects plots for (example) probit models by drawing simulated betas by using the coefficient/standard error estimates after I run a probit model. I then use these simulated betas to compute first difference marginal

[R] somebody help me about this error message...

2010-02-26 Thread Joseph Lee
I created variables automatically like this way for(i in 1:5){ nam <- paste("a",i,sep="") assign(nam,1:i) } and then, i want to insert a new data into "a2" variable. so, i did next sentence paste("a",2,sep="") <- 4 so, i got this error message Error in get(paste("a", 2, sep =

Re: [R] two questions for R beginners

2010-02-26 Thread GlenB
Lazy and impatient? That's me! I find it hard to say what my biggest misconceptions were. Here's one thing: What I realized very early on: - many data analysis functions return a bunch of stuff, not all of which you see when you print() it what I *failed* to realize: - The bunch of stuff

[R] Converting IEEE Float in 16 char hex back to float

2010-02-26 Thread xlr82sas
Hi, If I do the following sprintf("%A",pi) "0X1.921FB54442D18" I have this 16 byte character string hx<-"400921FB54442D18" This is the exact hex16 representation of PI in IEEE float that R uses in Intel 32bit(little endian) Windows SAS uses the same representation. 11 bit exponent and 53 bit

Re: [R] two questions for R beginners

2010-02-26 Thread Gabor Grothendieck
On Fri, Feb 26, 2010 at 1:28 PM, Saeed Abu Nimeh wrote: > Pat, > Off the bat, beginners and advanced. In addition, splitting by domain > would be very helpful -- something along the lines of: > http://cran.r-project.org/web/views/. But we should be careful, we do > not want to create 20 other mail

Re: [R] two questions for R beginners

2010-02-26 Thread Saeed Abu Nimeh
sorry meant community not committee On 2/26/10 8:36 PM, Saeed Abu Nimeh wrote: Hi Ivan, On 2/26/10 6:30 AM, Ivan Calandra wrote: You are definitely right... What to do with bad beginner's questions is not a simple issue. If a "beginner's mailing list" is created, who will answer to such quest

Re: [R] two questions for R beginners

2010-02-26 Thread Saeed Abu Nimeh
Hi Ivan, On 2/26/10 6:30 AM, Ivan Calandra wrote: You are definitely right... What to do with bad beginner's questions is not a simple issue. If a "beginner's mailing list" is created, who will answer to such questions? If I subscribe to the beginners mailing list, then I have to expect novi

Re: [R] how to fast extract values from different list elements

2010-02-26 Thread kMan
Dear Peter, What data types does your list contain? Have you tried treating the list as a data frame or matrix? KeithC. -Original Message- From: Heym, Peter-Paul [mailto:ph...@ipb-halle.de] Sent: Thursday, February 25, 2010 2:11 AM To: r-help@R-project.org Subject: [R] how to fast extr

Re: [R] New Variable from Several Existing Variables

2010-02-26 Thread David Winsemius
And if your data is in a dataframe (... please include an example of the results of str() next time...) : > dfrm <- rd.txt("Column1, Column2, Column3 + Yes,Yes,Yes + Yes,No,Yes + No,No,No + No,Yes,No + Yes,Yes,No", sep=",") #rd.txt is just a wrapper I use for read.table(textConnection( ), hea

Re: [R] split function

2010-02-26 Thread rusers.sh
Thanks. I think i mistake the sampling() with split(). 2010/2/26 David Winsemius > > On Feb 26, 2010, at 2:40 PM, rusers.sh wrote: > > Your method seems to only re-express the data "data.frame(x, g)" using >> another format. >> > > In all fairness to the first respondent to your question, that

Re: [R] New Variable from Several Existing Variables

2010-02-26 Thread Don MacQueen
If your data is in a matrix named "orgdata" : newvar <- apply(orgdata , 1, function(arow, if (all(arow=='Yes')) 'Yes' else 'No' newdata <- cbind(orgdata, newvar) finaloutcome <- newdata[ newvar=='Yes',] The key to this is the apply() function. I might have missed some parentheses... There

Re: [R] Preserving lists in a function

2010-02-26 Thread Don MacQueen
Barry explained your first puzzle, but let me add some explanation and examples. tmpfun <- function( a =3 ) {a} tmpfun() [1] 3 tmpfun(a='x') [1] "x" Inside the function, the value of the argument is whatever the user supplied. The default is replaced by what the user supplies. There i

[R] New Variable from Several Existing Variables

2010-02-26 Thread wookie1976
I am new to R, but have been using SAS for years. In this transition period, I am finding myself pulling my hair out to do some of the simplest things. An example of this is that I need to generate a new variable based on the outcome of several existing variables in a data row. In other words,

Re: [R] Preserving lists in a function

2010-02-26 Thread Barry Rowlingson
On Fri, Feb 26, 2010 at 10:56 PM, Shang Gao wrote: > Dear R users, > > A co-worker and I are writing a function to facilitate graph plotting in R. > The function makes use of a lot of lists in its defaults. > > However, we discovered that R does not necessarily preserve the defaults if > we were

Re: [R] wrap long lines in table using "latex" in Hmisc

2010-02-26 Thread Marc Schwartz
On Feb 26, 2010, at 5:18 PM, Sharpie wrote: > > > Ista Zahn wrote: >> >> Hi Tao, >> Just set the appropriate *.just argument, e.g.: >> >> Dat <- data.frame(x1 = rep("this value consists of a long string of >> text", 5), x2 = rep("this value consists of an even longer string of >> text", 5)) >>

Re: [R] wrap long lines in table using "latex" in Hmisc

2010-02-26 Thread Tao Shi
Hi Ista, Thanks!  I missed that. ...Tao > From: istaz...@gmail.com > Date: Fri, 26 Feb 2010 17:48:32 -0500 > Subject: Re: [R] wrap long lines in table using "latex" in Hmisc > To: shi...@hotmail.com > CC: r-help@r-project.org > > Hi Tao, > Just set the a

Re: [R] wrap long lines in table using "latex" in Hmisc

2010-02-26 Thread Sharpie
Ista Zahn wrote: > > Hi Tao, > Just set the appropriate *.just argument, e.g.: > > Dat <- data.frame(x1 = rep("this value consists of a long string of > text", 5), x2 = rep("this value consists of an even longer string of > text", 5)) > > library(Hmisc) > latex(Dat, col.just = rep("p{1in}", 2

Re: [R] using grep

2010-02-26 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of kayj > Sent: Friday, February 26, 2010 12:02 PM > To: r-help@r-project.org > Subject: Re: [R] using grep > > > Hi , > > I have tried > > gsub(".*York(\\d+).*", "\\1", grep("Ne

[R] Preserving lists in a function

2010-02-26 Thread Shang Gao
Dear R users, A co-worker and I are writing a function to facilitate graph plotting in R. The function makes use of a lot of lists in its defaults. However, we discovered that R does not necessarily preserve the defaults if we were to input them in the form of list() when initializing the funct

Re: [R] ODBC with Filemaker

2010-02-26 Thread Marc Schwartz
On Feb 26, 2010, at 12:20 PM, Daniel wrote: > Hi all, > anybody get connection with Filemarker 10 for mac? > How do that? > I suppose did right, but it is not working. You need to be sure that you have the current version of R (2.10.1), the current version of the RODBC package (1.3-0), an ODBC

Re: [R] wrap long lines in table using "latex" in Hmisc

2010-02-26 Thread Ista Zahn
Hi Tao, Just set the appropriate *.just argument, e.g.: Dat <- data.frame(x1 = rep("this value consists of a long string of text", 5), x2 = rep("this value consists of an even longer string of text", 5)) library(Hmisc) latex(Dat, col.just = rep("p{1in}", 2)) You can also set justification for c

Re: [R] need help to resolve RODBC error

2010-02-26 Thread Marc Schwartz
On Feb 26, 2010, at 1:04 PM, Yan Zhang wrote: > I've installed R-2.9.2 (64 bit), unixODBC-2.2.14-p2 (64 bit) and RODBC_1.2-5 > (64 bit) on a 64 bit Redhat Linux server (Red Hat Enterprise Linux Server > release 5.4 (Tikanga), x86_64) release 2.6.18-164.2.1.el5. I've tested the > ODBC drive via

Re: [R] using grep

2010-02-26 Thread David Winsemius
On Feb 26, 2010, at 3:02 PM, kayj wrote: Hi , I have tried gsub(".*York(\\d+).*", "\\1", grep("New York", x, value = TRUE)) and outputs "P New York722AZ" "K New York20" Strange: > x<-c("P Los Angeles44AZ", "P New York722AZ", "K New York20") > > gsub(".*York(\\d+).*", "\\1", grep("New Yo

[R] decomposing an irregularly spaced time series

2010-02-26 Thread ravi
Hi, I am interested in decomposing an irregularly spaced time series and getting results similiar to that obtained with the stl command for a regularly spaced time series. I would like to know if any of the time series packages like zoo can be used for this. From my search, I was only able to f

Re: [R] using grep

2010-02-26 Thread Henrique Dallazuanna
What is your R version? Install the most recent R version (2.10.1). On Fri, Feb 26, 2010 at 5:02 PM, kayj wrote: > > Hi , > > I have tried > > gsub(".*York(\\d+).*", "\\1", grep("New York", x, value = TRUE)) > > and outputs > >  "P New York722AZ" "K New York20" > but that is not what i want, I w

Re: [R] using grep

2010-02-26 Thread kayj
Hi , I have tried gsub(".*York(\\d+).*", "\\1", grep("New York", x, value = TRUE)) and outputs "P New York722AZ" "K New York20" but that is not what i want, I want the output to be 722,20 -- View this message in context: http://n4.nabble.com/using-grep-tp1571102p1571251.html Sent fro

[R] factorial block design with missing data

2010-02-26 Thread Guillaume Théroux Rancourt
Hello! I have read somewhere (somehow, I can't seem to find it again, it's been a couple of months) that when analyzing factorial block design, the position where you put the block factor is important, even more when there are missing values. I understand that when using anova.lm, the order is

[R] need help to resolve RODBC error

2010-02-26 Thread Yan Zhang
I've installed R-2.9.2 (64 bit), unixODBC-2.2.14-p2 (64 bit) and RODBC_1.2-5 (64 bit) on a 64 bit Redhat Linux server (Red Hat Enterprise Linux Server release 5.4 (Tikanga), x86_64) release 2.6.18-164.2.1.el5. I've tested the ODBC drive via isql and the test was success: [yzh...@roracletest ~]

Re: [R] help system works under IE but not Firefox

2010-02-26 Thread Raynor, Bill
Thanks Duncan, that did the trick. I added a new proxy to the FoxyProxy list, white listing 127.0.0.1 and moved that to the top of the list. Help.start() works fine now. Bill > -Original Message- > From: Duncan Murdoch [mailto:murd...@stats.uwo.ca] > Sent: Friday, February 26, 2010 1:00 P

Re: [R] R Experts

2010-02-26 Thread Erik Iverson
Ryan Kinzer wrote: Erik Thanks for helping. Both of them are factors. That's the problem, they need to be of class Date. See the R NEWS article about Date classes in Volume 4/1. http://cran.r-project.org/doc/Rnews/ I don't see how they could be factors though, since you shouldn't be

Re: [R] Automate generation of multiple reports using odfWeave

2010-02-26 Thread Aleksey Naumov
Sarah, Thank you very much, this an easy solution that works very well! On a more complicated note, is there a way to embed the station name in a header or footer of the document? It seems there is no way to evaluate a chunk or an inline \Sexpr{...} in a header or footer? This would put station I

Re: [R] dramatic speed difference in lapply

2010-02-26 Thread Rob Forler
I'm trying to do data grouping like you said. I will look into data.table package and I will also consider using a matrix instead of a data frame. Thank you for your responses. Thanks, Rob On Fri, Feb 26, 2010 at 3:21 PM, Tom Short wrote: > I'm sorry, Rob, but that code is dense enough and for

Re: [R] dramatic speed difference in lapply

2010-02-26 Thread Tom Short
I'm sorry, Rob, but that code is dense enough and formatted badly enough that it's hard to dig through. You may want to try the data.table package. The development version on R-forge is pretty fast for grouping operations like this. I'm not sure if this is what you're really after. It's hard to te

Re: [R] dramatic speed difference in lapply

2010-02-26 Thread jim holtman
On my computer your two examples seem to execute about the same: > fedb.ddplyWrapper2Fast <- function(data, pivotColumns, listNameFunctions, + ...){ + lapplyFunctionRecurse <- function(cdata, level=1, ...){ +if(level==1){ + + return(lapply(split(seq(nrow(cdata)),cdata[,pivotColu

Re: [R] text editors

2010-02-26 Thread Tao Shi
If you do everything in Windows, Tinn-R is one of the best and also the one I use.  I also tried WinEdt. It's very good, but it is not free.  If you want a cross-platform editor, Emacs+ESS is the one.  Like others said, the learning curve is steep, but worth it. ...Tao ===

Re: [R] Automate generation of multiple reports using odfWeave

2010-02-26 Thread Sarah Goslee
I tend to do it the other way around. Hard-code the station into the ODT file as "thisstation". Then, in R, do something like this: allstations <- c("station1", "station2", "station3") for (i in allstations) { thisstation <- i odfWeave("inputfile.odt", paste("output-", i, ".odt", sep=""))

[R] Automate generation of multiple reports using odfWeave

2010-02-26 Thread Aleksey Naumov
Dear R and odfWeave users, I am looking for a way to automate generation of many reports using odfWeave. All reports would use the same input ODT file, the only difference would be in the name of the dataset which will be analyzed in any particular report. Right now, the name of the dataset is har

Re: [R] match.call to obtain the name of a function

2010-02-26 Thread Henrique Dallazuanna
Try this: foo <- function() sprintf("The name of this function is %s", gettext(match.call())) On Fri, Feb 26, 2010 at 5:22 PM, Jacob Wegelin wrote: > > Within a function I'd often like to obtain a text string equal to the name > of the function. > > One use for this: To generate a filena

[R] wrap long lines in table using "latex" in Hmisc

2010-02-26 Thread Tao Shi
Hi list, Is there a way to control long-line wrapping in a table using "latex" function in Hmisc or any other functions?  It seems I can't find any examples. Thank you very much! ...Tao

Re: [R] Defective help pages

2010-02-26 Thread Peter Danenberg
> This seems to be plain text help, right? It is. > Does the html version give the same result? Interestingly, the html seems to be whole; but it's less convenient to access from ESS, though. Do you know what program generates the plain text; and are there any options that govern where R looks

[R] match.call to obtain the name of a function

2010-02-26 Thread Jacob Wegelin
Within a function I'd often like to obtain a text string equal to the name of the function. One use for this: To generate a filename for use in pdf(). This enables me to keep track of which function generated a particular graphic came. match.call() puts parentheses at the end of the name. I d

Re: [R] split function

2010-02-26 Thread David Winsemius
On Feb 26, 2010, at 2:40 PM, rusers.sh wrote: Your method seems to only re-express the data "data.frame(x, g)" using another format. In all fairness to the first respondent to your question, that _was_ what it appeared you were requesting. My other thoughts would be: > cbind(x[order(g)],

[R] dramatic speed difference in lapply

2010-02-26 Thread Rob Forler
So I have a function that does lapply's for me based on dimension. Currently only works for length(pivotColumns)=2 because I haven't fixed the rbinds. I have two versions. One runs WAYYY faster than the other. And I'm not sure why. Fast Version: fedb.ddplyWrapper2Fast <- function(data, pivotColum

Re: [R] two questions for R beginners

2010-02-26 Thread Jack Siegrist
My biggest impediment, as a scientist without previous programming experience, is that the R help is not beginner-friendly. I think it is probably great for experienced programmers and for the people who helped to create the software, to help them remember what they did, but I think it is very di

Re: [R] How to add a variable to a dataframe whose values are conditional upon the values of an existing variable

2010-02-26 Thread Henrique Dallazuanna
You can work with factor also: week <- c('SAT', 'SUN', 'MON', 'FRI') factor(week, levels = week, labels = 1:4) On Fri, Feb 26, 2010 at 4:31 PM, Steve Matco wrote: > Hi everyone, > > I am at my wits end with what I believe would be considered simple by a more > experienced R user. I want to know

Re: [R] How to add a variable to a dataframe whose values are conditional upon the values of an existing variable

2010-02-26 Thread Daniel Malter
Hi, two approaches at least. a. a nested ifelse statement b. merging the original data frame with DOW in it with a data frame that holds the day "MON" to "SUN" and their indicators. Both approaches illustrated below: DOW=rep(c("MON","TUE"),100) #nested ifelse approach DOW.ind=ifelse(DOW=="MON",

Re: [R] split function

2010-02-26 Thread Henrique Dallazuanna
So, I don't understand what you want, you want add the factor to split result, isn't? #Example set.seed(1234) n <- 3; nn <- 10 g <- factor(round(n * stats::runif(n * nn))) #factor x <- rnorm(n * nn) + sqrt(as.numeric(g))#value xg <- split(x, g) xg xgD <- split(data.frame(x, g), g) sapply(x

Re: [R] How to add a variable to a dataframe whose values are conditional upon the values of an existing variable

2010-02-26 Thread Andrew Miles
You could also try a series of simple ifelse statements. I just tried the following and got it to work, though I am sure there is a faster way. t=c("cow", "dog", "chick") y=c(1,3,4) mat=cbind(t,y) mat=as.data.frame(mat) > mat t y 1 cow 1 2 dog 3 3 chick 4 mat$g=ifelse(mat$t=="c

Re: [R] split function

2010-02-26 Thread rusers.sh
Your method seems to only re-express the data "data.frame(x, g)" using another format. The results are really from the generated data frame. Maybe be not good. > table(g) g 0 1 2 3 7 9 8 6 I hope to randomly split the value 'x' according to the different sample sizes of different levels, displaye

Re: [R] How to add a variable to a dataframe whose values are conditional upon the values of an existing variable

2010-02-26 Thread Henrique Dallazuanna
Try this: sapply(c('SAT', 'SUN', 'MON', 'FRI'), switch, SAT = 1, SUN = 2, MON = 3, FRI = 4) On Fri, Feb 26, 2010 at 4:31 PM, Steve Matco wrote: > Hi everyone, > > I am at my wits end with what I believe would be considered simple by a more > experienced R user. I want to know how to add a vari

Re: [R] How to add a variable to a dataframe whose values are conditional upon the values of an existing variable

2010-02-26 Thread Erik Iverson
You mention ifelse, so for completeness, I will show you a solution that should work with that. There are other plenty of other possibilities though, I am sure. The follow is not tested.. Assume 'my.df' is your data.frame, containing a variable "DOW". my.df$DOW1 <- ifelse(my.df$DOW == "SAT",

[R] How to add a variable to a dataframe whose values are conditional upon the values of an existing variable

2010-02-26 Thread Steve Matco
Hi everyone, I am at my wits end with what I believe would be considered simple by a more experienced R user. I want to know how to add a variable to a dataframe whose values are conditional on the values of an existing variable. I can't seem to make an ifelse statement work for my situation. T

Re: [R] two questions for R beginners

2010-02-26 Thread Seeliger . Curt
Patrick Burns > * What were your biggest misconceptions or > stumbling blocks to getting up and running > with R? I came into R from SAS, with its powerful data step language and very simplified data types. Most of my work is data manipulation prior to a variety of univariate statistical calcu

Re: [R] help system works under IE but not Firefox

2010-02-26 Thread Duncan Murdoch
On 26/02/2010 11:31 AM, Raynor, Bill wrote: I just upgraded to 2.10.1 on a WinXPSP2 machine. When I type help.start() R attempts to open a browser session at http://127.0.0.1:27594/doc/html/index.html using my default browser (Firefox 3.6) and is unable to connect. If I then open the same page

Re: [R] split function

2010-02-26 Thread Henrique Dallazuanna
Try this: split(data.frame(x, g), g) On Fri, Feb 26, 2010 at 3:55 PM, rusers.sh wrote: > Hi, >  I am using split function and wonder how to add the factor to the splitted > results. > #Example > n <- 3; nn <- 10 > g <- factor(round(n * stats::runif(n * nn)))   #factor > x <- rnorm(n * nn) + sqrt

Re: [R] text editors

2010-02-26 Thread David Reinke
It depends on your needs, your budget, and your personal tastes. I program in a number of languages, so I want a text editor that I can configure easily. I used CodeWright for years, but it's in limbo now since Borland acquired it and no longer supports it. I've switched over to SlickEdit. One

[R] split function

2010-02-26 Thread rusers.sh
Hi, I am using split function and wonder how to add the factor to the splitted results. #Example n <- 3; nn <- 10 g <- factor(round(n * stats::runif(n * nn))) #factor x <- rnorm(n * nn) + sqrt(as.numeric(g))#value xg <- split(x, g) xg $`0` [1] 0.82513702 -0.03911584 2.32955347 0.36745335

Re: [R] New methods for generic functions show and print : some visible with ls(), some not

2010-02-26 Thread Duncan Murdoch
On 26/02/2010 1:04 PM, Joris Meys wrote: Dear all, I'm trying to understand the S4 way of object-oriented programming, but I still can't grasp completely what R is doing. I have a class definition for a class called PM10Meteo, and I set a initializer function. next, I include a show method and a

Re: [R] R Experts

2010-02-26 Thread Erik Iverson
Hello, Ryan Kinzer wrote: I am trying to understand why R is working in a particular way. I have a data set with two variables; mark date (markd) and recap date (recapd). I would like to know the number of days between capture dates. But if I subtract recap date from mark date I often get the

Re: [R] sort columns

2010-02-26 Thread Ista Zahn
Hi Frederik, Not exactly clear how you want them sorted, but one of these two is probably what you want: mat <- matrix(100:1, ncol=10) mat.1 <- apply(mat, 2, sort) mat.2 <- mat[order(10:1),] Best, Ista On Fri, Feb 26, 2010 at 12:41 PM, frederik vanhaelst wrote: > Hello, > > i have a 50*100 mat

Re: [R] sort columns

2010-02-26 Thread Henrique Dallazuanna
Try this: apply(m, 2, sort) On Fri, Feb 26, 2010 at 2:41 PM, frederik vanhaelst wrote: > Hello, > > i have a 50*100 matrix, with real numbers. How do i sort each column? > Now i sort it with a for-loop but this take a lot of time... > > Thank you, > > Frederik > >        [[alternative HTML versi

Re: [R] using grep

2010-02-26 Thread Henrique Dallazuanna
Try this: gsub(".*York(\\d+).*", "\\1", grep("New York", x, value = TRUE)) On Fri, Feb 26, 2010 at 3:27 PM, kayj wrote: > > Hi All, > > I have a character vector with naems of cities in the us. I need to extract > the number that appear after the word "New York", for example, > > x<-c("P Los Ang

Re: [R] New methods for generic functions show and print : some visible with ls(), some not

2010-02-26 Thread Uwe Ligges
On 26.02.2010 19:04, Joris Meys wrote: Dear all, I'm trying to understand the S4 way of object-oriented programming, but I still can't grasp completely what R is doing. I have a class definition for a class called PM10Meteo, and I set a initializer function. next, I include a show method and a

[R] R Experts

2010-02-26 Thread Ryan Kinzer
I am trying to understand why R is working in a particular way. I have a data set with two variables; mark date (markd) and recap date (recapd). I would like to know the number of days between capture dates. But if I subtract recap date from mark date I often get the wrong results. Example:

Re: [R] counting the number of ones in a vector

2010-02-26 Thread David Reinke
The length will remain the same no matter what expression appears in the subscript. I suggest this: sum(x == 1) David Reinke Senior Transportation Engineer/Economist Dowling Associates, Inc. 180 Grand Avenue, Suite 250 Oakland, California 94612-3774 510.839.1742 x104 (voice) 510.839.0871 (fax)

[R] ODBC with Filemaker

2010-02-26 Thread Daniel
Hi all, anybody get connection with Filemarker 10 for mac? How do that? I suppose did right, but it is not working. -- Daniel Marcelino Phone: (647) 8910939 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://sta

[R] using grep

2010-02-26 Thread kayj
Hi All, I have a character vector with naems of cities in the us. I need to extract the number that appear after the word "New York", for example, x<-c("P Los Angeles44AZ", "P New York722AZ", "K New York20") I want the results to be 722, 20 cab I use the grep function, if so how? I apprecia

[R] sort columns

2010-02-26 Thread frederik vanhaelst
Hello, i have a 50*100 matrix, with real numbers. How do i sort each column? Now i sort it with a for-loop but this take a lot of time... Thank you, Frederik [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://st

[R] help system works under IE but not Firefox

2010-02-26 Thread Raynor, Bill
I just upgraded to 2.10.1 on a WinXPSP2 machine. When I type help.start() R attempts to open a browser session at http://127.0.0.1:27594/doc/html/index.html using my default browser (Firefox 3.6) and is unable to connect. If I then open the same page using IE 8, it works just fine. How do I fix

Re: [R] two questions for R beginners

2010-02-26 Thread Saeed Abu Nimeh
Pat, Off the bat, beginners and advanced. In addition, splitting by domain would be very helpful -- something along the lines of: http://cran.r-project.org/web/views/. But we should be careful, we do not want to create 20 other mailing lists :) We have to group things. This will help splitting the

Re: [R] text editors

2010-02-26 Thread Tobias Verbeke
Sharpie wrote: Dwayne Blind wrote: Dear all, Do you use a text editor ? What would you recommend for Windows users ? What about Tinn-R ? Thank you very much, Dwayne Learning a text editor is a significant and very valuable investment of your time. In order to maximize the return from thi

Re: [R] Working directories... Again

2010-02-26 Thread Duncan Murdoch
On 26/02/2010 12:55 PM, Allen L wrote: Dear R forum, I've looked many places for this and figure there must be an easy way to implement. I want to set the working directory in my script to the place where the R code is located. Something like: >setwd(directory where this script is found). If

Re: [R] question to make a vector without loop

2010-02-26 Thread Phil Spector
Khazaei - I think mapply(function(x,ind)x * a / (b + ind),c(NA,w),c(NA,1:length(w))) does what you want, but since you didn't include a reproducible example, I can't tell for sure. - Phil Spector Statistical Com

[R] New methods for generic functions show and print : some visible with ls(), some not

2010-02-26 Thread Joris Meys
Dear all, I'm trying to understand the S4 way of object-oriented programming, but I still can't grasp completely what R is doing. I have a class definition for a class called PM10Meteo, and I set a initializer function. next, I include a show method and a print method as shown below. setClass( Cl

[R] Working directories... Again

2010-02-26 Thread Allen L
Dear R forum, I've looked many places for this and figure there must be an easy way to implement. I want to set the working directory in my script to the place where the R code is located. Something like: >setwd(directory where this script is found). Thanks! -Allen -- View this message in con

Re: [R] biclust package

2010-02-26 Thread Martin Maechler
> "UweL" == Uwe Ligges > on Fri, 26 Feb 2010 17:24:43 +0100 writes: UweL> On 26.02.2010 17:04, linda garcia wrote: >> Dear all, >> I am using biclust package for biclustering. I wanted to >> know how can I extract my clusters from the object? >> >> >> lib

Re: [R] text editors

2010-02-26 Thread Sharpie
Sharpie wrote: > > For example, I spend an equal amount of time working on Windows, OS X and > Linux. There are a ton of great Windows-only editors out there, but they > aren't a good option for me because I only use windows 1/3 of the time I'm > at a computer. > > Some good editors I know of

Re: [R] text editors

2010-02-26 Thread Sharpie
Dwayne Blind wrote: > > Dear all, > > Do you use a text editor ? What would you recommend for Windows users ? > What > about Tinn-R ? > > Thank you very much, > Dwayne > > Learning a text editor is a significant and very valuable investment of your time. In order to maximize the return fro

Re: [R] two questions for R beginners

2010-02-26 Thread Claudia Beleites
Dear Patrick (and all) I'm now working with R a couple of years, before working mostly in Matlab Lazy & impatient is both true for me :-) * What were your biggest misconceptions or stumbling blocks to getting up and running with R? > * What documents helped you the most in this > initial phas

Re: [R] text editors

2010-02-26 Thread gerald . jean
I also agree, Emacs without question. The learning curve is a bit steep but once you know it you can use it for just about anything, but cleaning the kitchen sink! Gérald Jean Conseiller senior en statistiques, VP Planification et Développement des Marchés, Desjardins Groupe d'Assurances Générale

Re: [R] Problem accessing sub-methods of functions stored in a vector

2010-02-26 Thread Gabor Grothendieck
On Fri, Feb 26, 2010 at 11:57 AM, Matt Asher wrote: > Hi, > > This: > > agents <- list(agent(1), agent(2)) > > worked perfectly. Thanks Uwe! > > I'm not fully sure what you mean by this: > > " > Anyway, I hope you know that lexical scoping will yield in the > environments attached to all those fun

Re: [R] text editors

2010-02-26 Thread Ista Zahn
As has been said before: Emacs! It's not as scary as it used to be. For Windows I recommend http://vgoulet.act.ulaval.ca/en/ressources/emacs/ -Ista On Fri, Feb 26, 2010 at 11:10 AM, Dwayne Blind wrote: > Dear all, > > Do you use a text editor ? What would you recommend for Windows users ? What >

Re: [R] Problem accessing sub-methods of functions stored in a vector

2010-02-26 Thread Matt Asher
Hi, This: agents <- list(agent(1), agent(2)) worked perfectly. Thanks Uwe! I'm not fully sure what you mean by this: " Anyway, I hope you know that lexical scoping will yield in the environments attached to all those functions they have been generated in and you know about possible consequenc

Re: [R] t-distribution values

2010-02-26 Thread Peter Ehlers
How about taking the unusual step of reading 'An Introduction to R', where, if you peruse the table of contents, you will quickly be led to Chapter 8: Probability Distributions. -Peter Ehlers On 2010-02-26 7:23, Антон Морковин wrote: Dear all, how to calculate values of t-distribut

Re: [R] question to make a vector without loop

2010-02-26 Thread Joshua Wiley
My apologies, I misread your formula. Here is a clearer example anyways: w <- 1:10 N <- length(w) a <- 1 b <- 1 k <- 1:(N-1) w[k+1] <- w[k]*(a/(b+k)) w [1] 1.000 0.500 0.667 0.750 0.800 0.833 0.8571429 [8] 0.875 0.889 0.900 Best, Josh On Fri, Feb 26, 2010

Re: [R] Boot R

2010-02-26 Thread Paul Hiemstra
Cassiano wrote: I think I have 'libgfortran'. After that I digit 'dpkg -l | grep libgfortran' in terminal, I got this message: ii libgfortran2 4.2.4-5ubuntu1 Runtime library for GNU Fortran applications ii libgfortran2-dbg

Re: [R] Boot R

2010-02-26 Thread Paul Hiemstra
Cassiano wrote: I think I have 'libgfortran'. After that I digit 'dpkg -l | grep libgfortran' in terminal, I got this message: ii libgfortran2 4.2.4-5ubuntu1 Runtime library for GNU Fortran applications ii libgfortran2-dbg

Re: [R] biclust package

2010-02-26 Thread Uwe Ligges
On 26.02.2010 17:04, linda garcia wrote: Dear all, I am using biclust package for biclustering. I wanted to know how can I extract my clusters from the object? library(biclust) test<- matrix(rnorm(5000), 100, 50) test[11:20,11:20]<- rnorm(100, 3, 0.1) loma<- binarize(test,

Re: [R] two questions for R beginners

2010-02-26 Thread Paul Hiemstra
Thomas Adams wrote: Paul, I think your point "you need [to] spend at least a few hours a week on it" is key. Since I am not doing statistics daily, more in fits & starts as my latest project -may- require, my approach has been more task oriented. A less-than-ideal approach. So, I think your s

Re: [R] text editors

2010-02-26 Thread Gabor Grothendieck
There is a list here: http://www.sciviews.org/_rgui/projects/Editors.html On Fri, Feb 26, 2010 at 11:10 AM, Dwayne Blind wrote: > Dear all, > > Do you use a text editor ? What would you recommend for Windows users ? What > about Tinn-R ? > > Thank you very much, > Dwayne > >        [[alternative

Re: [R] question to make a vector without loop

2010-02-26 Thread Gabor Grothendieck
A general facility for this is Reduce: f <- function(w, k, a = 2, b = 1) w*a / (b+k) c(7, Reduce(f, 2:9, 7, accumulate = TRUE)) the result of which is: c(7, Reduce(f, 2:9, 7, accumulate = TRUE)) [1] 7.00 7.00 4.67 2.33 0.93 0.31 0.09 0.022

[R] possible arrangements of across sample ties for runs test

2010-02-26 Thread Dale Steele
I'm trying to implement the two-sample Wald-Wolfowitz runs test. Daniel (1990) suggests a method to deal with ties across samples. His suggestion is to prepare ordered arrangements, one resulting in the fewest number of runs, and one resulting in the largest number of runs. Then take the mean of

Re: [R] Adjust lattice graph axis label on final page

2010-02-26 Thread Deepayan Sarkar
On Fri, Feb 26, 2010 at 6:14 AM, Sebastien Bihorel wrote: > Thanks Deepayan, > > This confirms what I thought I should do... One follow-up question about > your suggested code: is it possible to create a lattice graph object myplot > and modify the layout just for panel 7 and 8, rather than creati

Re: [R] Restructure some data

2010-02-26 Thread Doran, Harold
Thank you both for your replies; both are very useful. The larger issue at hand is that the data will actually be huge, thus the end result will be a very large, sparse data frame. So, I decided to put all three possible solutions to a timing test and see what they yield. I simulated 15000 poss

Re: [R] Problem accessing sub-methods of functions stored in a vector

2010-02-26 Thread Uwe Ligges
On 26.02.2010 16:33, Matt Asher wrote: Hi folks, I am having trouble accessing sub-functions when the main function is stored in an array. For example, the following test code works fine: fcns = c(abs, sqrt) fcns[[1]](-2) fcns[[2]](2) However, when I try to access sub-functions declared with

Re: [R] text editors

2010-02-26 Thread Erik Iverson
Dwayne Blind wrote: Dear all, Do you use a text editor ? What would you recommend for Windows users ? What about Tinn-R ? Dwayne, Perhaps you have seen http://www.sciviews.org/_rgui/ , it has information on several possibilities. It would be hard to pull me away from using Emacs with ESS

Re: [R] Legend's attribute

2010-02-26 Thread Uwe Ligges
On 26.02.2010 05:22, Yi Du wrote: Hi there, I use plot(type="o") to draw the line. And I need put some legend to this line. But how can I let the legend to display the line type in the graph generated from type="o"? I can only find the lty in the legend. But I tried several times and still fa

Re: [R] counting the number of ones in a vector

2010-02-26 Thread Nutter, Benjamin
But if x has any missing values: > x <- c(1, 1, 1, NA, NA, 2, 1, NA) > > sum( x == 1) [1] NA > > sum(x==1, na.rm=TRUE) [1] 4 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Henrique Dallazuanna Sent: Friday, February 26, 2010

Re: [R] question to make a vector without loop

2010-02-26 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of > khaz...@ceremade.dauphine.fr > Sent: Friday, February 26, 2010 7:23 AM > To: r-help@r-project.org > Subject: [R] question to make a vector without loop > > Hello all, > > I

  1   2   >