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 cbe...@tajo.ucsd.edu: On Mon, 28 Sep 2009, johannes rara wrote:

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] 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] 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 --

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

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

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

[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

[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$x1 =

[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

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 j...@vt.edu wrote: From: baxterj j...@vt.edu 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

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] 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

[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

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

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] 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 send

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

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

[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

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] 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()

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 some

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

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,

[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$x1 * 100

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

[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

[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] 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

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

2009-09-28 Thread Felix Andrews
2009/9/29 Tim Clark mudiver1...@yahoo.com: 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.

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

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

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

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

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] Data formatting for matplot

2009-09-28 Thread Tim Clark
Henrique, Thanks for the suggestion. I think I may not understand matplot() because the graph did not come out like it should have. Gabor suggested: library(lattice) xyplot(y ~ x, mydat, groups = id) Which gave what I was looking for. Is there a way to get matplot() to give the same graph?

[R] A programming question - is what I want to do possible in R?

2009-09-28 Thread ewaters
I have a large data frame, 77 rows, with 10 columns. Each row represents a unique individual with 10 characteristics, some of which are categorical factors and some continuous numeric variables. Each of the ten variables is important (the 10 columns obviously correspond to the individuals of

[R] xyplot lmline: error message.

2009-09-28 Thread Andrewjohnclose
Hi, I am trying to produce an xyplot with a regression line. The data should be represented as log/log but when I fit the lmline I receive an error message - the plot is fine without the log transformation, but the then the plot is meaningless. I know it must be something simple, but I just can't

Re: [R] xyplot lmline: error message.

2009-09-28 Thread Chuck Cleland
On 9/28/2009 4:07 AM, Andrewjohnclose wrote: Hi, I am trying to produce an xyplot with a regression line. The data should be represented as log/log but when I fit the lmline I receive an error message - the plot is fine without the log transformation, but the then the plot is meaningless. I

[R] Starting values in “arima.sim” fu nction

2009-09-28 Thread Lina Rusyte
Hello,   Could someone tell me please how can I find out which starting values has R used for the simulation?   I have AR(1) model:   y(t)=0.2*y(t-1)+0.2*y(t-2) + e(t)     (e(t) is distributed according standard normal distribution)   I need y(0) (or y(t-1), then t=1) values for

Re: [R] Re ading Functions that are in a Vector

2009-09-28 Thread baptiste auguie
Hi, You said, sumstats - c(mean,sd) sumstats[1] #Gives this error but this is not an error! You created a list that contains two functions, and sumstats[1] simply prints the first one. HTH, baptiste __ R-help@r-project.org mailing list

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

2009-09-28 Thread tushar_kul
Thanks, but I do not have max(tt[2] - 10 * tol, nineq) in my script. Therefore, could the error be getting generated by rsolnp itself ? jholtman wrote: It means that your expression max(tt[2] - 10 * tol, nineq) is returning NA: Notice I get the same error: if (1==1)1 [1] 1 if (NA

[R] dichromat, regexp, and grid objects

2009-09-28 Thread baptiste auguie
Dear list, The dichromat package defines a dichromat function which Collapses red-green color distinctions to approximate the effect of the two common forms of red-green colour blindness, protanopia and deuteranopia. library(dichromat) library(grid) colorStrip - function (colors = 1:3, draw =

[R] GAM predict

2009-09-28 Thread Simone Panigada
Hi there, I am predicting animal presence in a grid using a binomial distribution and the package mgcv. My data has many many zeros, is there a way to consider this and counterbalance it in R. The results I get are probabilities of less than 0.5 and I believe the zero inflated dataset is

[R] Scaling data

2009-09-28 Thread Dry, Jonathan R
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 that row). I was wondering if there is a simple function anywhere that does

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

2009-09-28 Thread Ken-JP
I wonder if the right approach is to convert temp.ts into a matrix, add the column at the end, and then call xtable()... ...anyone have any suggestions? TIA. - Ken Ken-JP wrote: Hi, I saw this example for 2.10 Time series in the xtable gallery documentation.

Re: [R] Scaling data

2009-09-28 Thread Ted Harding
On 28-Sep-09 09:55:04, 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 that row). I was wondering if

Re: [R] Scaling data

2009-09-28 Thread baptiste auguie
Try this, library(ggplot2) apply(matrix(10*rnorm(10),2), 1, ggplot2::rescale) HTH, baptiste 2009/9/28 Dry, Jonathan R jonathan@astrazeneca.com: 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

Re: [R] Scaling data

2009-09-28 Thread Jim Lemon
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 that row). I was wondering if

[R] Trendline and R square value

2009-09-28 Thread Lathouri, Maria
Hi I would like to display the trendline and the R-square value in a xy scatter in R. For example if I want to plot f vs g I add the trendline using the commands below library(quantreg) plot(f,g) abline(rq(g~f)) however I don't know how to display the R2 in the graph. Thank you in advance.

Re: [R] Re ading Functions that are in a Vector

2009-09-28 Thread baptiste auguie
Also, have a look at each() in the plyr package, library(plyr) each(length, mean, var)(rnorm(100)) baptiste 2009/9/28 trumpetsaz stephaniezim...@gmail.com: I am trying to write a function that will have an input of a vector of functions. Here is a simplistic example. sumstats - c(mean,sd)

Re: [R] implementation of matrix logarithm (inverse of matrix exponential)

2009-09-28 Thread Martin Maechler
DB == Douglas Bates ba...@stat.wisc.edu on Sun, 27 Sep 2009 17:25:39 -0500 writes: DB There is a logm function in the expm package in the expm project on DB R-forge. See http://expm.R-forge.R-project.org/ DB Martin was the person who added that function so I will defer to his

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

2009-09-28 Thread Heinz Tuechler
Dear All, to produce output of several columns of a data frame, I tried to use lapply and also l_ply. In both cases, I would like to print a header line containing also the name of the respective column in the data frame. For example, I would like the following lapply(data.frame(a=1:3,

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

2009-09-28 Thread Henrique Dallazuanna
You can use names insteed: DF - data.frame(a=1:3, b=2:4) lapply(names(DF), function(x){ print(x) DF[x] }) On Mon, Sep 28, 2009 at 8:22 AM, Heinz Tuechler tuech...@gmx.at wrote: Dear All, to produce output

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

2009-09-28 Thread Heinz Tuechler
Thank you, Henrique, my example was simplified. In a more complexe function I want to use the objects, not just their names. In your solution, I have to adapt the function itself, depending on the name of the data.frame, which I would like to avoid. Thanks, Heinz At 13:36 28.09.2009,

Re: [R] Data formatting for matplot

2009-09-28 Thread Henrique Dallazuanna
Tim, With Gabor examples, I understand this, You can get a similar graph with plot: with(mydat, plot(x, y, col = id)) On Mon, Sep 28, 2009 at 3:01 AM, Tim Clark mudiver1...@yahoo.com wrote: Henrique, Thanks for the suggestion.  I think I may not understand matplot() because the graph did

Re: [R] Data formatting for matplot

2009-09-28 Thread Peter Ehlers
Tim, If you really want to use matplot, it's not hard. You need to feed it a matrix of x-values and a corresponding matrix of y-values. id - rep(1:5, len=100) x - rnorm(100,5,1) y - rnorm(100,20,5) xm - matrix(x, ncol = 5, byrow = TRUE) ym - matrix(y, ncol = 5, byrow = TRUE)

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

2009-09-28 Thread Henrique Dallazuanna
Heinz, Try this: lapply(DF, function(x)names(DF)[as.numeric(gsub([^0-9], , deparse(substitute(x]) On Mon, Sep 28, 2009 at 8:43 AM, Heinz Tuechler tuech...@gmx.at wrote: Thank you, Henrique, my example was simplified. In a more complexe function I want to use the objects, not just their

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

2009-09-28 Thread jim holtman
I would guess so. It may have to do with the data that you are passing in. On Mon, Sep 28, 2009 at 5:23 AM, tushar_kul tus...@gmail.com wrote: Thanks, but I do not have max(tt[2] - 10 * tol, nineq) in my script. Therefore, could the error be getting generated by rsolnp itself ? jholtman

Re: [R] A programming question - is what I want to do possible in R?

2009-09-28 Thread jim holtman
nTime - 15 # how many samples to take randomSamples - lapply(1:2000, function(){ largeDF[sample(nrow(largeDF), nTimes),] }) This will create a list of 2000 dataframes with the samples On Sun, Sep 27, 2009 at 10:45 PM, ewaters ewat...@nchecr.unsw.edu.au wrote: I have a large data frame, 77

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

2009-09-28 Thread Henrique Dallazuanna
Try this: temp.table - xtable(temp.ts, digits = 0) temp.table - xtable(addmargins(as.matrix(as.data.frame(temp.table)), 2), digits = 0) On Sun, Sep 27, 2009 at 2:24 PM, Ken-JP kfmf...@gmail.com wrote: Hi, I saw this example for 2.10 Time series in the xtable gallery documentation.

Re: [R] A programming question - is what I want to do possible in R?

2009-09-28 Thread David Winsemius
On Sep 27, 2009, at 10:45 PM, ewaters wrote: I have a large data frame, 77 rows, with 10 columns. Each row represents a unique individual with 10 characteristics, some of which are categorical factors and some continuous numeric variables. Most of us would consider that a small

Re: [R] Trendline and R square value

2009-09-28 Thread Peter Ehlers
Maria, Does rq() provide an R2? Anyway, have a look at ?text. -Peter Ehlers Lathouri, Maria wrote: Hi I would like to display the trendline and the R-square value in a xy scatter in R. For example if I want to plot f vs g I add the trendline using the commands below library(quantreg)

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

2009-09-28 Thread e-letter
I saved the data sets as files and then tried to refer to those files. Therefore the instruction: z1-read.zoo(textConnection(/path/to/test1.txt) means that I wanted to replace the manual data entry for Lines1 with a file containing the data. It seems that your instructions only work when data

Re: [R] Trendline and R square value

2009-09-28 Thread David Winsemius
On Sep 28, 2009, at 6:36 AM, Lathouri, Maria wrote: Hi I would like to display the trendline and the R-square value in a xy scatter in R. For example if I want to plot f vs g I add the trendline using the commands below library(quantreg) plot(f,g) abline(rq(g~f)) plot(f,g) Error

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

2009-09-28 Thread Joerg van den Hoff
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(N, meanval, stdev) with some mean 'meanval' and standard

[R] launching two RGUI computations from two different Excel workbooks

2009-09-28 Thread sowhat2
Hello, I have the following problem: I have excel workbooks connected with R through RExcel package. Data are being loaded from excel, then they are processed in R and then the results are being put in excel. Everything works fine, except the fact that I can't launch two or more excel

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

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,00:00,

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 inp...@gmail.com wrote: I saved the data sets as files and

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 - rnorm(N,

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 -

[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

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 pr...@uni-potsdam.de wrote: Hello Gabor, thanks for

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,

[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] 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

[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

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 r.tur...@auckland.ac.nz: I have vague recollections of seeing this question discussed on r-help previously, but I can't find

[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] 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 that row).

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 this

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] 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],

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

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 r.tur...@auckland.ac.nz: I have vague recollections of seeing this question discussed on

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.

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 Turner

[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] 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,

[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)

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,

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 christinarodeme...@yahoo.de wrote: Hi guys, I have a list

[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 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 christinarodeme...@yahoo.de wrote: Hi guys, I have a list of 250 numbers as a result of using the ?by function! List of 246  $ 0   :

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, tobias.mat...@forst.bwl.de 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 -

[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

Re: [R] R and REST API's

2009-09-28 Thread Rajarshi Guha
On Mon, Sep 28, 2009 at 10:01 AM, Gary Lewis gary.m.le...@gmail.com 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

[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]] __

  1   2   >