[R] Partial correlation coefficients Type I, Type II

2009-09-28 Thread Harold Pimentel
Hi all, This message is in response to: http://www.mail-archive.com/r-h...@stat.math.ethz.ch/msg93690.html Basically, in SAS you can retrieve the partial correlation coefficients using: proc reg data = ch11q02; model y = x1 x2/pcorr1 pcorr2; run; quit; Is there a comparable way to retrieve

Re: [R] colMeans()

2009-09-28 Thread Jim Lemon
On 09/28/2009 10:47 PM, Matteo Mattiuzzi wrote: Hello, I use the function rowMeans(x,na.rm=T). The result is the mean of valid values in each row, with NA removed. A for me very important information is, from how many valid "n" this mean has computed. The thing is, that I apply this function on

Re: [R] Tool for solving equations

2009-09-28 Thread David Winsemius
On Sep 28, 2009, at 8:49 PM, David Winsemius wrote: On Sep 28, 2009, at 6:22 PM, Dmitry Gospodaryov wrote: Does exist any tool in R to solve equations, especially complex exponential equations? For example: y = 100*exp(b*(1-exp(c*x))/c) If you plot that function, you see that it is asymp

Re: [R] packGrob and dynamic resizing

2009-09-28 Thread Paul Murrell
Hi I could speculate, but what would be more useful would be some profiling results. If you could try Rprof() on your examples (and post me the results directly), that would provide some useful information to see if some speed-ups could be made. Paul baptiste auguie wrote: Hi, I just tr

Re: [R] Tool for solving equations

2009-09-28 Thread David Winsemius
On Sep 28, 2009, at 6:22 PM, Dmitry Gospodaryov wrote: Does exist any tool in R to solve equations, especially complex exponential equations? For example: y = 100*exp(b*(1-exp(c*x))/c) If it is so, then what is the package i have to use and what is algorythm for this solving? Thank you for ad

Re: [R] Polynomial Fitting

2009-09-28 Thread Rolf Turner
On 29/09/2009, at 10:52 AM, chris carleton wrote: Hello All, This might seem elementary to everyone, but please bear with me. I've just spent some time fitting poly functions to time series data in R using lm() and predict(). I want to analyze the functions once I've fit them to the vario

Re: [R] xyplot help - colors and break in plot

2009-09-28 Thread Felix Andrews
2009/9/29 Tim Clark : > Dear List, > > I am new to lattice plots, and am having problems with getting my plot to do > what I want. Specifically: > > 1. I would like the legend to have the same symbols as the plot. I tried > simpleKey but can't seem to get it to work with autoKey. Right now my

[R] plot error -- figure margins too large

2009-09-28 Thread Ping-Hsun Hsieh
Hi, I am trying to plot my dataset, consisting of one column with numeric values and one column with group IDs. The set is similar to the following df. df <- NULL for ( i in 1:20) { tmp1 <- runif(1000,0,5) tmp2 <- cbind(tmp1,i) df <- rbind(df,tmp2) } Now I would like to plot the numeric

[R] Tool for solving equations

2009-09-28 Thread Dmitry Gospodaryov
Does exist any tool in R to solve equations, especially complex exponential equations? For example: y = 100*exp(b*(1-exp(c*x))/c) If it is so, then what is the package i have to use and what is algorythm for this solving? Thank you for advance. With regard, Dmitry. __

[R] Polynomial Fitting

2009-09-28 Thread chris carleton
Hello All, This might seem elementary to everyone, but please bear with me. I've just spent some time fitting poly functions to time series data in R using lm() and predict(). I want to analyze the functions once I've fit them to the various data I'm studying. However, after pulling the

Re: [R] help with lda function

2009-09-28 Thread David Winsemius
Your results are the same (after scaling and sign reversal) out to the 4th decimal place as those from lda (which by the way is almost certainly from the MASS package and not from an impossible to find "lda package".) > read.table(textConnection(txt)) V1 1 164.4283 2 166.2492 3 170.

[R] help with lda function

2009-09-28 Thread Pete Shepard
I am having a problem understanding the lda package. I have a dataset here: [,1] [,2] [,3] [1,] 2.95 6.630 [2,] 2.53 7.790 [3,] 3.57 5.650 [4,] 3.16 5.470 [5,] 2.58 4.461 [6,] 2.16 6.221 [7,] 3.27 3.521 If I do the following; "names(d)<-c("y","x1","x2") d$x1 = d$x

Re: [R] for loop

2009-09-28 Thread Ray Brownrigg
On Tue, 29 Sep 2009, Antonio Paredes wrote: > Can somebody give a hint on how to speed-up the following loop: > > > for(j in 0:KM1) > { >k=j*60 >for(i in 1:60) >{ > dat$yvac[k+i]= rbinom(1,dat$nvac[k+i],dat$p.trt[j+i]) > } > } > > K1=999 How about: rbinom((KM1 + 1)*60, dat$nvac

Re: [R] Help with time series

2009-09-28 Thread David Winsemius
On Sep 28, 2009, at 4:07 PM, steve_fried...@nps.gov wrote: Hello I'm working with a bunch of time series data. The data are downloaded from a server and stored as ascii files prior to reading them into R. After reading the data sets read into R with no problem and I can us the ts funct

Re: [R] rsolnp- Error (Help!)

2009-09-28 Thread Ravi Varadhan
Since you only have box constraints, you do not need to use "rsolnp". You can use `nlminb' or optim's "L-BFGS-B" or `spg' in "BB". I ran your problem using these algorithms, and I was not sure that I was getting a local minimum. Check your functions carefully, it seems like you may have som

[R] how to visualize gini coefficient in each node in RF?

2009-09-28 Thread Chrysanthi A.
Dear all, I am working with randomForest package and I am interested in examining the "Gini importance" measures that are used as a general indicator of feature relevance. Is there a possibility of getting the Gini measure that is being estimated in each tree by the output of the getTree() functio

Re: [R] re trieve user input from an tcl/tk interface

2009-09-28 Thread Greg Snow
Here is one approach: getInfo <- function() { require(tcltk) tt <- tktoplevel() trials <- tclVar(100) Stimuli <- tclVar(10) f1 <- tkframe(tt) tkpack(f1, side='top') tkpack(tklabel(f1, text='trials: '), side='left') tkpack(tkentry(f1,

[R] xyplot help - colors and break in plot

2009-09-28 Thread Tim Clark
Dear List, I am new to lattice plots, and am having problems with getting my plot to do what I want. Specifically: 1. I would like the legend to have the same symbols as the plot. I tried simpleKey but can't seem to get it to work with autoKey. Right now my plot has dots (pch=19) and my leg

Re: [R] Running an ANOVA with a BY

2009-09-28 Thread Tobias Verbeke
baxterj wrote: I downloaded the package and got it to work with the coding: model <- function(df) {aov(values ~ WellID, data = twelldata)} Hmm.. I guess you mean to use 'data = df' instead of 'data = twelldata' ANOVA1way <- dlply(twelldata, .(Analyte), model) print(ANOVA1way) This gives me

Re: [R] 3D to 2D projection

2009-09-28 Thread Nair, Murlidharan T
The code works fine. Was interested in understanding how to project it on a particular plane so that it looks symmetrical. I think I can get that info here from what Hadley sent http://en.wikipedia.org/wiki/3D_projection Cheers../Murli -Original Message- From: David Winsemius [mailto

Re: [R] rsolnp- Error (Help!)

2009-09-28 Thread tushar_kul
Thanks, Ravi. I have attached the code again. (Still the same error) http://www.nabble.com/file/p25652730/OptTS.txt OptTS.txt Ravi Varadhan wrote: > > I was trying to run your code, but it seems like you haven’t specified the > parameter called `Strk', so I was unable to run it. Can you sen

Re: [R] 3D to 2D projection

2009-09-28 Thread Nair, Murlidharan T
Thank you for this info. I think this has what I need. Cheers../murli -Original Message- From: hadley wickham [mailto:h.wick...@gmail.com] Sent: Monday, September 28, 2009 2:27 PM To: Nair, Murlidharan T Cc: David Winsemius; r-h...@stat.math.ethz.ch Subject: Re: [R] 3D to 2D projection

Re: [R] Select.spatial on spplots

2009-09-28 Thread Roger Bivand
Charlie's reply is quite correct - without an example that others can reproduce, it is hard to offer help. Julius is also ignoring the fact that spplot() methods use lattice graphics, while select.spatial() uses base graphics. The spplot() method for SpatialPointsDataFrames objects does provide an

[R] multiclass SVM (e1071 package): number of estimated models

2009-09-28 Thread David Meyer
Dear John, there *are* indeed 3 classifiers trained, as you can see from predict(model, iris, decision.values = TRUE) However, the coefficients are stored in a compressed format -- see svminternals.txt in the /doc subdirectory. Best David - I run multiclass SVM for iris dat

Re: [R] Running an ANOVA with a BY

2009-09-28 Thread baxterj
I downloaded the package and got it to work with the coding: model <- function(df) {aov(values ~ WellID, data = twelldata)} ANOVA1way <- dlply(twelldata, .(Analyte), model) print(ANOVA1way) This gives me degrees of freedom and sum of squares for each anova per analyte. However, I cant get the su

Re: [R] Running an ANOVA with a BY

2009-09-28 Thread David Scott
baxterj wrote: I have a simple 1 way anova coded like summary(ANOVA1way <- aov(Value ~ WellID, data = welldata)) How can I use the BY function to do this ANOVA for each group using another variable in the dataset?? I tried coding it like this, but it doesn't seem to work. summary(ANOVA1way <-

Re: [R] SAS user now converting to R - Help with Transpose

2009-09-28 Thread John Kane
library(reshape) melt(dataset) # assuming dataset is a data.frame. --- On Mon, 9/28/09, baxterj wrote: > From: baxterj > Subject: [R] SAS user now converting to R - Help with Transpose > To: r-help@r-project.org > Received: Monday, September 28, 2009, 10:24 AM > > I am just starting to code

[R] Help with time series

2009-09-28 Thread Steve_Friedman
Hello I'm working with a bunch of time series data. The data are downloaded from a server and stored as ascii files prior to reading them into R. After reading the data sets read into R with no problem and I can us the ts function to coerce them to time series, sometimes this works and sometime

[R] (no subject)

2009-09-28 Thread Pete Shepard
Hello, I am having a problem understanding the lda package. I have a dataset here: [,1] [,2] [,3] [1,] 2.95 6.630 [2,] 2.53 7.790 [3,] 3.57 5.650 [4,] 3.16 5.470 [5,] 2.58 4.461 [6,] 2.16 6.221 [7,] 3.27 3.521 If I do the following; "names(d)<-c("y","x1","x2") d

[R] re trieve user input from an tcl/tk interface

2009-09-28 Thread einsundeins
Hello everyone, this is my first post here and I hope I signed up correctly and someone will take me by the hand and help me out. I am new to R and cannot figure out what to do here... ... I want to have an User Interface that requests input. I want to save this input to a variable to use it lat

Re: [R] Running an ANOVA with a BY

2009-09-28 Thread David Winsemius
On Sep 28, 2009, at 11:39 AM, baxterj wrote: I have a simple 1 way anova coded like summary(ANOVA1way <- aov(Value ~ WellID, data = welldata)) How can I use the BY function to do this ANOVA for each group using another variable in the dataset?? I tried coding it like this, but it doesn'

Re: [R] 3D to 2D projection

2009-09-28 Thread David Winsemius
On Sep 28, 2009, at 1:41 PM, Nair, Murlidharan T wrote: David, Have you used persp or trans3d before? Yes, both. persp requires an x-y grid of a particular sort ... from the help page Arguments x, y locations of grid lines at which the values in z are measured. These must be in as

Re: [R] SAS user now converting to R - Help with Transpose

2009-09-28 Thread Paul Hiemstra
Hi, Also take a look at cast(), melt() and recast() from the reshape package. Great and very flexible functions. cheers, Paul Daniel Malter schreef: ?reshape hth, Daniel baxterj wrote: I am just starting to code in R and need some help as I am used to doing this in SAS. I have a data

Re: [R] 3D to 2D projection

2009-09-28 Thread hadley wickham
> Have you used persp or trans3d before? Here is a little piece of data that I > am want to convert to 2d. I can plot (x,z) or (z,y). I know there is a better > way to convert it to 2d. I did it long time back in my 3d geometry class. http://en.wikipedia.org/wiki/3D_projection ? Hadley -- htt

Re: [R] R and REST API's

2009-09-28 Thread Duncan Temple Lang
Hi Gary, Greg, et al. In addition to making some things slightly simpler, the RCurl package also provides some necessary lower-level control over the HTTP requests. Firstly, it can handle HTTPS. Secondly, numerous REST applications will require more information in the header of the HTTP request,

Re: [R] data frame's column names not the same as in CSV

2009-09-28 Thread Derek Foo
Thank you all. I would like to say that it was my first time posting on the r-help mailing list. I am very impressed and grateful that I got the answer to my problem so quickly. Back to the issue, using read.csv (instead of read.csv) and turning off the check.names flag solved my problem. Derek

Re: [R] Sweave, TEXINPUTS problem

2009-09-28 Thread johannes rara
Yes! I found the solution. The problem was in my export line in .bash_profile. The correct line is here export TEXINPUTS=.:/Library/Frameworks/R.framework/Resources/share/texmf:$TEXINPUTS -Johannes 2009/9/28 Charles C. Berry : > On Mon, 28 Sep 2009, johannes rara wrote: > >> Hi, >> >> I'm tryi

Re: [R] error while plotting

2009-09-28 Thread Nair, Murlidharan T
-Original Message- From: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de] Sent: Sunday, September 27, 2009 1:17 PM To: Nair, Murlidharan T Cc: r-help@r-project.org Subject: Re: [R] error while plotting Nair, Murlidharan T wrote: > I am getting the following errors when I am trying

Re: [R] 3D to 2D projection

2009-09-28 Thread Nair, Murlidharan T
David, Have you used persp or trans3d before? Here is a little piece of data that I am want to convert to 2d. I can plot (x,z) or (z,y). I know there is a better way to convert it to 2d. I did it long time back in my 3d geometry class. Thanks ../Murli library(scatterplot3d) dnaStr<-structure

Re: [R] SAS user now converting to R - Help with Transpose

2009-09-28 Thread Corrado
I think you want to look at the command "reshape", it may solve your problem. Type ?reshape in the R console on your system. On Monday 28 September 2009 18:35:25 Gabor Grothendieck wrote: > > I have a dataset that looks like this: > > > > Chemical Well1 Well2 Well3 Well4 > > BOD 13.2 14.2 15.5 14

Re: [R] SAS user now converting to R - Help with Transpose

2009-09-28 Thread Gabor Grothendieck
There is a book called R for SAS and SPSS Users which you might want to look at. On Mon, Sep 28, 2009 at 10:24 AM, baxterj wrote: > > I am just starting to code in R and need some help as I am used to doing this > in SAS. > > I have a dataset that looks like this: > > Chemical Well1 Well2 Well3 W

Re: [R] SAS user now converting to R - Help with Transpose

2009-09-28 Thread baxterj
Thank you! That worked if I coded it like this: twelldata <- cbind(welldata$Chemical, stack(welldata, names(welldata))) names(twelldata)[names(twelldata)=="ind"] <- "WellID" Henrique Dallazuanna wrote: > > Try this: > > cbind(DF$Chemical, stack(DF, names(DF))) > > On Mon, Sep 28, 2009 at

Re: [R] Sweave, TEXINPUTS problem

2009-09-28 Thread johannes rara
Thanks. I'm using Aquamacs. I think that it uses pdflatex to typeset .tex-files. I can find pdflatex from my computer using ~ > locate pdflatex Johannes 2009/9/28 Charles C. Berry : > On Mon, 28 Sep 2009, johannes rara wrote: > >> Hi, >> >> I'm trying to use Sweave in my .tex-documents using >>

Re: [R] Sweave, TEXINPUTS problem

2009-09-28 Thread Charles C. Berry
On Mon, 28 Sep 2009, johannes rara wrote: Hi, I'm trying to use Sweave in my .tex-documents using \usepackage{Sweave} notation. I have this line in my .bash_profile export TEXINPUT=.:/Users/jrara/Library/Frameworks/R.framework/Resources/share/texmf:$TEXINPUTS When trying to typeset this .t

Re: [R] Data formatting for matplot

2009-09-28 Thread Tim Clark
Thanks for everyones help. It is great to have a number of options that result in the same graph. Aloha, Tim Tim Clark Department of Zoology University of Hawaii --- On Mon, 9/28/09, Henrique Dallazuanna wrote: > From: Henrique Dallazuanna > Subject: Re: [R] Data formatting for matplo

Re: [R] Running an ANOVA with a BY

2009-09-28 Thread Tobias Verbeke
baxterj wrote: I have a simple 1 way anova coded like summary(ANOVA1way <- aov(Value ~ WellID, data = welldata)) How can I use the BY function to do this ANOVA for each group using another variable in the dataset?? I tried coding it like this, but it doesn't seem to work. summary(ANOVA1way <-

[R] Sweave, TEXINPUTS problem

2009-09-28 Thread johannes rara
Hi, I'm trying to use Sweave in my .tex-documents using \usepackage{Sweave} notation. I have this line in my .bash_profile export TEXINPUT=.:/Users/jrara/Library/Frameworks/R.framework/Resources/share/texmf:$TEXINPUTS When trying to typeset this .tex document, I get an error message saying E

Re: [R] How to assess object names within a function in lapply or l_ply?

2009-09-28 Thread Heinz Tuechler
At 18:17 28.09.2009, hadley wickham wrote: > many thanks for your answer and for the enormous work you put into plyr, a > really powerful package. > For now, I will solve my problem with a variable label attribute, I usually > attach to columns in data frames. I asked the list, because I thought,

Re: [R] Remove single entries

2009-09-28 Thread Barry Rowlingson
On Mon, Sep 28, 2009 at 5:03 PM, Raymond Danner wrote: > Dear Community, > > I have a data set with two columns, bird number and mass.  Individual birds > were captured 1-13 times and weighed each time.  I would like to remove > those individuals that were captured only once, so that I can assess

Re: [R] SAS user now converting to R - Help with Transpose

2009-09-28 Thread Henrique Dallazuanna
Try this: cbind(DF$Chemical, stack(DF, names(DF))) On Mon, Sep 28, 2009 at 11:24 AM, baxterj wrote: > > I am just starting to code in R and need some help as I am used to doing this > in SAS. > > I have a dataset that looks like this: > > Chemical Well1 Well2 Well3 Well4 > BOD 13.2 14.2 15.5 14.

[R] msm and pmatrix

2009-09-28 Thread Peter Adamson
Dear All, I’m using R package ‘msm’ to fit a multi state model to infection history data (counts of infections per month upto diagnosis of a particular disease (sink state is state 11). The observed transitions are as follows: to from 1 2 3 4 5 6 7 810

Re: [R] Levelplot without margins

2009-09-28 Thread Antje
I had a bit success with the following usage: my.padding <- list(layout.heights = list( top.padding = 0, main.key.padding = 0, key.axis.padding = 0, axis.xlab.padding = 0, xlab.

Re: [R] xtable - how to add a "sum of values in a row" column?

2009-09-28 Thread Ken-JP
Fantastic! I didn't know about addmargins()... It looks like with FUN=myfunc, I can make it do all sorts of fun calculations over the row. TYVM - Ken Henrique Dallazuanna wrote: > > Try this: > > temp.table <- xtable(temp.ts, digits = 0) > temp.table <- xtable(addmargins(as.matrix(as.dat

[R] SAS user now converting to R - Help with Transpose

2009-09-28 Thread baxterj
I am just starting to code in R and need some help as I am used to doing this in SAS. I have a dataset that looks like this: Chemical Well1 Well2 Well3 Well4 BOD 13.2 14.2 15.5 14.2 O2 7.8 2.6 3.5 2.4 TURB 10.2 14.6 18.5 17.3 and so on with more chemicals I would like to transpose my data s

[R] question on a warning(?) message from glm poisson regression

2009-09-28 Thread Paek, Insu
Hello, I got the following message after fitting the poisson regression using the glm function. Are the results (coefficient estimates, their stderr, deviance, predicted values...) reliable? Can I still go on and interpret them? How much caution should I exercise for these results with this mes

[R] residuals and missing values

2009-09-28 Thread elyakhlifi mustapha
Hello. I have some problems extracting residuals of a linear model with missing values. I don't know how to read the residuals matrix. Have you got some ideas? Thanks. [[alternative HTML version deleted]] __ R-help@r-project.org mailing

[R] Running an ANOVA with a BY

2009-09-28 Thread baxterj
I have a simple 1 way anova coded like summary(ANOVA1way <- aov(Value ~ WellID, data = welldata)) How can I use the BY function to do this ANOVA for each group using another variable in the dataset?? I tried coding it like this, but it doesn't seem to work. summary(ANOVA1way <- by(welldata, An

[R] colMeans()

2009-09-28 Thread Matteo Mattiuzzi
Hello, I use the function rowMeans(x,na.rm=T). The result is the mean of valid values in each row, with NA removed. A for me very important information is, from how many valid "n" this mean has computed. The thing is, that I apply this function on many millions of rows, so the time it takes is

[R] Using linear formula inside MLE

2009-09-28 Thread Stephen Collins
Say I have a formula Y ~ 1 + X, where X is a categorical variable. A previous thread showed how to evaluate this model using the mle package from "stats4" (see below). But, the user had to create the data matrix, X, including the column of one's for the regression constant. Is there a way to

Re: [R] R and REST API's

2009-09-28 Thread hadley wickham
On Mon, Sep 28, 2009 at 9:01 AM, Gary Lewis wrote: > Hi - Many organizations now make their data available as XML via a > REST web service architecture. Is there any R package or facility to > access this type of data directly (eg, to make the HTTP GET request > and have the downloaded data put in

Re: [R] How to assess object names within a function in lapply or l_ply?

2009-09-28 Thread hadley wickham
> many thanks for your answer and for the enormous work you put into plyr, a > really powerful package. > For now, I will solve my problem with a variable label attribute, I usually > attach to columns in data frames. I asked the list, because I thought, I am > overlooking something trivial, since

Re: [R] Levelplot without margins

2009-09-28 Thread Antje
I had a bit success with the following usage: my.padding <- list(layout.heights = list( top.padding = 0, main.key.padding = 0, key.axis.padding = 0, axis.xlab.padding = 0, xlab.

Re: [R] Remove single entries

2009-09-28 Thread Chuck Cleland
On 9/28/2009 12:03 PM, Raymond Danner wrote: > Dear Community, > > I have a data set with two columns, bird number and mass. Individual birds > were captured 1-13 times and weighed each time. I would like to remove > those individuals that were captured only once, so that I can assess mass > var

Re: [R] SAS user now converting to R - Help with Transpose

2009-09-28 Thread Daniel Malter
?reshape hth, Daniel baxterj wrote: > > I am just starting to code in R and need some help as I am used to doing > this in SAS. > > I have a dataset that looks like this: > > Chemical Well1 Well2 Well3 Well4 > BOD 13.2 14.2 15.5 14.2 > O2 7.8 2.6 3.5 2.4 > TURB 10.2 14.6 18.5 17.3 > and so o

Re: [R] Remove single entries

2009-09-28 Thread Erik Iverson
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Raymond Danner > Sent: Monday, September 28, 2009 11:03 AM > To: r-help@r-project.org > Subject: [R] Remove single entries > > Dear Community, > > I have a data set with two co

[R] Remove single entries

2009-09-28 Thread Raymond Danner
Dear Community, I have a data set with two columns, bird number and mass. Individual birds were captured 1-13 times and weighed each time. I would like to remove those individuals that were captured only once, so that I can assess mass variability per bird. I¹ve tried many approaches with no su

Re: [R] R and REST API's

2009-09-28 Thread Greg Hirson
Gary, Echoing Barry's suggestion of Omegahat packages, take a look at RCurl - http://www.omegahat.org/RCurl/ It has a function, getForm, which passes GET form parameters as a list to curl. I used it and the XML package in writing RLastFM (http://cran.r-project.org/web/packages/RLastFM/index.htm

Re: [R] R and REST API's

2009-09-28 Thread Barry Rowlingson
On Mon, Sep 28, 2009 at 3:01 PM, Gary Lewis wrote: > Hi - Many organizations now make their data available as XML via a > REST web service architecture. Is there any R package or facility to > access this type of data directly (eg, to make the HTTP GET request > and have the downloaded data put in

[R] for loop

2009-09-28 Thread Antonio Paredes
Can somebody give a hint on how to speed-up the following loop: for(j in 0:KM1) { k=j*60 for(i in 1:60) { dat$yvac[k+i]= rbinom(1,dat$nvac[k+i],dat$p.trt[j+i]) } } K1=999 -- -Tony [[alternative HTML version deleted]] __ R-

Re: [R] R and REST API's

2009-09-28 Thread Rajarshi Guha
On Mon, Sep 28, 2009 at 10:01 AM, Gary Lewis wrote: > Hi - Many organizations now make their data available as XML via a > REST web service architecture. Is there any R package or facility to > access this type of data directly (eg, to make the HTTP GET request > and have the downloaded data put

[R] Regression line w/ residuals - tuning the plot

2009-09-28 Thread Primoz PETERLIN
Hello everybody, I am sure this is a beginners' problem which is being asked recurrently every few months, but nevertheless I wasn't able to find the answer searching through the r-help list. So here is my problem: I would like to plot a set of points (y vs. x), a (linear) regression line through

Re: [R] axis label using expression()

2009-09-28 Thread Henrique Dallazuanna
Try this: plot(x,y,xlab=expression(hat(P)*4[k])) On Mon, Sep 28, 2009 at 11:59 AM, wrote: > Probably a very simple problem: > > > > I want to annotate a plot axis with a name of my data using > expression(). > > The name for the data is $\hat P4_k$ written in LaTex style -> hat > symbol above

Re: [R] creating vectors from a list

2009-09-28 Thread Henrique Dallazuanna
Try this: lapply(names(L), function(l)assign(sprintf('vector_%s', l), L[l], envir = globalenv())) ls() On Mon, Sep 28, 2009 at 11:57 AM, Christina Rodemeyer wrote: > Hi guys, > > I have a list of 250 numbers as a result of using the ?by function! > List of 246 >  $ 0   : num [1:28] 22 11 31... >

[R] Levelplot without margins

2009-09-28 Thread Antje
Hello, I'm not very experienced with lattice and I was wondering whether I get get some hints from you how to create a pure heatmap (using levelplot), without any axis, title, legend, margin at all... I just want to see the coloured squares, nothing else. Any suggestions? Antje __

Re: [R] creating vectors from a list

2009-09-28 Thread Gabor Grothendieck
Try this: > L <- list(`0` = 1:4, `1` = 2:3) > sum(L$`0`) [1] 10 > with(L, sum(`0`)) [1] 10 > # not recommended tho' this is closest to what you asked for > attach(L) > sum(`0`) [1] 10 On Mon, Sep 28, 2009 at 10:57 AM, Christina Rodemeyer wrote: > Hi guys, > > I have a list of 250 numbers as

Re: [R] Bubble Plot

2009-09-28 Thread Don MacQueen
From looking at the code for bubble(), it doesn't appear there's any way to force special treatment of selected values. However, a simple work around would be to simply exclude the zero values from the plot(s) by subsetting your data creating a1 and a2. If you really want *no* representation,

[R] axis label using expression()

2009-09-28 Thread Tobias.Mathow
Probably a very simple problem: I want to annotate a plot axis with a name of my data using expression(). The name for the data is $\hat P4_k$ written in LaTex style -> hat symbol above P, followed by a 4 and a subscripted k index I tried to write this using x<-c(1,2,3,4) y<-c(3,5,

Re: [R] How to assess object names within a function in lapply or l_ply?

2009-09-28 Thread Heinz Tuechler
Hadley, many thanks for your answer and for the enormous work you put into plyr, a really powerful package. For now, I will solve my problem with a variable label attribute, I usually attach to columns in data frames. I asked the list, because I thought, I am overlooking something trivial, sin

[R] creating vectors from a list

2009-09-28 Thread Christina Rodemeyer
Hi guys, I have a list of 250 numbers as a result of using the ?by function! List of 246  $ 0   : num [1:28] 22 11 31...  $ 1   : num [1:15] 12 14 9 ... .. .. ..  - attr(*, "dim")= int 250  - attr(*, "dimnames")=List of 1 The problem is that each list of 250 has different length! I would like to

Re: [R] Determining name of calling function.

2009-09-28 Thread Peter Dalgaard
(Oops, that was of course intended for Rolf, not Baptiste) Peter Dalgaard wrote: > baptiste auguie wrote: >> Not answering your question, but just pointing out the example of >> >> base::.NotYetImplemented() >> >> essentially doing the same thing. >> >> Best, >> >> baptiste >> >> >> 2009/9/28 Rolf

Re: [R] rsolnp- Error (Help!)

2009-09-28 Thread Ravi Varadhan
Tushar, I was trying to run your code, but it seems like you haven’t specified the parameter called `Strk', so I was unable to run it. Can you send a fully reproducible code? Ravi. --- Ravi Varadhan, Ph.D. Assis

Re: [R] Determining name of calling function.

2009-09-28 Thread Peter Dalgaard
baptiste auguie wrote: > Not answering your question, but just pointing out the example of > > base::.NotYetImplemented() > > essentially doing the same thing. > > Best, > > baptiste > > > 2009/9/28 Rolf Turner : >> I have vague recollections of seeing this question discussed on r-help >> pre

Re: [R] error while plotting

2009-09-28 Thread Uwe Ligges
Perhaps you explain us how you really generate the data that are results from the multcomp package. Then it would probbaly be clear how to proceed. Uwe Ligges Nair, Murlidharan T wrote: I am trying to plot the confidence limits form multiple comparison analysis. How do I need to construct the

Re: [R] predict missing values with svm

2009-09-28 Thread James W. MacDonald
Hi Andreas, Andreas Wittmann wrote: Dear R-Users, i want to use the function svm of the e1071 package to predict missing data data(iris) ## create missing completely at random data for (i in 1:5) { mcar <- rbinom(dim(iris)[1], siz

Re: [R] predict missing values with svm

2009-09-28 Thread Friedrich Leisch
> On Mon, 28 Sep 2009 16:12:11 +0200, > Andreas Wittmann (AW) wrote: That is a bug in predict.svm, I will inform David Meyer, the author of the function. Best, Fritz > Dear R-Users, > i want to use the function svm of the e1071 package to predict missing data > ###

Re: [R] How to assess object names within a function in lapply or l_ply?

2009-09-28 Thread hadley wickham
> or with l_ply (plyr package) > l_ply(data.frame(a=1:3, b=2:4), function(x) print(deparse(substitute(x The best way to do this is to supply both the object you want to iterate over, and its names. Unfortunately it's slightly difficult to create a data structure of the correct form to do thi

Re: [R] Scaling data

2009-09-28 Thread Peter Dalgaard
Jim Lemon wrote: > On 09/28/2009 07:55 PM, Dry, Jonathan R wrote: >> Hello all >> >> I have a data frame representing a matrix of data. For each of my >> variables (rows) I want to scale the data between 0 (representing the >> minimum value in that row) and 1 (representing the maximum value in >>

[R] predict missing values with svm

2009-09-28 Thread Andreas Wittmann
Dear R-Users, i want to use the function svm of the e1071 package to predict missing data data(iris) ## create missing completely at random data for (i in 1:5) { mcar <- rbinom(dim(iris)[1], size=1, prob=0.1) iris[mcar == 1, i] <-

Re: [R] Determining name of calling function.

2009-09-28 Thread baptiste auguie
Not answering your question, but just pointing out the example of base::.NotYetImplemented() essentially doing the same thing. Best, baptiste 2009/9/28 Rolf Turner : > > I have vague recollections of seeing this question discussed on r-help > previously, but I can't find the relevant postings

[R] R and REST API's

2009-09-28 Thread Gary Lewis
Hi - Many organizations now make their data available as XML via a REST web service architecture. Is there any R package or facility to access this type of data directly (eg, to make the HTTP GET request and have the downloaded data put into an R data frame)? I used several R search sites to look

Re: [R] How to assess object names within a function in lapply or l_ply?

2009-09-28 Thread Heinz Tuechler
Henrique, based on your solution I found out, how to avoid to name explicitly the object. lapply(data.frame(a=1:3, b=2:4), function(x) names(eval(as.list(sys.call(-1))[[2]])) [as.numeric(gsub("[^0-9]", "", deparse(substitute(x] ) Thanks, Heinz At 13:57 28.09.2009, Henrique Dallazu

[R] binary quantile regression with IV

2009-09-28 Thread KWAKSUNGIL
Hello, I was wondering if anyonw knows any reference or package about binary quantile regression with IV. I know that Kordas post "S-plus" package in his website. But I don't have S-plus. Furthermore, my friends told mw that his package is not recognized by S-plus 8. Hence, I

Re: [R] error while plotting

2009-09-28 Thread Nair, Murlidharan T
I am trying to plot the confidence limits form multiple comparison analysis. How do I need to construct the object to plot it now. Thanks ../Murli -Original Message- From: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de] Sent: Sunday, September 27, 2009 1:17 PM To: Nair, Murlidhara

Re: [R] zoo: merging aggregated zoo-objects fails

2009-09-28 Thread Gabor Grothendieck
This looks like a problem in the chron package. Define: c.chron <- function(...) chron(do.call("c", lapply(list(...), unclass))) and then try it again. I will discuss it with the chron maintainer. On Mon, Sep 28, 2009 at 6:41 AM, gunnar.p wrote: > > Hello Gabor, > thanks for your reply. Pleas

[R] JRI - get S4 objects from R and assign them again

2009-09-28 Thread ajoecker
Hello, I am writing a Java frontend for a selfwritten R program using JRI. Because I am working with my own S4 classes almost all of my R functions return a S4 object. In the Java Program I now need to run a R function and its result should be assigned to a new R variable afterwards. I tried

Re: [R] probability density function for maximum values in repeated finite samples from a normal distribution??

2009-09-28 Thread David Winsemius
On Sep 28, 2009, at 8:15 AM, Joerg van den Hoff wrote: this is probably not really a R specific question, if so apologies for off-topic posting: I'm interested in the probability density function of the maximum values from repeated samples of size N from a normal distribution: smp <- rnorm

Re: [R] probability density function for maximum values in repea

2009-09-28 Thread Ted Harding
On 28-Sep-09 12:15:39, Joerg van den Hoff wrote: > this is probably not really a R specific question, if so apologies > for off-topic posting: > > I'm interested in the probability density function of the maximum > values from repeated samples of size N from a normal distribution: > > smp <- rnor

Re: [R] synchronisation of time series data using interpolation

2009-09-28 Thread Gabor Grothendieck
You should be using read.zoo, not read.table. This read.zoo(textConnection(Lines1), ...) becomes read.zoo("test1.txt", ...) etc. See ?read.zoo and read the three vignettes in the zoo package. On Mon, Sep 28, 2009 at 8:13 AM, e-letter wrote: > I saved the data sets as files and then tried to

Re: [R] zoo: merging aggregated zoo-objects fails

2009-09-28 Thread gunnar.p
Hello Gabor, thanks for your reply. Please excuse the insufficient description of my problem. I hope this one is better: #Importing my data works basically like this dts <- dates(c("19700201","19700201","19700201","19700202","19700202"),format="ymd") tms <- times(paste(c("21:00", "22:00", "23:00"

Re: [R] zoo: merging aggregated zoo-objects fails

2009-09-28 Thread gunnar.p
Hello Gabor, I just tried dput() and it seems that running aggregate deletes the following information from zoo objects: origin = structure(c(1, 1, 1970)) So before merging I added: chron(index(z),origin=c(1,1,1970))->index(z) which solves my problem. Is that behaviour of aggregate.zoo intended

  1   2   >