[R] Dates as POSIXt

2012-11-04 Thread Daniel Haugstvedt
When I try to do linear interpolation between financial contracts with maturities on different dates in different months I have come across some behavior I haven't seen before. I have a data frame in R which is loaded from an access database so I can't provide a working example. It was loaded

[R] Hypothesis "RayosRayos.2 = (Intercept)" is not well formed: contains bad coefficient/variable names.

2012-11-04 Thread Jean Jang
Hi R-listers, I am trying to do this function amongst others for a Chi-sq test in > require(multcomp) for some reason it is not working but all of the other functions have work. What does this error mean and how do I fix it? Jean > linearHypothesis(model.rayos.C, "RayosRayos.2 = (Interce

[R] slider control questions

2012-11-04 Thread Dániel Kehl
DeaR UseRs, I have the following code (see below). It is working as expected although I have two problems/questions: - how can I set the size of the graph? It may sound silly, but I couldnt figure that out - is it possible to export this small "interactive aplication" to html or a latex document

Re: [R] Strange behaviour of setwd/getwd

2012-11-04 Thread Markus Holotta
Thanks David, that's exactly what I needed. 2012/11/2 David L Carlson > Aren't you just looking for this? > > > default.wd <- setwd(tmp.wd <- choose.dir()) > > -- > David L Carlson > Associate Professor of Anthropology > Texas A&M University > College

Re: [R] Having some Trouble Data Structures

2012-11-04 Thread Jeff Newmiller
Please keep mail threads on the mailing list. Please follow the posting guidelines and provide a sample of data and desired outcome. --- Jeff NewmillerThe . . Go Live... DCN:B

Re: [R] Replace array with percentile values

2012-11-04 Thread William Dunlap
rank() would do it: > x <- c(1,2,2,2,2,3,4,4,5,5) > rank(x, ties="max")/length(x) * 100 [1] 10 50 50 50 50 60 80 80 100 100 as would ecdf() > ecdf(x)(x)*100 [1] 10 50 50 50 50 60 80 80 100 100 Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Origina

Re: [R] Replace array with percentile values

2012-11-04 Thread David Winsemius
On Nov 4, 2012, at 7:22 PM, greggal...@gmail.com wrote: > Hi: > > I have an array of measurements, that I've been doing linear > regression model and AI models on. Because there are many errors and > the values are "ill-formed" I would like to copy the array, but > replace each value with the P

[R] Replace array with percentile values

2012-11-04 Thread greggallen
Hi: I have an array of measurements, that I've been doing linear regression model and AI models on. Because there are many errors and the values are "ill-formed" I would like to copy the array, but replace each value with the PERCENTILE of that value, in the original array. i.e. mesments$V1: 9

Re: [R] Problem with polygon vertices

2012-11-04 Thread Rolf Turner
On 05/11/12 13:13, Luis Iván Ortiz Valencia wrote: I am building a mask with area.urb.sp.W <- as(area.urb.sp, "owin") and got the message Erro em owin(poly = opls) : Polygon data contain duplicated vertices, self-intersection and overlaps between polygons how can I solve this problem in R?

[R] Problem with polygon vertices

2012-11-04 Thread Luis Iván Ortiz Valencia
I am building a mask with area.urb.sp.W <- as(area.urb.sp, "owin") and got the message Erro em owin(poly = opls) : Polygon data contain duplicated vertices, self-intersection and overlaps between polygons how can I solve this problem in R? many thanks IVAN [[alternative HTML version

Re: [R] select duplicate identifier with higher mean across sample columns

2012-11-04 Thread arun
Hi, Try this: mdf[unlist(tapply(rowMeans(mdf[,-1]),mdf$id,FUN=function(x) x%in%max(x))),] #  id samp1 samp2 samp2a #2  A   120   130    150 #3  C   101   131    151 #4  D   110   150    130 #5  E   132   122    122 #6  F   123   143    143 A.K. - Original Message - From: Adrian Johnson

Re: [R] 95% Q-Q Plot error message

2012-11-04 Thread John Fox
Dear Liang Che, > -Original Message- > From: liang@us.pwc.com [mailto:liang@us.pwc.com] > Sent: Sunday, November 04, 2012 2:12 PM > To: j...@mcmaster.ca > Cc: r-help@r-project.org; 'Sanford Weisberg' > Subject: RE: [R] 95% Q-Q Plot error message > > Thanks John. > > I have one ob

Re: [R] select duplicate identifier with higher mean across sample columns

2012-11-04 Thread Rui Barradas
Hello, Thanks for the data example. (You forgot samp2a). Try the following. mdf <- read.table(text=" id samp1 samp2 samp2a 1 A 100 110110 2 A 120 130150 3 C 101 131151 4 D 110 150130 5 E 132 122122 6 F 123 143143 ", header=TRUE) idx <- ave(

Re: [R] select duplicate identifier with higher mean across sample columns

2012-11-04 Thread jim holtman
Is this what you want: > mdf <- read.table(text = " id samp1 samp2 samp2a + 1 A 100 110110 + 2 A 120 130150 + 3 C 101 131151 + 4 D 110 150130 + 5 E 132 122122 + 6 F 123 143143", header = TRUE) > result <- do.call(rbind, lapply(split(mdf, mdf$i

[R] select duplicate identifier with higher mean across sample columns

2012-11-04 Thread Adrian Johnson
Hi Group: I searched R groups before posting this question. I could not find the appropriate answer and I do not have clear understanding how to do this in R. I have a data frame with duplicated row identifiers but with different values across columns. I want to select the identifier with higher i

Re: [R] 95% Q-Q Plot error message

2012-11-04 Thread liang . che
Thanks John. I have one observation data point with a value that's exactly equal to the predicted value, therefore the residual is 0. Would this be the reason you mentioned below? From: "John Fox" To: Liang Che/US/TLS/PwC@Americas-US Cc: "'Sanford Weisberg'" , Date: 11/04/20

Re: [R] Fw: 95% Q-Q Plot error message

2012-11-04 Thread R. Michael Weylandt
Please don't double post. And we'll need a reproducible example: http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example Michael On Sun, Nov 4, 2012 at 6:50 PM, wrote: > Can someone please help with the below - thanks! > > Warning messages: > 1: Not plotting obser

Re: [R] R 2.15.2 is released

2012-11-04 Thread Sam Steingold
> * Marc Schwartz [2012-11-04 12:33:20 -0600]: > > On Nov 4, 2012, at 12:22 PM, Sam Steingold wrote: > >>> * Bert Gunter [2012-11-04 09:48:58 -0800]: >>> >>> ?update.packages >> >> It is not obvious to me that this is the answer to my question. > > Take note of the 'checkBuilt' argument, which

Re: [R] Excluding fixed number of rows from calculation while summarizing using ddply() function.

2012-11-04 Thread arun
Hi, One more way: dat1<-read.table(text=" Unique,StepNo,Data1,Data2 A,1,4,5   A,1,5,6 A,1,7,8   A,2,9,10  A,2,45,25 A,2,10,11 B,2,34,12 B,2,5,6 B,2,7,8 B,2,6,7  B,3,1,2  B,3,3,4 B,3,4,5  ",sep=",",header=TRUE,stringsAsFactors=FALSE)  dat2<-dat1[!(!duplicated(dat1[,1:2])|!duplicated(dat1[,1

Re: [R] Excluding fixed number of rows from calculation while summarizing using ddply() function.

2012-11-04 Thread arun
dat1<-read.table(text=" Unique,StepNo,Data1,Data2 A,1,4,5   A,1,5,6 A,1,7,8   A,2,9,10  A,2,45,25 A,2,10,11 B,2,34,12 B,2,5,6 B,2,7,8 B,2,6,7  B,3,1,2  B,3,3,4 B,3,4,5  ",sep=",",header=TRUE,stringsAsFactors=FALSE) dat2<-ddply(dat1,.(Unique,StepNo),function(x) x[c(1,nrow(x)),])   dat1$ne

Re: [R] 95% Q-Q Plot error message

2012-11-04 Thread John Fox
Dear liang.che, I'm guessing that this is the qqPlot() function in the car package. This looks to me to be the combination of two problems: (1) You have at least one observation in your model for which the leverage (hat-value) is 1. That could happen, for example, if you have a factor in the mode

Re: [R] add1() alternative

2012-11-04 Thread flxms
Hi Bruno, probably not exactly what you are looking for, but maybe "all subset regression" as in library "leaps" might be an alternative for variable selection? But I am definitely not sure if this is faster than drop1() (calculates more models), nor have I ever tested it with a hierarchical logis

Re: [R] optim & .C / Crashing on run

2012-11-04 Thread paulfjbrowne
Playing around with alternate optimzers, I've found that both nlminb & the nls.lm Levenberg-Marquadt optimizer in minpack.lm both work with my objective function without crashing, and minimize the function as I'd expect them to. Using optim for amoeba sampling would be nice, but I think I'll just

[R] Fw: 95% Q-Q Plot error message

2012-11-04 Thread liang . che
Can someone please help with the below - thanks! Warning messages: 1: Not plotting observations with leverage one: 7 2: Not plotting observations with leverage one: 7 > print(qqPlot(fit),envelop=.95); Error in model.frame.default(formula = Y ~ X - 1, drop.unused.levels = TRUE) : variable lengt

[R] Q-Q Plot error message

2012-11-04 Thread liang . che
Can someone please help with the error message below -- thanks! Warning messages: 1: Not plotting observations with leverage one: 7 2: Not plotting observations with leverage one: 7 > print(qqPlot(fit),envelop=.95); Error in model.frame.default(formula = Y ~ X - 1, drop.unused.levels = TRUE) :

Re: [R] R 2.15.2 is released

2012-11-04 Thread Marc Schwartz
On Nov 4, 2012, at 12:22 PM, Sam Steingold wrote: >> * Bert Gunter [2012-11-04 09:48:58 -0800]: >> >> ?update.packages > > It is not obvious to me that this is the answer to my question. > Specifically, I have package X version 1.2.3 installed and built against > R version 2.15.1. > If 1.2.3

[R] 95% Q-Q Plot error message

2012-11-04 Thread liang . che
Can someone please help with the error message below? Warning messages: 1: Not plotting observations with leverage one: 7 2: Not plotting observations with leverage one: 7 > print(qqPlot(fit),envelop=.95); Error in model.frame.default(formula = Y ~ X - 1, drop.unused.levels = TRUE) : variable

Re: [R] R 2.15.2 is released

2012-11-04 Thread R. Michael Weylandt
On Sun, Nov 4, 2012 at 6:22 PM, Sam Steingold wrote: >> * Bert Gunter [2012-11-04 09:48:58 -0800]: >> >> ?update.packages > > It is not obvious to me that this is the answer to my question. > Specifically, I have package X version 1.2.3 installed and built against > R version 2.15.1. > If 1.2.3 i

Re: [R] R 2.15.2 is released

2012-11-04 Thread Sam Steingold
> * Bert Gunter [2012-11-04 09:48:58 -0800]: > > ?update.packages It is not obvious to me that this is the answer to my question. Specifically, I have package X version 1.2.3 installed and built against R version 2.15.1. If 1.2.3 is the current latest version of X, then update.packages() will _no

Re: [R] R 2.15.2 is released

2012-11-04 Thread Bert Gunter
?update.packages -- Bert On Sun, Nov 4, 2012 at 7:01 AM, Sam Steingold wrote: > Cool. > I have some packages installed using install.packages(). > Do I need to reinstall them? > > https://r-forge.r-project.org/tracker/?func=detail&atid=294&aid=2224&group_id=61 >Not a bug: This only happens u

[R] Apply same linear model to subset of dataframe

2012-11-04 Thread Ross Ahmed
I have applied the same linear model to several different subsets of a dataset. I recently read that in R, code should never be repeated. I feel my code as it currently stands has a lot of repetition, which could be condensed into fewer lines. I will use the mtcars dataset to replicate what I have

[R] Struggeling with nlminb...

2012-11-04 Thread MMar86
Hallo together, I am trying to estimate parameters by means of QMLE using the nlminb optimizer for a tree-structured GARCH model. I face two problems. First, the optimizer returns error[8] false convergence if I estimate the functions below. I have estimated the model at first with nlm without an

Re: [R] some help

2012-11-04 Thread dattel_palme
HI David, Thanks for your answers, I can't provide data here, but I can explain more: It's satellite images as a text file (ascii). Two different images with two different variables, land surface temperature (LST -lstascii =filename) and an vegetation index (NDVI - ndviascii = filename). The aim

Re: [R] Replacing a string

2012-11-04 Thread Allie818
Thanks so much Arun! It's the second case. Being able to extract is really powerful too. Thank you for sharing that as well! Sent from my iPad On Nov 4, 2012, at 12:00 AM, "arun kirshna [via R]" wrote: > HI, > > I am not sure how you want your output. > Is it something like: > "WEBSITEWE

[R] Excluding fixed number of rows from calculation while summarizing using ddply() function.

2012-11-04 Thread siddu479
Hello All, I have a .csv file( contents shown) below, where I need to calculate mean(for example) for only the rows highlighted in bold. (i.e. in this example case I need to exclude the first row and last row(N=1) for each "*StepNo*" column) Unique,StepNo,Data1,Data2#In actual file I have

Re: [R] Saving R Graph to a file

2012-11-04 Thread R. Michael Weylandt
On Sun, Nov 4, 2012 at 1:18 PM, frespider wrote: > > Hi guys, > > I really appreciated all your responds, I made mistake on my example below > hwere I wrote device.off() where it should be dev.off(). > > I read all the help documnet for odf png and postscript before I posted my > question but it

Re: [R] For loop...

2012-11-04 Thread arun
HI, Try this: dat1<-read.table(text=" A  B    C  1  10  1   2  30  1   3  50  1   1000  1000    1    1  10  2   2  30  2   3  50  

Re: [R] For loop...

2012-11-04 Thread SHAILLY MEHROTRA
Hi Bert, I think you missed my clarification on the question, which I by mistake posted to the person who replied. Sorry about that. I think by reading my clarifiaction you will understand that I am not just "hammering and hoping". I have a valid question. Thanks Shailly On Sun, Nov 4, 2012 at 10:1

Re: [R] optim & .C / Crashing on run

2012-11-04 Thread Paul Browne
Running this valgrind command on the test optim_rhelp.R script R -d "valgrind --tool=memcheck --leak-check=full > --log-file=optim_rhelp.valgrind.log" --vanilla < optim_rhelp.R yields this report: optim_rhelp.valgrind.log Ignoring everyt

Re: [R] For loop...

2012-11-04 Thread Berend Hasselman
On 04-11-2012, at 15:40, Bert Gunter wrote: > But ... > > On Sun, Nov 4, 2012 at 4:24 AM, Berend Hasselman wrote: >> >> On 04-11-2012, at 13:07, SHAILLY MEHROTRA wrote: >> >>> Dear R-users, >>> >>> I have dataset with column A and B with1000 values, >>> >>> For each of column C value (C =

Re: [R] R 2.15.2 is released

2012-11-04 Thread Sam Steingold
Cool. I have some packages installed using install.packages(). Do I need to reinstall them? https://r-forge.r-project.org/tracker/?func=detail&atid=294&aid=2224&group_id=61 Not a bug: This only happens under the circumstance of a Matrix package installation *not* matching your R installation

Re: [R] what is the function naming convention?

2012-11-04 Thread Bert Gunter
... but see the R Language Definition manual or ?UseMethod for S3 generic and method naming (overloading functions) procedures, which explains some of as.data.frame.array, merge.data.frame, etc. -- Bert On Sun, Nov 4, 2012 at 5:28 AM, Duncan Murdoch wrote: > On 12-11-04 8:16 AM, Bretschneider

Re: [R] For loop...

2012-11-04 Thread Bert Gunter
But ... On Sun, Nov 4, 2012 at 4:24 AM, Berend Hasselman wrote: > > On 04-11-2012, at 13:07, SHAILLY MEHROTRA wrote: > >> Dear R-users, >> >> I have dataset with column A and B with1000 values, >> >> For each of column C value (C = seq(1,1000,1), I want to repeat A and B >> values and calculate

Re: [R] optim & .C / Crashing on run

2012-11-04 Thread Paul Browne
Hi, Thanks for your help. Invoking valgrind under R for the test script I attached produces the following crash report; > Rscript optim_rhelp.R -d valgrind > Nelder-Mead direct search function minimizer > function value for initial parameters = 1267.562555 > Scaled convergence tolerance is 1

Re: [R] Rd2pdf freeze

2012-11-04 Thread Pierrick Bruneau
I naively thought it would be able to examine the compressed file, Thanks for your answer :) On Sun, Nov 4, 2012 at 2:55 PM, Duncan Murdoch wrote: > On 12-11-04 8:50 AM, Pierrick Bruneau wrote: > >> Hi everyone, >> >> From the currently available version of the package VBmix, I would like >>> to

Re: [R] Rd2pdf freeze

2012-11-04 Thread Duncan Murdoch
On 12-11-04 8:50 AM, Pierrick Bruneau wrote: Hi everyone, From the currently available version of the package VBmix, I would like to retrieve the intermediate .tex file that generates the VBmix-manual.pdf file. Formerly, running R CMD check with --no-clean allowed to get this tex source from a

Re: [R] lines with colored segments

2012-11-04 Thread Duncan Murdoch
On 12-11-04 8:29 AM, David Stevens wrote: Hello all I'm trying to create a plot similar to a plot.default(..., type='b') with points plotted connected by lines that leave small gaps between the end of the line and the point symbol, BUT, with each line segment's color controlled by a category. pl

[R] Rd2pdf freeze

2012-11-04 Thread Pierrick Bruneau
Hi everyone, >From the currently available version of the package VBmix, I would like to retrieve the intermediate .tex file that generates the VBmix-manual.pdf file. Formerly, running R CMD check with --no-clean allowed to get this tex source from a hidden directory : this feature was removed, bu

Re: [R] rgl package and animation

2012-11-04 Thread Duncan Murdoch
On 12-11-03 11:40 AM, Robert Baer wrote: On 11/3/2012 6:47 AM, Duncan Murdoch wrote: On 12-11-02 7:47 PM, Robert Baer wrote: I am trying to figure out how to use rgl package for animation. It appears that this is done using the play3d() function. Below I have some sample code that plots a 3D

Re: [R] Replacing NAs in long format

2012-11-04 Thread Christopher Desjardins
Thanks these different examples work perfectly. Chris On Sat, Nov 3, 2012 at 8:32 PM, arun wrote: > HI Bill, > It is much simpler. > # with aggregate() and merge() > > res1<-with(dat2,aggregate(seq_len(nrow(dat2)),by=list(idr=idr),FUN=function(i) > with(dat2[i,], any(schyear<=5 & year ==0 >

[R] lines with colored segments

2012-11-04 Thread David Stevens
Hello all I'm trying to create a plot similar to a plot.default(..., type='b') with points plotted connected by lines that leave small gaps between the end of the line and the point symbol, BUT, with each line segment's color controlled by a category. plot... draws the line color uniformly acc

Re: [R] Saving R Graph to a file

2012-11-04 Thread frespider
Hi guys, I really appreciated all your responds, I made mistake on my example below hwere I wrote device.off() where it should be dev.off(). I read all the help documnet for odf png and postscript before I posted my question but it didn't help. Can some one please code an example? Thanks

[R] blackboost (mboost package) function leads to non-reclaimable memory usage

2012-11-04 Thread nima82
Dear all, I am puzzled by R's memory usage when calling the blackboost function from package mboost to estimate a Gradient boosting model on a simulated dataset with 20 correlated variables and 100,000 obs. The blackboost object created by the function is only 15.3Mb, but R's memory usage increase

Re: [R] some help

2012-11-04 Thread Rui Barradas
Hello, Why answer to just me? You should keep it in the R-Help list, the odds of getting more (and hopefully better) answers is bigger. Anyway, with data examples it's much easier to do something. I hope the code is self explanatory, except maybe for the use of scan(), not read.table. scan()

Re: [R] some help

2012-11-04 Thread dattel_palme
HI everybody, Thanks for your answers, I can't provide data here, but I can explain more: It's satellite images as a text file (ascii). Two different images with two different variables, land surface temperature (LST -lstascii =filename) and an vegetation index (NDVI - ndviascii = filename). Th

Re: [R] sqldf Date problem

2012-11-04 Thread Andreas Recktenwald
Zitat von jim holtman : Most likely your "Date" is either a character or a factor (you need to provide an 'str' of the dataframe). You are therefore most likely doing a character compare and that is the reason for your problem. You need to convert to a character string of the format -MM-DD

Re: [R] what is the function naming convention?

2012-11-04 Thread Duncan Murdoch
On 12-11-04 8:16 AM, Bretschneider SIG-R wrote: Dear R people, In typing names of functions (built in or from a package) I often guess wrong, and have to look the name up. In other words, I don't understand the logic in naming functions (if there is any): R and its packages have been writt

[R] what is the function naming convention?

2012-11-04 Thread Bretschneider SIG-R
Dear R people, In typing names of functions (built in or from a package) I often guess wrong, and have to look the name up. In other words, I don't understand the logic in naming functions (if there is any): - most names are plain, lower case: cos, plot, sapply, t, toupper, unserializ

Re: [R] sample equal number of cases per class

2012-11-04 Thread Rui Barradas
Hello, Function caret::createDatapartition preserves the proportions of classes, like its documentation says, so you should expected the result to be balanced only if the original data.frame is also balanced. A solution is to write a small function that chooses a balanced set of indices. Note

Re: [R] For loop...

2012-11-04 Thread Berend Hasselman
On 04-11-2012, at 13:07, SHAILLY MEHROTRA wrote: > Dear R-users, > > I have dataset with column A and B with1000 values, > > For each of column C value (C = seq(1,1000,1), I want to repeat A and B > values and calculate R = A+B*C for each row. > > I want to get output as > > A B

Re: [R] Saving R Graph to a file

2012-11-04 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Hello, #Example 1: The following code to save svyboxplots works for me pdf("boxplots_dthage.pdf", width = 1020) # 4 boxplots in 2 columns and 2 rows par(mfrow=c(2,2), oma=c(0,0,0,0)) # svyboxplot commands not shown dev.off() #Example 2: The following code to save a ggplot graph works for me:

Re: [R] optim & .C / Crashing on run

2012-11-04 Thread Patrick Burns
When invoking R, you can add -d valgrind to run it under valgrind. On 04/11/2012 11:35, Paul Browne wrote: It looks like my attached files didn't go through, so I'll put them in a public Dropbox folder instead; optim_rhelp.tar.gz Thanks, I

Re: [R] optim & .C / Crashing on run

2012-11-04 Thread Paul Browne
It looks like my attached files didn't go through, so I'll put them in a public Dropbox folder instead; optim_rhelp.tar.gz Thanks, I'll run a compiled binary of the C++ code through Valgrind & see what it reports, then perhaps I'll try an Rscript

[R] sample equal number of cases per class

2012-11-04 Thread ollestrat
Dear community I have a dataframe and want to split it into a learn and a test partition. However the learnset should be balanced, i.e. each class should have the same number of cases. I tried and searched a lot, without success so far. Maybe you can help? Some example code *# generate example da

Re: [R] Saving R Graph to a file

2012-11-04 Thread Robert Baer
On 11/4/2012 4:32 AM, Robert Baer wrote: Some hints: For pdf(), height and width are in inches, not pixels. dev.off() is necessary after drawing the image for pdf(). The name for the file argument (file="c:/figure.xxx") is file not filename hist(CO2[,5]) is more interesting And yes, ?pdf ?p

Re: [R] Saving R Graph to a file

2012-11-04 Thread Robert Baer
Some hints: For pdf(), height and width are in inches, not pixels. dev.off() is necessary after drawing the image for pdf(). The name for the file argument (file="c:/figure.xxx") is file not filename hist(CO2[,5]) is more interesting And yes, ?pdf ?postscript ?ping On 11/3/2012 11:16 PM, fr

Re: [R] Saving R Graph to a file

2012-11-04 Thread John
On Sat, 3 Nov 2012 21:16:49 -0700 (PDT) frespider wrote: You're leaving out some critical information like the error messages, if any, you receive. That said, your example won't work properly because it is not properly coded. FI'm sure it gets tiresome being told to read the manual, but that is

Re: [R] optim & .C / Crashing on run

2012-11-04 Thread Patrick Burns
That is a symptom of the C/C++ code doing something like using memory beyond the proper range. It's entirely possible to have crashes in some contexts but not others. If you can run the C code under valgrind, that would be the easiest way to find the problem. Pat On 03/11/2012 18:15, Paul Brow

Re: [R] Replacing a string

2012-11-04 Thread R. Michael Weylandt
You want to read the ?regexp page and try gsub("^http://.*\\.com$";, "WEBSITE", ) Michael On Sun, Nov 4, 2012 at 4:09 AM, Allie818 wrote: > Hi, > > I have what I hope is a simple text processing question in R. > > I want to replace every instance of http:\\XXX.com with "WEBSITE" > > When I try

Re: [R] Saving R Graph to a file

2012-11-04 Thread R. Michael Weylandt
On Sun, Nov 4, 2012 at 4:16 AM, frespider wrote: > Hi > > I am not sure why I can't get my plot saved to a file as .ps, I searched > online and I found that I have to use something is called postscript,png or > pdf function which I did but still not working. > > Actually what I have is a matrix wi

[R] Saving R Graph to a file

2012-11-04 Thread frespider
Hi I am not sure why I can't get my plot saved to a file as .ps, I searched online and I found that I have to use something is called postscript,png or pdf function which I did but still not working. Actually what I have is a matrix with almost 300-400 columns. I need to create a histogram and bo

[R] Replacing a string

2012-11-04 Thread Allie818
Hi, I have what I hope is a simple text processing question in R. I want to replace every instance of http:\\XXX.com with "WEBSITE" When I try sub('(^http://)(.com$)', 'WEBSITE', );, it only substitutes http:// and .com so it looks like WEBSITEXXXWEBSITE How do I get it to match the pattern "

Re: [R] Can you turn a string into a (working) symbol?

2012-11-04 Thread arun
HI, get("DD[2]") #[1] 5 If you wanted to change the one without quotes:  new1<-function(x,y) {eval.parent(substitute(x<-y))}  new1(DD[2],7)  DD[2] #[1] 7 DD #[1] 1 7 3 A.K. - Original Message - From: andrewH To: r-help@r-project.org Cc: Sent: Saturday, November 3, 2012 11:10 PM Subj