Re: [R] Rscript example

2012-03-01 Thread statquant2
Hey Petr, ok I was thinking that R would handle the split by itself. I guess using eval we can even make arg1=val1 being executed by R. Ok tx Colin -- View this message in context: http://r.789695.n4.nabble.com/Rscript-example-tp4436130p4437659.html Sent from the R help mailing list archive at

[R] 3d surface plot (ideally using rgl package)?

2012-03-01 Thread e-mail athula.herath
Dear HelpeRs, I would be grateful for anybody who might help to produce the following plot (the code for matlab is below) using the "rgl" package of R? [t,r] = meshgrid(linspace(0,2*pi,361),linspace(-4,4,101)); [x,y] = pol2cart(t,r); P = peaks(x,y); figure('color','white'); polarplot3d(P,'colorda

Re: [R] range of group variables

2012-03-01 Thread Joshua Wiley
You could loop through the list using lapply() or the like. One way would be to subset the data and use . Notation which expands to all variables in the dataset not used elsewhere in the model (ie not the outcomes). Cheers, Josh On Mar 1, 2012, at 14:29, sajjad R wrote: > > Dear All, >

Re: [R] Execution of Rprofile.site

2012-03-01 Thread Ross Bowden
Uwe You ask "What makes you think code is "not executed"?". In the Rprofile I've added "par_old<-par()" near the start and par_old is not present when I run R. I've also included the code for a simple popup window using tkmessageBox that doesn't appear and I try writing out one line to a

[R] range of group variables

2012-03-01 Thread sajjad R
Dear All, I hope to run some simple survival analysis using the cox-proportional hazard models in R, my command will look like below: cox <- summary( coxph( Surv( mortality , TIME ) ~ Independent variables ) ) My query is about specifying a range of independnt variables in R, such that each in

[R] e1071 SVM: Cross-validation error confusion matrix

2012-03-01 Thread ChristianR
Hi, I ran two svm models in R e1071 package: the first without cross-validation and the second with 10-fold cross-validation. I used the following syntax: #Model 1: Without cross-validation: > svm.model <- svm(Response ~ ., data=data.df, type="C-classification", > kernel="linear", cost=1) >

[R] Vector errors and missing values

2012-03-01 Thread jahughes81
Hi, I am trying to run two Non-Gaussian regressions: logistic and probit. I am receiving two different errors when I try to run these regressions and I am not sure what they mean or how to fix my syntax. Here is the logistic regression error: Error in family$linkfun(mustart) : Argument mu mus

Re: [R] read.table issue with "#"

2012-03-01 Thread Rui Barradas
Hello, > > The problem is that I get a the following error bacause anything after the > # is ignored. > > Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, > : > line 6 did not have 500 elements > > R thinks that line 6 has only 2 elements because of the #. > Use '

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

2012-03-01 Thread ilai
What do you make of the following from ?riwish " riwish(v, S) v: Degrees of freedom (scalar). " does a m/2 parameterization yield a scalar for, say, 3 dof ? On Thu, Mar 1, 2012 at 9:55 AM, Shantanu MULLICK wrote: > Hello Everyone > > Both the MCMCpack and the bayesm libraries allow u

Re: [R] Standard variance / devistion clarification

2012-03-01 Thread Suranga Kasthurirathne
Hi, thank you very much for the advice. I'll try it out, and see where I can take it from there. @david, your point is noted. I will avoid such mails in the future. On Fri, Mar 2, 2012 at 4:57 AM, Peter Ehlers wrote: > On 2012-03-01 13:52, John Kane wrote: > >> No it's an outlier problem, I

Re: [R] data frame of strings formatted

2012-03-01 Thread Ben quant
Thanks a ton! That is great. ben On Thu, Mar 1, 2012 at 9:29 PM, Peter Langfelder wrote: > On Thu, Mar 1, 2012 at 8:05 PM, Ben quant wrote: > > Hello, > > > > I have another question > > > > I have a data frame that looks like this: > > a b > > 2007-03-31 "

Re: [R] data frame of strings formatted

2012-03-01 Thread Peter Langfelder
On Thu, Mar 1, 2012 at 8:05 PM, Ben quant wrote: > Hello, > > I have another question > > I have a data frame that looks like this: >                         a          b > 2007-03-31 "20070514" "20070410" > 2007-06-30 "20070814" "20070709" > 2007-09-30 "20071115" "20071009" > 2007-12-31 "2008

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

2012-03-01 Thread ilai
par('bg') is not what you are looking for - it will set the bg of the whole graphic device, not panels. I think you want: count <- 0 mypanel <- function(x, y, ...){ count <<- count+1 ll<- par('usr') if(count %in% c(1,4,9,12)) bg<- "#FDFF65" else bg<- 'transparent' rect(ll[1],ll[3],ll

[R] data frame of strings formatted

2012-03-01 Thread Ben quant
Hello, I have another question I have a data frame that looks like this: a b 2007-03-31 "20070514" "20070410" 2007-06-30 "20070814" "20070709" 2007-09-30 "20071115" "20071009" 2007-12-31 "20080213" "20080109" 2008-03-31 "20080514" "20080407" 2008-06-30 "20080

Re: [R] Standard variance / devistion clarification

2012-03-01 Thread Suranga Kasthurirathne
On 2 Mar 2012 09:12, "Suranga Kasthurirathne" wrote: > Hi, thank you very much for the advice. I'll try it out, and see where I > can take it from there. > > @david, your point is noted. I will avoid such mails in the future. > On 2 Mar 2012 04:27, "Peter Ehlers" wrote: > >> On 2012-03-01 13:52

[R] indicating group numbers in a dendrogram

2012-03-01 Thread Antonio Silva
Hi, Is it possible to place the group number in a cluster? The best example I found was at https://www.crops.org/images/publications/cs/42/5/1584f4.jpeg (see I, II, IIIa, IIIb) It would help to identify the group given by cutree since branches can turn around and they necessarily are not plotted

Re: [R] Computing line= for mtext

2012-03-01 Thread Richard M. Heiberger
Frank, this is it. It uses Peter's idea. plot(1:10) axis(side=2, 1:10, las=1, line=-31.5, lwd=0) axis(side=4, 1:10, las=1, labels=FALSE) Rich On Thu, Mar 1, 2012 at 6:52 PM, Frank Harrell wrote: > Rich's pointers deals with lattice/grid graphics. Does anyone have a > solution for base gr

Re: [R] downloading Excel files

2012-03-01 Thread Erin Hodgess
Actually, I ran across something a moment ago. read.xls takes http files. It's in the gdata package. Make sure that you have perl on the path too. Thanks, Erin On Thu, Mar 1, 2012 at 6:54 PM, Erin Hodgess wrote: > Thanks J! > > I was thinking about the url, download.file functions too > > Ju

Re: [R] Computing line= for mtext

2012-03-01 Thread Peter Langfelder
Frank, maybe I'm not understanding something right... you say right-justify in the right margin, meaning justify against the very right edge of the plot margin area? Since you're setting your right margin to 5, why not just mtext(s, side=4, las=1, at=5, adj=1, line = 5, cex=1) mtext(s, side=4, la

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 wrote: > On Thu, Mar 1, 2012 at 6:43 PM, Erin Hodgess wrote: >> Dear R People: >> >> I have been usi

Re: [R] downloading Excel files

2012-03-01 Thread J Toll
On Thu, Mar 1, 2012 at 6:43 PM, Erin Hodgess 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 from the web, pl

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

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

[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

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 x

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

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

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 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 value foward

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

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 retu

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: r-help-boun...@r-projec

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 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 wrote: > Hi! > > I'm running R version 2.13.0 (2011-04-13) > Platform

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

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

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 eve

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

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

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

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

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=val

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 t

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 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 = as.Da

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. __ R-help

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" "2

[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 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 wrote: > Hello, > > How do I get the dates of all Fridays between two dates? > > thanks, > > Ben > >        [[

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 wrote: > 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 matr

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 a

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 sa

[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 http://www.R-p

[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 = commandArgs(TR

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 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 values using rfIm

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

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 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 that quanti

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] 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 words > "n" > > "nancement" > >> "nancier" "nancière""nancières" >

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: ht

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 Goog

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

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 >

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

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 wrote: Hi, On Mar 1, 2012, at 12:38 PM, Sarah Goslee wrote: Hi, On Thu, Mar 1, 2012 at 11:11 AM, mails wrote: Hello, consider the f

Re: [R] GLM with regularization

2012-03-01 Thread Dmitriy Lyubimov
Thank you. On Thu, Mar 1, 2012 at 9:58 AM, Bert Gunter 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 at 6:22 PM, Dm

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 wrote: > Hi, > > On Mar 1, 2012, at 12:38 PM, Sarah Goslee wrote: > >> Hi, >> >> On Thu, Mar 1, 2012 at 11:11 AM, mails wrote: >>> Hello, >>> >>> >>> consider the following data.frame: >>> >>

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

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

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 f

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 wrote: > Hello, > > Thank you for probably not so new questio

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

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

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

[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 ... There

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

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

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

[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: http://r.789695.n4.nabble.com/Connecting-points-

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 = > c(34,12,23,

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 words > "n" "nancement" >> "nancier" "nancière""nancières" >> "nanciers""xe" where U+FB01 is a code for latin ligature. The problem

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

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

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,

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

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 t

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

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

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 > wrote: >> Dear R helpers, >> >> I have some difficulties in using 'break' function with loop,

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

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

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 permutati

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 equa

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

  1   2   >