[R] R: R: Is there a way to extract some fields data from HTML pages through any R function ?

2009-07-05 Thread mauede
It helps. But it is overly sophisticated. I have already downloaded and used the Excel file containing the validated stuff. Since there are R commands to download gzip as well as FASTA files, I wonder whether it is possible to automatically download the Excel file from http://mirecords.umn.edu

Re: [R] ggplot2: Boxplot with given box size

2009-07-05 Thread hadley wickham
Hi Malcolm, You need to tell geom_boxplot not to use stat_boxplot: geom_boxplot(aes(lower=y_q1, upper=y_q3, middle=y_med, ymin=y_min, ymax=y_max), stat = "identity") Hadley On Mon, Jul 6, 2009 at 6:55 AM, Malcolm Ryan wrote: > Is there anyway in ggplot2 to set the aesthetics for a geom_boxplot >

[R] ggplot2: Boxplot with given box size

2009-07-05 Thread Malcolm Ryan
Is there anyway in ggplot2 to set the aesthetics for a geom_boxplot directly, rather than having them computed by an implicit stat_boxplot? If I try: ggplot(data = t, aes(x = factor(x))) + geom_boxplot(coef=NULL, aes(lower=y_q1, upper=y_q3, middle=y_med, ymin=y_min, ymax=y_max)) I get the

Re: [R] Detecting "Break"

2009-07-05 Thread Don MacQueen
You can also derive what you need using the rle() function, though the which() solution may be easier. -Don At 4:20 PM -0300 7/5/09, Henrique Dallazuanna wrote: Content-Type: text/plain Content-Disposition: inline Content-length: 944 Try this: which(c(0, diff(x)) != 0) On Sun, Jul 5, 2009

Re: [R] OK - I got the data - now what? :-)

2009-07-05 Thread Don MacQueen
At 10:42 AM -0700 7/5/09, Mark Knecht wrote: 2009/7/5 Uwe Ligges : <- a lot of other conversation omitted, to focus on the following> Currently my data is one experiment per row, but that's wasting space as most experiments only take 20% of the row and 80% of the row is filled with 0's. I

Re: [R] Error using the Rdonlp2‏ Package

2009-07-05 Thread Ryuichi Tamura
Hi, Thank you for using Rdonlp2. 2009/7/4 Lars Bishop : > Error in tryCatchList(expr, classes, parentenv, handlers) : >  SET_VECTOR_ELT() can only be applied to a 'list', not a 'character' I guess you are using an older version of Rdonlp2 that is incompatible to R-2.9.0. I have fixed the "SET_V

Re: [R] OK - I got the data - now what? :-)

2009-07-05 Thread Mark Knecht
On Sun, Jul 5, 2009 at 1:44 PM, hadley wickham wrote: >>   I think the root cause of a number of my coding problems in R right >> now is my lack of skills in reading and grabbing portions of the data >> out of arrays. I'm new at this. (And not a programmer) I need to find >> some good examples to r

Re: [R] AIC in time series

2009-07-05 Thread murilodoi
Try, > library("fGarch") > fitmodel = garchFit(formula=~ar(1)+~garch(1,1), data=garat) > fitmo...@fit$ics #is a vector with Information Criterion Statistics > fitmo...@fit$ics[1] #is the AIC Murilo Eiji Doi Ben Bolker wrote: > > Vasileios Ismyrlis gmail.com> writes: > >> >> library(

Re: [R] AIC in time series

2009-07-05 Thread murilodoi
Try, > library("fGarch") > fitmodel = garchFit(formula=~ar(1)+~garch(1,1), data=garat) > fitmo...@fit$ics #is a vector with Information Criterion Statistics > fitmo...@fit$ics[1] #is the AIC Ben Bolker wrote: > > Vasileios Ismyrlis gmail.com> writes: > >> >> library("fGarch") >> fit = garch

Re: [R] OK - I got the data - now what? :-)

2009-07-05 Thread hadley wickham
>   I think the root cause of a number of my coding problems in R right > now is my lack of skills in reading and grabbing portions of the data > out of arrays. I'm new at this. (And not a programmer) I need to find > some good examples to read and test on that subject. If I could locate > which co

[R] Announcing new features for the crantastic.org community portal

2009-07-05 Thread Bjørn Arild Mæland
We’re very pleased to announce another update to http://crantastic.org/, the community site for R packages. Notable new features include: * More package relationships. We now have enhances, imports, and reverse relationships. * Easier rating: just log-in, and click the number of stars you

Re: [R] OK - I got the data - now what? :-)

2009-07-05 Thread Mark Knecht
On Sun, Jul 5, 2009 at 1:00 PM, Henrique Dallazuanna wrote: > Yes, > > First, select only columns C1 to C6, then look for values greater than 0, > after use this to select the columns in original subset. > > On Sun, Jul 5, 2009 at 4:48 PM, Mark Knecht wrote: >> >> On Sun, Jul 5, 2009 at 12:30 PM,

Re: [R] SQL on R

2009-07-05 Thread JoK LoQ
Fala ai cara! Era o RMySQL mesmo q eu precisava, vlw Bernardo Rangel tura wrote: > > On Sat, 2009-07-04 at 22:24 -0700, JoK LoQ wrote: >> I'm dealing with lots of columns and conditions, wats t best way to deal >> with >> that? >> How do I work with SQL on R? the manual is quite confuse talki

Re: [R] From "list" to "matrix"

2009-07-05 Thread Patrick Connolly
On Sun, 05-Jul-2009 at 12:10PM -0700, megh wrote: |> |> Suppose, I have following |> |> vec <- vector("list", length=3) |> for (i in 1:3) vec[[i]] <- matrix(rnorm((i+3)*2), (i+3)) |> vec |> do.call("rbind", vec) |> |> Now I want to change the type of "vec" from list to a matrix with (4+5

Re: [R] OK - I got the data - now what? :-)

2009-07-05 Thread Henrique Dallazuanna
Yes, First, select only columns C1 to C6, then look for values greater than 0, after use this to select the columns in original subset. On Sun, Jul 5, 2009 at 4:48 PM, Mark Knecht wrote: > On Sun, Jul 5, 2009 at 12:30 PM, Henrique Dallazuanna > wrote: > > Try this: > > > > subset(test[3,], sele

Re: [R] OK - I got the data - now what? :-)

2009-07-05 Thread Mark Knecht
On Sun, Jul 5, 2009 at 12:30 PM, Henrique Dallazuanna wrote: > Try this: > > subset(test[3,], select=C1:C6)[,subset(test[3,], select = C1:C6) > 0] > > subset(test[6,], select=C1:C6)[,subset(test[6,], select = C1:C6) > 0] > > I must admit I like this one. Pleasing to look at. It seems approachable.

Re: [R] R: Is there a way to extract some fields data from HTML pages through any R function ?

2009-07-05 Thread Martin Morgan
mau...@alice.it wrote: > I tried to apply the scheme you suggested to open the web page on > "http://mirecords.umn.edu/miRecords/index.php"; and got the followiing: > >> result <- postForm("http://mirecords.umn.edu/miRecords/index.php";, > + searchType="miRNA", species="Homo sapiens", > + searchB

Re: [R] OK - I got the data - now what? :-)

2009-07-05 Thread Henrique Dallazuanna
Try this: subset(test[3,], select=C1:C6)[,subset(test[3,], select = C1:C6) > 0] subset(test[6,], select=C1:C6)[,subset(test[6,], select = C1:C6) > 0] On Sun, Jul 5, 2009 at 1:19 PM, Mark Knecht wrote: > On Sun, Jul 5, 2009 at 8:18 AM, David Winsemius > wrote: > > > > On Jul 5, 2009, at 10:50

Re: [R] Detecting "Break"

2009-07-05 Thread Henrique Dallazuanna
Try this: which(c(0, diff(x)) != 0) On Sun, Jul 5, 2009 at 4:03 PM, Arun Kumar Saha wrote: > Hi all, > > say, I have following vector : > > x <- c(rep(5, 5), rep(3,4), rep(5,10)) > > Now I want to get the index numbers where elements of that vector changes > i.e. in above example I want to get

Re: [R] From "list" to "matrix"

2009-07-05 Thread Henrique Dallazuanna
Try: do.call(rbind, vec) On Sun, Jul 5, 2009 at 4:10 PM, megh wrote: > > Suppose, I have following > > vec <- vector("list", length=3) > for (i in 1:3) vec[[i]] <- matrix(rnorm((i+3)*2), (i+3)) > vec > > > Now I want to change the type of "vec" from list to a matrix with (4+5+6) > rows and 2 co

[R] R: Is there a way to extract some fields data from HTML pages through any R function ?

2009-07-05 Thread mauede
I tried to apply the scheme you suggested to open the web page on "http://mirecords.umn.edu/miRecords/index.php"; and got the followiing: > result <- postForm("http://mirecords.umn.edu/miRecords/index.php";, + searchType="miRNA", species="Homo sapiens", + searchBox="hsa-let-7a", submitButton="Se

[R] From "list" to "matrix"

2009-07-05 Thread megh
Suppose, I have following vec <- vector("list", length=3) for (i in 1:3) vec[[i]] <- matrix(rnorm((i+3)*2), (i+3)) vec Now I want to change the type of "vec" from list to a matrix with (4+5+6) rows and 2 columns. How can I do that? Thanks and regards, -- View this message in context: http:/

[R] Detecting "Break"

2009-07-05 Thread Arun Kumar Saha
Hi all, say, I have following vector : x <- c(rep(5, 5), rep(3,4), rep(5,10)) Now I want to get the index numbers where elements of that vector changes i.e. in above example I want to get a vector with elements : 6, 10. Because at that indices, element of original vector changes value. Is there

Re: [R] allocation/initialization of arrays/lists

2009-07-05 Thread David Winsemius
On Jul 5, 2009, at 2:43 PM, Martin Morgan wrote: Hi ZRL, zrl wrote: Dear list, I have a question regarding how to allocate or initialize the proper type of the arrays or lists. I have a for loop, each iteration, I want it to assign a subset of a data frame to an element of an array or

Re: [R] OK - I got the data - now what? :-)

2009-07-05 Thread Uwe Ligges
David Winsemius wrote: On Jul 5, 2009, at 1:19 PM, Uwe Ligges wrote: snippedpreample test <- data.frame(A=1:10, B=100, C1=runif(10), C2=runif(10), C3=runif(10), C4=runif(10), C5=runif(10), C6=runif(10)) test<-round(test,2) #Make array ragged test$C3[2]<-0;test$C4[2]<-0;test$C5[2]<-0;test$C

Re: [R] allocation/initialization of arrays/lists

2009-07-05 Thread Martin Morgan
Hi ZRL, zrl wrote: > Dear list, > > I have a question regarding how to allocate or initialize the proper type of > the arrays or lists. > > I have a for loop, each iteration, I want it to assign a subset of a data > frame to an element of an array or list. > However, I am wondering how I should

Re: [R] OK - I got the data - now what? :-)

2009-07-05 Thread David Winsemius
On Jul 5, 2009, at 1:19 PM, Uwe Ligges wrote: snippedpreample test <- data.frame(A=1:10, B=100, C1=runif(10), C2=runif(10), C3=runif(10), C4=runif(10), C5=runif(10), C6=runif(10)) test<-round(test,2) #Make array ragged test$C3[2]<-0;test$C4[2]<-0;test$C5[2]<-0;test$C6[2]<-0 test$C4[3]<-0;test

Re: [R] allocation/initialization of arrays/lists

2009-07-05 Thread John Kane
Try mylist <- NULL and then just assign the subsets to each element of the list mylist[[1]] <- data1[,1] as an example --- On Sun, 7/5/09, zrl wrote: > From: zrl > Subject: [R] allocation/initialization of arrays/lists > To: r-h...@stat.math.ethz.ch > Received: Sunday, July 5, 2009, 1:58 P

[R] allocation/initialization of arrays/lists

2009-07-05 Thread zrl
Dear list, I have a question regarding how to allocate or initialize the proper type of the arrays or lists. I have a for loop, each iteration, I want it to assign a subset of a data frame to an element of an array or list. However, I am wondering how I should initialize or allocate the empty arr

Re: [R] OK - I got the data - now what? :-)

2009-07-05 Thread Mark Knecht
2009/7/5 Uwe Ligges : > > > David Winsemius wrote: >> >> On Jul 5, 2009, at 12:19 PM, Mark Knecht wrote: >> >>> On Sun, Jul 5, 2009 at 8:18 AM, David Winsemius >>> wrote: On Jul 5, 2009, at 10:50 AM, Uwe Ligges wrote: > > > David Winsemius wrote: >> >> So if your

Re: [R] OK - I got the data - now what? :-)

2009-07-05 Thread Uwe Ligges
David Winsemius wrote: On Jul 5, 2009, at 12:19 PM, Mark Knecht wrote: On Sun, Jul 5, 2009 at 8:18 AM, David Winsemius wrote: On Jul 5, 2009, at 10:50 AM, Uwe Ligges wrote: David Winsemius wrote: So if your values are calculated from other values then consider using all.equal() And r

Re: [R] OK - I got the data - now what? :-)

2009-07-05 Thread David Winsemius
On Jul 5, 2009, at 12:19 PM, Mark Knecht wrote: On Sun, Jul 5, 2009 at 8:18 AM, David Winsemius wrote: On Jul 5, 2009, at 10:50 AM, Uwe Ligges wrote: David Winsemius wrote: So if your values are calculated from other values then consider using all.equal() And repeated applications o

Re: [R] OK - I got the data - now what? :-)

2009-07-05 Thread Mark Knecht
On Sun, Jul 5, 2009 at 8:18 AM, David Winsemius wrote: > > On Jul 5, 2009, at 10:50 AM, Uwe Ligges wrote: > >> >> >> David Winsemius wrote: >>> >>> So if your values are calculated from other values then consider using >>> all.equal() >>> And repeated applications of the testing criteria process ar

Re: [R] What command lists everything in a package?

2009-07-05 Thread Barry Rowlingson
On Sun, Jul 5, 2009 at 3:40 PM, hadley wickham wrote: >> 2) Related to the above, how do I tell what packages are currently >> loaded at any given time so that I don't waste time loading things >> that are already loaded? search() tells me what's available, but >> what's loaded? The best I can find

Re: [R] another matrix problem

2009-07-05 Thread William Simpson
Thanks very much Gabor Bill On Sun, Jul 5, 2009 at 4:44 PM, Gabor Grothendieck wrote: > In terms of x this is: > > k <- 3 > x <- 1:5 > > n <- length(x) > matrix(x, 2*n-1, k)[1:n, ] > > On Sun, Jul 5, 2009 at 10:01 AM, Gabor > Grothendieck wrote: >> Try this (ignore the warning): >> >> k <- 3 >> m

Re: [R] another matrix problem

2009-07-05 Thread Gabor Grothendieck
In terms of x this is: k <- 3 x <- 1:5 n <- length(x) matrix(x, 2*n-1, k)[1:n, ] On Sun, Jul 5, 2009 at 10:01 AM, Gabor Grothendieck wrote: > Try this (ignore the warning): > > k <- 3 > matrix(1:5, 9, k)[1:5, ] > > > On Sun, Jul 5, 2009 at 8:54 AM, William > Simpson wrote: >> I want a function t

Re: [R] OK - I got the data - now what? :-)

2009-07-05 Thread David Winsemius
On Jul 5, 2009, at 10:50 AM, Uwe Ligges wrote: David Winsemius wrote: So if your values are calculated from other values then consider using all.equal() And repeated applications of the testing criteria process are effective: test[3,][which(names(test)=="C1"):(which(test[3,] == 0.0)-1)

Re: [R] OK - I got the data - now what? :-)

2009-07-05 Thread Mark Knecht
On Sun, Jul 5, 2009 at 7:35 AM, David Winsemius wrote: > > On Jul 5, 2009, at 9:53 AM, Mark Knecht wrote: > >> On Sat, Jul 4, 2009 at 5:22 PM, jim holtman wrote: >>> >>> See if this example helps; show how to either plot the row or columns >>> of a data frame: >>> test <- data.frame(C1=runif(1

Re: [R] OK - I got the data - now what? :-)

2009-07-05 Thread Uwe Ligges
David Winsemius wrote: On Jul 5, 2009, at 9:53 AM, Mark Knecht wrote: On Sat, Jul 4, 2009 at 5:22 PM, jim holtman wrote: See if this example helps; show how to either plot the row or columns of a data frame: test <- data.frame(C1=runif(10), C2=runif(10), C3=runif(10)) test C1

Re: [R] Skeleton Package to Flesh Out?

2009-07-05 Thread hadley wickham
Also make sure to check roxygen (from roxygen.org) - it makes package documentation much much easier. Ironically, the documentation for roxygen currently leaves something to be desired but I think Peter and Manuel are working on it. Hadley On Sat, Jul 4, 2009 at 3:59 PM, Jason Rupert wrote: > >

Re: [R] another matrix problem

2009-07-05 Thread Henrique Dallazuanna
Try this: foo <- function(x, ncols){ tail(embed(rep(x, ncols), ncols), length(x)) } foo(x, 3) On Sun, Jul 5, 2009 at 9:54 AM, William Simpson wrote: > I want a function that takes an input vector, the number of columns > and returns a matrix as follows. > > x<- 1:5 > > foo(x, nc=3) > > 1 5

Re: [R] What command lists everything in a package?

2009-07-05 Thread hadley wickham
> 2) Related to the above, how do I tell what packages are currently > loaded at any given time so that I don't waste time loading things > that are already loaded? search() tells me what's available, but > what's loaded? The best I can find so far goes like this: Loading something a second time t

Re: [R] OK - I got the data - now what? :-)

2009-07-05 Thread David Winsemius
On Jul 5, 2009, at 9:53 AM, Mark Knecht wrote: On Sat, Jul 4, 2009 at 5:22 PM, jim holtman wrote: See if this example helps; show how to either plot the row or columns of a data frame: test <- data.frame(C1=runif(10), C2=runif(10), C3=runif(10)) test C1C2C3 1 0.91

Re: [R] another matrix problem

2009-07-05 Thread Gabor Grothendieck
Try this (ignore the warning): k <- 3 matrix(1:5, 9, k)[1:5, ] On Sun, Jul 5, 2009 at 8:54 AM, William Simpson wrote: > I want a function that takes an input vector, the number of columns > and returns a matrix as follows. > > x<- 1:5 > > foo(x, nc=3) > > 1 5 4 > 2 1 5 > 3 2 1 > 4 3 2 > 5 4 3 >

Re: [R] OK - I got the data - now what? :-)

2009-07-05 Thread Mark Knecht
On Sun, Jul 5, 2009 at 12:00 AM, Mark Wardle wrote: > Hi. Essentially your data is currently in "wide" format, with repeated > measures in different columns. For most analysis and in particular for > graphing, it is frequently helpful to reshape your data into a "long" > format, with one row per da

Re: [R] OK - I got the data - now what? :-)

2009-07-05 Thread Mark Knecht
On Sat, Jul 4, 2009 at 5:22 PM, jim holtman wrote: > See if this example helps; show how to either plot the row or columns > of a data frame: > >> test <- data.frame(C1=runif(10), C2=runif(10), C3=runif(10)) >> test >           C1        C2        C3 > 1  0.91287592 0.3390729 0.4346595 > 2  0.29360

Re: [R] another matrix problem

2009-07-05 Thread David Winsemius
On Jul 5, 2009, at 8:54 AM, William Simpson wrote: I want a function that takes an input vector, the number of columns and returns a matrix as follows. x<- 1:5 foo(x, nc=3) 1 5 4 2 1 5 3 2 1 4 3 2 5 4 3 See if this gives you any ideas: sapply(1:3, function(z) { ((x - z) %% 5) +1 } ) Da

Re: [R] NA values trimming

2009-07-05 Thread David Winsemius
On Jul 4, 2009, at 9:22 PM, nyk wrote: I have a data matrix containing quite a lot of missing values (NA). I know how to remove all column or rows containing NA values, but is there a some standard method for removing not all NA containing rows/column, but only those which have signific

[R] another matrix problem

2009-07-05 Thread William Simpson
I want a function that takes an input vector, the number of columns and returns a matrix as follows. x<- 1:5 foo(x, nc=3) 1 5 4 2 1 5 3 2 1 4 3 2 5 4 3 Thanks again for any help. Bill __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R] matrix problem

2009-07-05 Thread William Simpson
Thanks everyone for your help! Bill __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducib

Re: [R] SQL on R

2009-07-05 Thread Bernardo Rangel Tura
On Sat, 2009-07-04 at 22:24 -0700, JoK LoQ wrote: > I'm dealing with lots of columns and conditions, wats t best way to deal with > that? > How do I work with SQL on R? the manual is quite confuse talking about that. > Do I need a package? I don't understand your question, but if you think use S

[R] SQL on R

2009-07-05 Thread JoK LoQ
I'm dealing with lots of columns and conditions, wats t best way to deal with that? How do I work with SQL on R? the manual is quite confuse talking about that. Do I need a package? -- View this message in context: http://www.nabble.com/SQL-on-R-tp24340314p24340314.html Sent from the R help mail

Re: [R] Simple one

2009-07-05 Thread JoK LoQ
Ben that subset(..) works, and it solves all my problems. thnks! Ben Bolker wrote: > > > > JoK LoQ wrote: >> >> Just a quickly beginner's question. >> >> I wanna find the mean only from the values from a column related to >> specific values from another one. Like, theres a 'region' colu

[R] NA values trimming

2009-07-05 Thread nyk
I have a data matrix containing quite a lot of missing values (NA). I know how to remove all column or rows containing NA values, but is there a some standard method for removing not all NA containing rows/column, but only those which have significantly more NAs than others? -- View this message

Re: [R] Export data to Multiple Sheets in Excel via xlsReadWritePro

2009-07-05 Thread Hans-Peter Suter
2009/7/2 Chris Anderson : > Is there a way to export multiple datasets into multiple excel spreadsheets > using xlsReadWritePro or with xlsReadWrite? I have answered the question in your other thread. See: http://thread.gmane.org/gmane.comp.lang.r.general/154614/focus=154752 Cheers, Hans-Peter

Re: [R] what happened to the xlsReadWrite package

2009-07-05 Thread Hans-Peter Suter
> what happened to the xlsReadWrite package? [snip] > Are there any plans for it be available again? Yes. (I do have a halfway finished version but then had much work on my regular job, my 'free-programming-time' got eaten by a e-texteditor plugin (http://github.com/swissr/rmate.tmbundle/tree/mast

Re: [R] Are there any bloggers amoung us going to useR 2009 ?

2009-07-05 Thread Tal Galili
Hi David, It looks like we will be in minority this time around. See you there, Tal On Wed, Jul 1, 2009 at 8:04 PM, David M Smith < da...@revolution-computing.com> wrote: > I'm going to both UseR! (in Rennes) and DSC (in Copenhagen), and will > be blogging about the talks and other interest

Re: [R] OK - I got the data - now what? :-)

2009-07-05 Thread Mark Wardle
Hi. Essentially your data is currently in "wide" format, with repeated measures in different columns. For most analysis and in particular for graphing, it is frequently helpful to reshape your data into a "long" format, with one row per data value and additional variables to list experiment or subj