Re: [R] Error message: object of type 'closure' is not subsettable

2012-03-01 Thread Petr PIKAL
Hi If you want sensible response you need to ask sensible question and more importantly provide working example or at least an example that produces the error you want get rid of. with test.functional.t(res.em1,res.em2,mint,maxt,se.m=0,points=300) I get Error in seq(mint, maxt, length.out

[R] Two plots with two different Y labels

2012-03-01 Thread Alaios
Dear all, I would like to place into a same plot two plots. Their y values though are different a lot (first series has around -100 y values and the second one slightly over 1). The x value are the same. I would like to have in the same plot (under the same x,y axis the two plots). Is it

Re: [R] User defined link function with extra parameters

2012-03-01 Thread ken knoblauch
Bernardo Powaga bspowaga at gmail.com writes: I would like to fit a generalized linear model for the binomial family with some non standard link functions. For instance, this is the Aranda-Ordaz link: η = ln( ( (1 - π)^-α - 1 )/α) snip Is there any way to tell glm() to add this

Re: [R] Two plots with two different Y labels

2012-03-01 Thread Dimitris Rizopoulos
Try this: set.seed(123) x - 1:5 y1 - rnorm(5) y2 - rnorm(5) par(mar = c(5,4,5,4)) plot(x, y1, xlab = x-axis, ylab = y-axis, type = l) par(new = TRUE) plot(x, y2, axes = FALSE, yaxs = i, type = l, ann = FALSE, col = 2) axis(4, las = 2) mtext(z-axis, 4, 2) I hope it helps. Best, Dimitris

Re: [R] Error message: object of type 'closure' is not subsettable

2012-03-01 Thread Aparna Sampath
Dear Petr I am sorry about the code being incomplete. I also take note of not using R keywords and functions as variable names. I was able to overcome my problem using unlist(). Thanks. Regards Aparna On Thu, Mar 1, 2012 at 3:57 PM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi If you want

[R] Trend predictions using R projects!!

2012-03-01 Thread AGGARWAL, NEERAJ (NEERAJ)
Hi, We are exploring to integrate a solution that can analyse data from MySql, and generate graphical reports showing trends/future predictions. I have just started to look into R-Project. Please let me know if R-Project provides this functionality. If yes please direct me to any

Re: [R] How are the coefficients for the ur.ers, type DF-GLS calculated?

2012-03-01 Thread Pfaff, Bernhard Dr.
Ackbar: have a look at ur.ers directly. The coefficients can be recovered from the slot 'testreg', i.e., example(ur.ers) slotNames(ers.gnp) coef(ers.gnp@testreg) RTFM: help(ur.ers) and help(ur.ers-class) Best, Bernhard -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org

Re: [R] Simulate values from VAR

2012-03-01 Thread Pfaff, Bernhard Dr.
Hello Keith, see ?Acoef for retrieving the coefficients. Incidentally, in the package dse simulation methods are made available. Best, Bernhard Dr. Bernhard Pfaff Director Global Asset Allocation Invesco Asset Management Deutschland GmbH An der Welle 5 D-60322 Frankfurt am Main Tel: +49

Re: [R] Trend predictions using R projects!!

2012-03-01 Thread Chris Campbell
Hi Neeraj Check out the task view of some of the many options for trending, time series analysis and visualisation at http://cran.r-project.org/web/views/TimeSeries.html Best wishes Chris Chris Campbell MANGO SOLUTIONS Data Analysis that Delivers +44 1249 705450 -Original

Re: [R] Two plots with two different Y labels

2012-03-01 Thread Jim Lemon
On 03/01/2012 07:13 PM, Alaios wrote: Dear all, I would like to place into a same plot two plots. Their y values though are different a lot (first series has around -100 y values and the second one slightly over 1). The x value are the same. I would like to have in the same plot (under the

[R] select rows by criteria

2012-03-01 Thread syrvn
Hello, I am stuck with selecting the right rows from a data frame. I think the problem is rather how to select them then how to implement the R code. Consider the following data frame: df - data.frame(ID = c(1,2,3,4,5,6,7,8,9,10), value = c(34,12,23,25,34,42,48,29,30,27)) What I want to

[R] convert list to text file

2012-03-01 Thread T.Galesloot
Dear R users, Is it possible to write the following list to a text-file? List: [[1]] [1] 500 [[2]] [1] 1 [[3]] [,1] [,2] [,3] [,4] [,5] FID12345 Var20211 I would like to have the textfile look like this: 500 1 FID 1 2 3 4 5 Var 2 0 2 1 1

Re: [R] User defined link function with extra parameters

2012-03-01 Thread David Winsemius
On Mar 1, 2012, at 12:52 AM, Bernardo Powaga wrote: Hello R users, I would like to fit a generalized linear model for the binomial family with some non standard link functions. For instance, this is the Aranda-Ordaz link: η = ln( ( (1 - π)^-α - 1 )/α) I know how to define a new link

Re: [R] Cleaning up messy Excel data

2012-03-01 Thread jim holtman
But there are some important reasons to use Excel. In my work there are a lot of people that I have to send the equivalent of a data.frame to who want to look at the data and possibly slice/dice the data differently and then send back to me updates. These folks do not know how to use R, but do

Re: [R] convert list to text file

2012-03-01 Thread R. Michael Weylandt
Perhaps something like sink(outtext.txt) lapply(LIST, print) sink() You could replace print with cat and friends if you wanted more detailed control over the look of the output. Michael On Thu, Mar 1, 2012 at 5:28 AM, t.galesl...@ebh.umcn.nl wrote: Dear R users, Is it possible to write the

Re: [R] Re : Create a function automatically from lm formula and coefficients?

2012-03-01 Thread Frank Harrell
yes, e.g. require(rms) f - ols( ) # ols is a wrapper for lm g - Function(f) g(age=30) # get predicted mean at age=30 and defaults for other variables (medians modes) Frank Pascal Oettli-2 wrote Hi Keith, Do you mean as predict.lm can do? Regards, Pascal

Re: [R] linear regression by column

2012-03-01 Thread Filoche
Thank everyone for your help. Problem solved. I'm getting more used with vectorization with your help, Regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/linear-regression-by-column-tp4432564p4434937.html Sent from the R help mailing list archive at Nabble.com.

[R] 'break' function in loop

2012-03-01 Thread Tsai, Pei-Chien
Dear R helpers, I have some difficulties in using 'break' function with loop, and the followings are my script. What I try to do is (1) permute 'or' first; (2) doing t-test if this 'or' pass criteria 1 (k=1); (3) end the loop when I get 10 permutations; (4) redo everything again but this time

[R] Execution of Rprofile.site

2012-03-01 Thread Ross Bowden
Hi everyone. I have recently installed R 2.14.1 on my 64-bit Windows 7 laptop. I am attempting to include some favourite functions in the Rprofile.site file to run at R start-up as I did with my previous 32-bit XP machine. I have edited the Rprofile.site file in C:\Program

Re: [R] 'break' function in loop

2012-03-01 Thread jim holtman
I have never seen 'break' used in an 'ifelse'; you probably meant to use an 'if' statement there. On Thu, Mar 1, 2012 at 8:24 AM, Tsai, Pei-Chien pei-chien.t...@kcl.ac.uk wrote: Dear R helpers, I have some difficulties in using 'break' function with loop, and the followings are my script.

Re: [R] update.formula has 512 char buffer?

2012-03-01 Thread Duncan Murdoch
On 12-02-28 2:11 PM, Chris Hane wrote: Hello, I am trying to paste together a formula to use in the mob function of party. This means the formula will be of the form y ~ x1+ ...+xM | z1+..zN. I am doing some preliminary fits of y ~ x1+ ...+xM, then want to add the conditional part of the

Re: [R] 'break' function in loop

2012-03-01 Thread Duncan Murdoch
On 12-03-01 8:24 AM, Tsai, Pei-Chien wrote: Dear R helpers, I have some difficulties in using 'break' function with loop, and the followings are my script. What I try to do is (1) permute 'or' first; (2) doing t-test if this 'or' pass criteria 1 (k=1); (3) end the loop when I get 10

Re: [R] Error in solve.default(res$hessian * n.used) :Lapack routine dgesv: system is exactly singular

2012-03-01 Thread VictorDelgado
Vinicius, Vinicius Magalhães wrote + n - length(*x.ts*) + for (p in 0:maxord[1]) for (d in 0:maxord[2]) for (q in 0:maxord[3]) + for (P in 0:maxord[4]) for (D in 0:maxord[5]) for (Q in 0:maxord[6]) + { + fit - arima(*x.ts*, order=c(p,d,q), + seas = list(order=c(P,D,Q), +

[R] barplots of several variables with different number of categories

2012-03-01 Thread jon waterhouse
If I have two factors, v1 and v2 and I want to have a stacked bar graph of the two variables side by side I could do barplot(cbind(table(v1),table(v2))) if v1 and v2 have the same number of categories. If they don't have the same number of categories this won't work. I'm sure there's a simple

Re: [R] 'break' function in loop

2012-03-01 Thread Rui Barradas
Hello, jholtman wrote I have never seen 'break' used in an 'ifelse'; you probably meant to use an 'if' statement there. On Thu, Mar 1, 2012 at 8:24 AM, Tsai, Pei-Chien lt;pei-chien.tsai@.acgt; wrote: Dear R helpers, I have some difficulties in using 'break' function with loop, and the

[R] Problems downloading file

2012-03-01 Thread Pete Brecknock
I am running the following line to download data from the US Energy Information Administration. This function has worked successfully for me in the past but yesterday gave the error/warning messages below. If I simply type http://ir.eia.gov/wpsr/psw09.xls; (no quotes) into a browser, the file is

Re: [R] Problems downloading file

2012-03-01 Thread R. Michael Weylandt
It might be a local network or OS issue: this works fine for me on my personal Mac download.file(url = http://ir.eia.gov/wpsr/psw09.xls;, destfile = ~/herewego.xls, mode = wb) Someone with more Windows knowledge may have to help you out, but often using IE settings (activated by the setInternet2

Re: [R] How to remove an object that is loaded every time R is opened?

2012-03-01 Thread Jason Love
Many thanks Jim and Chris for your helpful answers! J On Wed, Feb 29, 2012 at 11:48 AM, Chris Campbell ccampb...@mango-solutions.com wrote: Hi Jason If you close an R session and save without choosing a filename, a file called .RData will be created. Open a new session and type getwd().

Re: [R] 'break' function in loop

2012-03-01 Thread pei-chien tsai
Thank you so much Jim, Duncan, and special thanks to Rui!! The modified script from Rui works perfectly and I really learned a lot from all your suggestions. Regards, Amber -- View this message in context: http://r.789695.n4.nabble.com/break-function-in-loop-tp4435033p4435399.html Sent from

Re: [R] barplots of several variables with different number of categories

2012-03-01 Thread ilai
Jon, You could create new variables with the combined levels just for the purpose of plotting. Assume I have data.frame bpt str(bpt) 'data.frame': 12 obs. of 2 variables: $ V1: Factor w/ 3 levels low,med,high: 1 1 1 1 2 2 2 2 3 3 ... $ V2: Factor w/ 6 levels 1,2,3,4,..: 1 1 2 2 3 3 4 4 5 5

Re: [R] select rows by criteria

2012-03-01 Thread Petr Savicky
On Thu, Mar 01, 2012 at 04:27:45AM -0800, syrvn wrote: Hello, I am stuck with selecting the right rows from a data frame. I think the problem is rather how to select them then how to implement the R code. Consider the following data frame: df - data.frame(ID = c(1,2,3,4,5,6,7,8,9,10),

Re: [R] select rows by criteria

2012-03-01 Thread Petr Savicky
On Thu, Mar 01, 2012 at 05:42:48PM +0100, Petr Savicky wrote: On Thu, Mar 01, 2012 at 04:27:45AM -0800, syrvn wrote: Hello, I am stuck with selecting the right rows from a data frame. I think the problem is rather how to select them then how to implement the R code. Consider the

[R] Parameterization of Inverse Wishart distribution available in MCMCpack and bayesm libraries

2012-03-01 Thread Shantanu MULLICK
Hello Everyone Both the MCMCpack and the bayesm libraries allow us to make draws from the Inverse Wishart distribution. But I wanted to find out how exactly is the Inverse Wishart distribution parameterized in these libraries. The reason I ask is the following: Now its generally standard to

Re: [R] TM reader with text

2012-03-01 Thread Mickael R problem
Hi Richard, clearly there is a problem with latin ligature because the word resulting from my ask with findFreqTerms give me some wordsU+FB01n U+FB01nancement U+FB01nancier U+FB01nancièreU+FB01nancières U+FB01nanciersU+FB01xe where U+FB01 is a code for

Re: [R] select rows by criteria

2012-03-01 Thread Rui Barradas
Hello, syrvn wrote Hello, I am stuck with selecting the right rows from a data frame. I think the problem is rather how to select them then how to implement the R code. Consider the following data frame: df - data.frame(ID = c(1,2,3,4,5,6,7,8,9,10), value =

[R] Connecting points on a line with arcs/curves

2012-03-01 Thread hendersi
Hello, I have a spreadsheet of pairs of coordinates and I would like to plot a line along which curves/arcs connect each pair of coordinates. The aim is to visualise the pattern of point connections. Thanks! Ian -- View this message in context:

[R] how to change or copy to another the names of models

2012-03-01 Thread Waldir de Carvalho Junior
Hi I would like to know how I can change the name of a model for each trainning cycle of a model. I work with the RSNNS package and to build a neural network, I used : for (i in 5:30) model_ANN - mlp(X, Y, size=n,) # where size is the number of neurons in the hidden layer but I need to

Re: [R] select rows by criteria

2012-03-01 Thread Rui Barradas
Sorry, correction: The second index matrix is the matrix of elements not in the first, not another combination, this time 3 out of 10. Change this in my first post inxmat - with(DF, combn(ID, 3)) meansDist2 - apply(inxmat, 2, function(jnx) f(jnx, DF$value, 45)) (i2 - which(meansDist2 ==

[R] Help with segmented package

2012-03-01 Thread Filoche
Hi everyone. I'm using segmented package to find break point in a bi-linear relationship. In a particular case, I find 1 pointcut (so 2 slopes). I would like to know if it is possible to retrieve information in the segmented object that could let me to plot 1 particular segment with a different

[R] Delete rows from data.frame matching a certain criteria

2012-03-01 Thread mails
Hello, consider the following data.frame: test - data.frame(n = c(1,2,3,4,5), v = c(6,5,7,5,3), pattern = c(1,1,NA,1,NA)) test n v pattern 1 1 6 1 2 2 5 1 3 3 7 NA 4 4 5 1 5 5 3 NA I tried to use apply and the adply function to set v to

[R] Need help using Melt and cast to compute correlation for a cross tabulation

2012-03-01 Thread Walter Anderson
I have a data frame with a number of observed and predicted values by classification as shown below: Count Volume FCLASS 1 55000 6 Grade Separated 2 43000 39000 Grade Separated 3 26000 26500 Major Arterial 4 19500 2 Major Arterial ...

Re: [R] select rows by criteria

2012-03-01 Thread Petr Savicky
On Thu, Mar 01, 2012 at 05:42:48PM +0100, Petr Savicky wrote: On Thu, Mar 01, 2012 at 04:27:45AM -0800, syrvn wrote: Hello, I am stuck with selecting the right rows from a data frame. I think the problem is rather how to select them then how to implement the R code. Consider the

[R] Standard variance / devistion clarification

2012-03-01 Thread Suranga Kasthurirathne
Dear gurus, Im a newbie, and I want to ask a very general question. Assume that I have a set of numbers as follows, 1, 1, 2, 10, 100, 10,1 From these, I need to identify which number is the most different as compared to others. (in this case, it will be 100, since its way larger than the other

Re: [R] Delete rows from data.frame matching a certain criteria

2012-03-01 Thread Sarah Goslee
Hi, On Thu, Mar 1, 2012 at 11:11 AM, mails mails00...@gmail.com wrote: Hello, consider the following data.frame: test - data.frame(n = c(1,2,3,4,5), v = c(6,5,7,5,3), pattern = c(1,1,NA,1,NA)) test  n v pattern 1  1     6       1 2  2     5       1 3  3     7      NA 4  4     5      

Re: [R] Delete rows from data.frame matching a certain criteria

2012-03-01 Thread jim holtman
Your criteria did not make sense since in both cases pattern == 1, so I chose to set to NA if pattern == 1 test - data.frame(n = c(1,2,3,4,5), v = c(6,5,7,5,3), pattern = + c(1,1,NA,1,NA)) test n v pattern 1 1 6 1 2 2 5 1 3 3 7 NA 4 4 5 1 5 5 3 NA # set v to NA

Re: [R] Need help using Melt and cast to compute correlation for a cross tabulation

2012-03-01 Thread jim holtman
Here is another way of doing it: x - read.table(text =Count Volume FCLASS + 1 55000 6 'Grade Separated' + 2 43000 39000 'Grade Separated' + 3 26000 26500 'Major Arterial' + 4 19500 2 'Major Arterial', as.is = TRUE) result - sapply(split(x,

Re: [R] Standard variance / devistion clarification

2012-03-01 Thread David Winsemius
On Mar 1, 2012, at 12:30 PM, Suranga Kasthurirathne wrote: Dear gurus, Im a newbie, and I want to ask a very general question. Assume that I have a set of numbers as follows, 1, 1, 2, 10, 100, 10,1 From these, I need to identify which number is the most different as compared to others. (in

Re: [R] GLM with regularization

2012-03-01 Thread Bert Gunter
Google is your friend! -- as usual. If you had searched on glm with regularization you would have bumped into the glmnet R package, which I think is what you're looking for. -- Bert On Wed, Feb 29, 2012 at 6:22 PM, Dmitriy Lyubimov dlie...@gmail.com wrote: Hello, Thank you for probably not

Re: [R] Delete rows from data.frame matching a certain criteria

2012-03-01 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of mails Sent: Thursday, March 01, 2012 8:11 AM To: r-help@r-project.org Subject: [R] Delete rows from data.frame matching a certain criteria Hello, consider the following

Re: [R] Delete rows from data.frame matching a certain criteria

2012-03-01 Thread Ista Zahn
Hi, On Mar 1, 2012, at 12:38 PM, Sarah Goslee wrote: Hi, On Thu, Mar 1, 2012 at 11:11 AM, mails mails00...@gmail.com wrote: Hello, consider the following data.frame: test - data.frame(n = c(1,2,3,4,5), v = c(6,5,7,5,3), pattern = c(1,1,NA,1,NA)) snip So basically the result

[R] Robust ARMA Fitting in R?

2012-03-01 Thread isabella
Hello, BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; } Does any one know if there are any functions/packages available in R for robust fitting of ARMA time series models (e.g., similar to the function arima.rob() in S-PLUS)? Many thanks and

Re: [R] Delete rows from data.frame matching a certain criteria

2012-03-01 Thread Sarah Goslee
You're all correct: I copied in the wrong thing. My apologies! On Thu, Mar 1, 2012 at 1:00 PM, Ista Zahn istaz...@gmail.com wrote: Hi, On Mar 1, 2012, at 12:38 PM, Sarah Goslee wrote: Hi, On Thu, Mar 1, 2012 at 11:11 AM, mails mails00...@gmail.com wrote: Hello, consider the following

Re: [R] GLM with regularization

2012-03-01 Thread Dmitriy Lyubimov
Thank you. On Thu, Mar 1, 2012 at 9:58 AM, Bert Gunter gunter.ber...@gene.com wrote: Google is your friend! -- as usual. If you had searched on glm with regularization you would have bumped into the glmnet R package, which I think is what you're looking for. -- Bert On Wed, Feb 29, 2012

Re: [R] Delete rows from data.frame matching a certain criteria

2012-03-01 Thread David Winsemius
On Mar 1, 2012, at 1:02 PM, Sarah Goslee wrote: You're all correct: I copied in the wrong thing. My apologies! On Thu, Mar 1, 2012 at 1:00 PM, Ista Zahn istaz...@gmail.com wrote: Hi, On Mar 1, 2012, at 12:38 PM, Sarah Goslee wrote: Hi, On Thu, Mar 1, 2012 at 11:11 AM, mails

[R] 6 different errors while using glm.nb

2012-03-01 Thread Lucas
Hello to everyone. I need your help. I´m trying to fit the same *glm.nb* to a different data set and i am getting these errors in some of the data. Sometimes, one data set has two of these errors when fitting the model. 1.- Error en while ((it - it + 1) limit abs(del) eps) { : valor ausente

Re: [R] Robust ARMA Fitting in R?

2012-03-01 Thread Berend Hasselman
On 01-03-2012, at 19:03, isabe...@ghement.ca wrote: Hello, BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; } Does any one know if there are any functions/packages available in R for robust fitting of ARMA time series models (e.g., similar to the

Re: [R] Robust ARMA Fitting in R?

2012-03-01 Thread isabella
BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; } Hi Berend, Many thanks for your prompt reply. I followed your instructions but couldn't find what I was looking for. I was hoping that someone who's already worked with such a function could be able to

Re: [R] Execution of Rprofile.site

2012-03-01 Thread Uwe Ligges
On 01.03.2012 14:39, Ross Bowden wrote: Hi everyone. I have recently installed R 2.14.1 on my 64-bit Windows 7 laptop. I am attempting to include some favourite functions in the Rprofile.site file to run at R start-up as I did with my previous 32-bit XP machine. I have edited the Rprofile.site

Re: [R] Robust ARMA Fitting in R?

2012-03-01 Thread Berend Hasselman
On 01-03-2012, at 19:33, isabe...@ghement.ca wrote: Hi Berend, Many thanks for your prompt reply. I followed your instructions but couldn't find what I was looking for. I was hoping that someone who's already worked with such a function could be able to point it out to me. My Google

Re: [R] Connecting points on a line with arcs/curves

2012-03-01 Thread Uwe Ligges
?plot On 01.03.2012 16:15, hendersi wrote: Hello, I have a spreadsheet of pairs of coordinates and I would like to plot a line along which curves/arcs connect each pair of coordinates. The aim is to visualise the pattern of point connections. Thanks! Ian -- View this message in context:

Re: [R] TM reader with text

2012-03-01 Thread Milan Bouchet-Valat
Le jeudi 01 mars 2012 à 07:07 -0800, Mickael R problem a écrit : Hi Richard, clearly there is a problem with latin ligature because the word resulting from my ask with findFreqTerms give me some wordsU+FB01n U+FB01nancement U+FB01nancier U+FB01nancière

Re: [R] Plotting a registered sign

2012-03-01 Thread Dennis Fisher
R 2.14.0 OS X Marc's proposed solution (appearing at the end of this email) is perfect -- thanks so much However, some questions remain: 1. The following works: plot(1, type=n) text(1, 1, expression(symbol(\342))) but this does not work (TEXT appears in a symbol font)

Re: [R] Quantile scores as dependent variables.. an R and general method question

2012-03-01 Thread Thomas Lumley
On Thu, Mar 1, 2012 at 12:07 PM, Doran, Harold hdo...@air.org wrote: Typically this list doesn't support general statistical questions and unfortunately I don't have a better recommendation. It may be more helpful for you to work with a statistician than seek help here. My point is simply

Re: [R] select rows by criteria

2012-03-01 Thread Rui Barradas
Hello, again. Petr Savicky wrote On Thu, Mar 01, 2012 at 05:42:48PM +0100, Petr Savicky wrote: On Thu, Mar 01, 2012 at 04:27:45AM -0800, syrvn wrote: Hello, I am stuck with selecting the right rows from a data frame. I think the problem is rather how to select them then how to

Re: [R] How to deal with missing values when using Random Forrest

2012-03-01 Thread Kevin Corry
Hi, Thanks for your help, This worked very well: na.action=na.roughfix Kevin On Sun, Feb 26, 2012 at 3:10 PM, Weidong Gu anopheles...@gmail.com wrote: Hi, You can set na.action=na.roughfix which fills NAs with the mean or mode of the missing variable. Other option is to impute missing

[R] Rscript example

2012-03-01 Thread statquant2
Hi there, I am trying to find an example how to use Rscript Let's suppose I want to pass 3 arguments (I don't want [options] and -e [expressions] as described in help) *on the command line myRscript.R -arg1=value1 -arg2=value2 -arg3=value3 *In the script #! /path/to/Rscript args =

[R] fridays date to date

2012-03-01 Thread Ben quant
Hello, How do I get the dates of all Fridays between two dates? thanks, Ben [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Plotting a registered sign

2012-03-01 Thread Marc Schwartz
Hi Dennis, There are some subtleties in the way that 'symbol' is handled in plotmath. There is no symbol() function, per se, though there is an as.symbol() function, which is used differently. 'symbol' as used in plotmath, is telling R to plot the character using a symbol font, which is the

Re: [R] function for filtering and deleting vector entries

2012-03-01 Thread babyluck
Thank you Rui, that helped a lot. The correct values show up when I'm using the following code. Now fun(Temp,v) returns a matrix, and Temp and v stay the same. But I'd like to use the reduced vectors in some calculations..can they be extracted in some way so that I have them separately

Re: [R] function for filtering and deleting vector entries

2012-03-01 Thread R. Michael Weylandt
Of course, just use x - fun(Temp, v) x$Temp # To get back temp x[[Temp]] x$v # To get back v x[[v]] Michael On Thu, Mar 1, 2012 at 3:15 PM, babyluck madr...@gmx.ch wrote: Thank you Rui, that helped a lot. The correct values show up when I'm using the following code. Now  fun(Temp,v)  

Re: [R] fridays date to date

2012-03-01 Thread R. Michael Weylandt
Inelegant, but here's one way: d1 - Sys.Date() d2 - Sys.Date() + 100 library(lubridate) d - seq(d1, d2, by = day) d[wday(d)==6] Michael On Thu, Mar 1, 2012 at 3:02 PM, Ben quant ccqu...@gmail.com wrote: Hello, How do I get the dates of all Fridays between two dates? thanks, Ben      

[R] Converting a string vector with names to a numeric vector with names

2012-03-01 Thread John C Nash
Not paying close attention to detail, I entered the equivalent of pstr-c(b1=200, b2=50, b3=0.3) when what I wanted was pnum-c(b1=200, b2=50, b3=0.3) There was a list thread in 2010 that shows how to deal with un-named vectors, but the same lapply solution doesn't seem to work here i.e.,

Re: [R] fridays date to date

2012-03-01 Thread Marc Schwartz
On Mar 1, 2012, at 2:02 PM, Ben quant wrote: Hello, How do I get the dates of all Fridays between two dates? thanks, Ben Days - seq(from = as.Date(2012-03-01), to = as.Date(2012-07-31), by = day) str(Days) Date[1:153], format: 2012-03-01 2012-03-02

Re: [R] function for filtering and deleting vector entries

2012-03-01 Thread babyluck
Thank you very much!! Exactly how I wanted it :) -- View this message in context: http://r.789695.n4.nabble.com/function-for-filtering-and-deleting-vector-entries-tp4432410p4436303.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] fridays date to date

2012-03-01 Thread Ben quant
Great thanks! ben On Thu, Mar 1, 2012 at 1:30 PM, Marc Schwartz marc_schwa...@me.com wrote: On Mar 1, 2012, at 2:02 PM, Ben quant wrote: Hello, How do I get the dates of all Fridays between two dates? thanks, Ben Days - seq(from = as.Date(2012-03-01), to =

Re: [R] Plotting a registered sign

2012-03-01 Thread David Winsemius
On Mar 1, 2012, at 2:40 PM, Dennis Fisher wrote: R 2.14.0 OS X Marc's proposed solution (appearing at the end of this email) is perfect -- thanks so much However, some questions remain: 1. The following works: plot(1, type=n) text(1, 1, expression(symbol(\342))) but this

Re: [R] Rscript example

2012-03-01 Thread Petr Savicky
On Thu, Mar 01, 2012 at 11:53:00AM -0800, statquant2 wrote: Hi there, I am trying to find an example how to use Rscript Let's suppose I want to pass 3 arguments (I don't want [options] and -e [expressions] as described in help) *on the command line myRscript.R -arg1=value1 -arg2=value2

Re: [R] Converting a string vector with names to a numeric vector with names

2012-03-01 Thread Peter Langfelder
On Thu, Mar 1, 2012 at 12:28 PM, John C Nash nas...@uottawa.ca wrote: Not paying close attention to detail, I entered the equivalent of pstr-c(b1=200, b2=50, b3=0.3) when what I wanted was pnum-c(b1=200, b2=50, b3=0.3) There was a list thread in 2010 that shows how to deal with un-named

[R] fill data forward in data frame.

2012-03-01 Thread Ben quant
Hello, My direct desire is a good (fast) way to fill values forward until there is another value then fill that value foward in the data xx (at the bottom of this email). For example, from row 1 to row 45 should be NA (no change), but from row 46 row 136 the value should be 12649, and from row

Re: [R] Converting a string vector with names to a numeric vector with names

2012-03-01 Thread Petr Savicky
On Thu, Mar 01, 2012 at 03:28:31PM -0500, John C Nash wrote: Not paying close attention to detail, I entered the equivalent of pstr-c(b1=200, b2=50, b3=0.3) when what I wanted was pnum-c(b1=200, b2=50, b3=0.3) There was a list thread in 2010 that shows how to deal with un-named

Re: [R] Converting a string vector with names to a numeric vector with names

2012-03-01 Thread John C Nash
Gotta love R. Thanks to Bill Dunlap, Peter Langfelder and Jim Holtman for no less than 3 different solutions. JN On 12-03-01 04:25 PM, Peter Langfelder wrote: pstr-c(b1=200, b2=50, b3=0.3) split = sapply(strsplit(pstr, split = =), I); pnum = as.numeric(split[2, ]); names(pnum) =

Re: [R] Connecting points on a line with arcs/curves

2012-03-01 Thread John Kane
That's nice. Please read the posting guidelines and get back to us with some information on what the data looks like an what you are doing. For example do you just want lines or do you want a smoother, etc? John Kane Kingston ON Canada -Original Message- From: ir...@cam.ac.uk

Re: [R] Help with segmented package

2012-03-01 Thread vito.muggeo
dear Phil, plot.segmented() accepts vectorized 'col', 'lty' and 'lwd' arguments. Then, par(mfrow=c(1,2)) plot(o.seg,col=2:3,lty=2:3,lwd=c(1,2)) plot(z,y) plot(o.seg,col=2:3,lty=1,linkinv=T,add=T,lwd=2) hope this helps you, vito On Thu, 1 Mar 2012 08:57:39 -0800 (PST), Filoche wrote Hi

[R] problem with sum function

2012-03-01 Thread Mark A. Albins
Hi! I'm running R version 2.13.0 (2011-04-13) Platform: i386-pc-mingw32/i386 (32-bit) When i type in the command: sum(c(-0.2, 0.8, 0.8, -3.2, 1.8)) R returns the value: -5.551115e-17 Why doesn't R return zero in this case? There shouldn't be any rounding error in a simple sum. Thanks,

Re: [R] Standard variance / devistion clarification

2012-03-01 Thread John Kane
No it's an outlier problem, I think. If you have a fairly small number of sets of these numbers simple visual inspection of a boxplot for each set would probably acomplish what you want. Try this in R for an example. Just paste the next two lines into R xx - c(1, 1, 2, 10, 100, 10,1)

Re: [R] problem with sum function

2012-03-01 Thread Sarah Goslee
Of course there's rounding error: your computer can't store those decimal numbers precisely. See R FAQ 7.31 for details. See also: sum(10*c(-0.2, 0.8, 0.8, -3.2, 1.8)) / 10 Sarah On Thu, Mar 1, 2012 at 4:49 PM, Mark A. Albins kamoko...@gmail.com wrote: Hi! I'm running R version 2.13.0

Re: [R] fill data forward in data frame.

2012-03-01 Thread Petr Savicky
On Thu, Mar 01, 2012 at 02:31:01PM -0700, Ben quant wrote: Hello, My direct desire is a good (fast) way to fill values forward until there is another value then fill that value foward in the data xx (at the bottom of this email). For example, from row 1 to row 45 should be NA (no change),

Re: [R] problem with sum function

2012-03-01 Thread William Dunlap
In base ten, using any fixed number of digits, compute 1/3 + 1/3 + 1/3 (doing the divisions before the additions). Why isn't it 1? 1/5 has the same sort of problem in base two. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com -Original Message- From:

Re: [R] problem with sum function

2012-03-01 Thread Petr Savicky
On Thu, Mar 01, 2012 at 01:49:44PM -0800, Mark A. Albins wrote: Hi! I'm running R version 2.13.0 (2011-04-13) Platform: i386-pc-mingw32/i386 (32-bit) When i type in the command: sum(c(-0.2, 0.8, 0.8, -3.2, 1.8)) R returns the value: -5.551115e-17 Why doesn't R return zero in

[R] Memory problem in R

2012-03-01 Thread saqlain raza
Hi all, I am running an -MNP- multinomial probit model package using R. It gives me the following objection instead of giving me the results: Erreur : impossible d'allouer un vecteur de taille 137.9 Mo (in english: cannot allocate a 137.9 Mb vector memory).  I have already increased the memory

Re: [R] fill data forward in data frame.

2012-03-01 Thread Ben quant
That is great! Thank you very much. Ben On Thu, Mar 1, 2012 at 2:57 PM, Petr Savicky savi...@cs.cas.cz wrote: On Thu, Mar 01, 2012 at 02:31:01PM -0700, Ben quant wrote: Hello, My direct desire is a good (fast) way to fill values forward until there is another value then fill that

Re: [R] how to change or copy to another the names of models

2012-03-01 Thread Jeff Newmiller
A) you will generally get a better response when your question includes reproducible code/sample data, and a clear identification of the desired final result. B) in most cases like this, a proliferation of names is not as useful as the OP (you) thinks it is. Much better is to build a list of

Re: [R] problem with sum function

2012-03-01 Thread Petr Savicky
On Thu, Mar 01, 2012 at 04:55:55PM -0500, Sarah Goslee wrote: Of course there's rounding error: your computer can't store those decimal numbers precisely. See R FAQ 7.31 for details. See also: sum(10*c(-0.2, 0.8, 0.8, -3.2, 1.8)) / 10 Hi. This is 0. This works without rounding for one

[R] ggplot2: formula for bar width in geom_bar?

2012-03-01 Thread J Toll
Hi, I'm trying to figure out the formula used by ggplot2 to calculate the width of a bar in geom_bar so that I can use that elsewhere in the plot. My code looks like this: ggplot(xAll, aes(Date)) + geom_bar(subset = .(Direction == Up), aes(y = Change, fill = Time), stat = identity) +

Re: [R] Standard variance / devistion clarification

2012-03-01 Thread Peter Ehlers
On 2012-03-01 13:52, John Kane wrote: No it's an outlier problem, I think. If you have a fairly small number of sets of these numbers simple visual inspection of a boxplot for each set would probably acomplish what you want. Try this in R for an example. Just paste the next two lines into R

[R] How to colorize the panel backgrounds of pairs()?

2012-03-01 Thread Marius Hofert
Dear expeRts, I would like to colorize the backgrounds of a pairs plot according to the respective panel number. Here is what I tried (without success): count - 0 mypanel - function(x, y, ...){ count - count+1 bg. - if(count %in% c(1,4,9,12)) #FDFF65 else NA points(x, y, cex=0.5,

Re: [R] Computing line= for mtext

2012-03-01 Thread Frank Harrell
Rich's pointers deals with lattice/grid graphics. Does anyone have a solution for base graphics? Thanks Frank Richard M. Heiberger wrote Frank, This can be done directly with a variant of the panel.axis function. See function panel.axis.right in the HH package. This was provided for me

[R] downloading Excel files

2012-03-01 Thread Erin Hodgess
Dear R People: I have been using xlsReadWrite to read Excel files and am very pleased with it. Thank you xlsReadWrite People! My question is: is there a function, similar to get.hist.quote, to download Excel files from the web, please? Thanks, Erin -- Erin Hodgess Associate Professor

Re: [R] downloading Excel files

2012-03-01 Thread J Toll
On Thu, Mar 1, 2012 at 6:43 PM, Erin Hodgess erinm.hodg...@gmail.com wrote: Dear R People: I have been using xlsReadWrite to read Excel files and am very pleased with it.  Thank you xlsReadWrite People! My question is:  is there a function, similar to get.hist.quote, to download Excel files

Re: [R] downloading Excel files

2012-03-01 Thread Erin Hodgess
Thanks J! I was thinking about the url, download.file functions too Just wanted to make sure that there wasn't something special for Excel. Thanks, Erin On Thu, Mar 1, 2012 at 6:53 PM, J Toll jct...@gmail.com wrote: On Thu, Mar 1, 2012 at 6:43 PM, Erin Hodgess erinm.hodg...@gmail.com wrote:

  1   2   >