Re: [R] apply family functions

2010-08-06 Thread Steven Kang
ini <- as.Date("2010/1/1", "%Y/%m/%d") # Generate arbitrary data frame consisting of date values oc <- data.frame(Open = seq(ini, ini + 6, 1), Close = seq(ini + 365, ini + 365 + 6, 1), Open1 = seq(ini + 365*2, ini + 365*2 + 6, 1), Close1 = seq(ini + 365*3, ini + 365*3 + 6, 1), Open2 = seq(ini + 365

[R] R: Confidence Intervals for logistic regression

2010-08-06 Thread Guazzetti Stefano
a closer look to the help on predict.glm will reveal that the function accepts a 'type' argument. In you case 'type = response' will give you the results in probabilities (that it seems to be what you are looking for). There also is an example on use of the 'type' argument at the end of the page.

Re: [R] 64-bit R on 64-bit Windows box... Still not enough memory?!

2010-08-06 Thread noclue_
sorry I opened a previous R version. Here is my 64-bit R session - > .Machine$sizeof.pointer [1] 8 -- View this message in context: http://r.789695.n4.nabble.com/64-bit-R-on-64-bit-Windows-box-Still-not-enough-memory-tp2315742p2316970.html Sent from the R help mailing list archive at Nabbl

[R] R: Backward elimination in svyglm function in R

2010-08-06 Thread aline uwimana
stepwise backward elimination in R is possible if we use the syvglm funtion in regression logistique? thanx -- Forwarded message -- From: aline uwimana Date: 2010/8/6 Subject: R:Backward elimination in svyglm function in R To: r-help@r-project.org Dear all, someone knows how t

Re: [R] Odp: Pausing script to allow user input from keyboard.

2010-08-06 Thread Michael Bedward
I'm having problems with your method Petr. I seem to get an additional prompt. Example... f <- function() { cat("\n", "Enter a string:", "\n") s <- scan(n=1) cat("\n", "You entered", s, "\n") } Running f() produces... Enter a string: 1: blah 1: Error in scan(file, what, nmax, sep, dec, q

[R] converting "if not os.path.exists(afile ): continue" to R

2010-08-06 Thread Hyunchul Kim
Hi, all How to convert following simple python script to R ? if not os.path.exists(targetfile): continue Thanks in advance, Hyunchul sundol313´ÔÀÇ ºí·Î±× ¾È³çÇϼ¼¿ä. [[alternative HTML version deleted]] __ R-help@r-p

Re: [R] R script doesn't load libraries when called from cron

2010-08-06 Thread zerdna
Actually, i think i figured it out. My bad, i am inexperienced with cron. When it runs, it doesn't have the environment. Once i wrapped my R script into shell script that sourced the .bashrc file, i was back in business. Maybe there is more elegant solution, without additional shell script -- poss

Re: [R] converting "if not os.path.exists(afile): continue" to R

2010-08-06 Thread Henrique Dallazuanna
See ?file.exists ?file.info On Fri, Aug 6, 2010 at 6:59 PM, Hyunchul Kim wrote: > Hi, all > > How to convert following simple python script to R ? > > if not os.path.exists(targetfile): >continue > > Thanks in advance, > > Hyunchul > >[[alternative HTML version deleted]] > > ___

Re: [R] Latex errors when checking package

2010-08-06 Thread Ben Bolker
Christian Hennig stats.ucl.ac.uk> writes: > LaTeX errors when creating PDF version. > This typically indicates Rd problems. > LaTeX errors found: > ! Font T1/ptm/m/n/10=ptmr8t at 10.0pt not loadable: Metric (TFM) file not > found I'm guessing you're running Ubuntu. If so,

[R] Where is Graphic:Devie 2 ?

2010-08-06 Thread Stephen Liu
Hi folks, On console - RGUI (64 bit) -> Windows I can't find; R Graphic:Device 2 (ACTIVE) Only "R Console" is there. Please advise how to add it? TIA B.R. SL __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEA

Re: [R] brew equivalent of "R CMD Sweave"

2010-08-06 Thread Duncan Murdoch
On 06/08/2010 7:10 PM, Liviu Andronic wrote: Dear Duncan On Fri, 06 Aug 2010 18:46:55 -0400 Duncan Murdoch wrote: You can run a single R command from the command line using the -e option, so R -e "brew::brew('featurefull.brew')" (or some variation on that, depending on how your shell handles

Re: [R] brew equivalent of "R CMD Sweave"

2010-08-06 Thread Liviu Andronic
Dear Duncan On Fri, 06 Aug 2010 18:46:55 -0400 Duncan Murdoch wrote: > You can run a single R command from the command line using the -e > option, so > > R -e "brew::brew('featurefull.brew')" > > (or some variation on that, depending on how your shell handles > quotes) will run that one command

Re: [R] brew equivalent of "R CMD Sweave"

2010-08-06 Thread Duncan Murdoch
On 06/08/2010 5:23 PM, Liviu Andronic wrote: Dear all Is there an equivalent of "R CMD Sweave" for brew [1] documents? Something in the lines of "R CMD brew"? Can R be configured to parse brew documents from the commandline, without opening an interactive R session and issuing the following? req

Re: [R] converting "if not os.path.exists(afile): continue" to R

2010-08-06 Thread David Winsemius
On Aug 6, 2010, at 5:59 PM, Hyunchul Kim wrote: Hi, all How to convert following simple python script to R ? if not os.path.exists(targetfile): continue Thanks in advance, > Sys.glob("/Users/davidwinsemius/Downloads/") [1] "/Users/davidwinsemius/Downloads/" > Sys.glob("/Users/davidwinse

[R] converting "if not os.path.exists(afile): continue" to R

2010-08-06 Thread Hyunchul Kim
Hi, all How to convert following simple python script to R ? if not os.path.exists(targetfile): continue Thanks in advance, Hyunchul [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/l

Re: [R] Running Sweave directly from Windows command line

2010-08-06 Thread Gabor Grothendieck
On Fri, Aug 6, 2010 at 3:39 PM, wrote: > Hello everybody out there using R, > When I try to run the command "R CMD Sweave file.Rnw" (R Version 2.11.1) on > the command line of Windows 7, an error message tells me that the command > "sh" is not known. > I suppose that R is trying to use a shell

[R] Latex errors when checking package

2010-08-06 Thread Christian Hennig
Dear listers, I just run R CMD check on an update of one of my packages. All seems fine but after having gone through all the Rd-file and example checking and so on, I get the following kind of errors: LaTeX errors when creating PDF version. This typically indicates Rd problems. LaTeX errors f

[R] brew equivalent of "R CMD Sweave"

2010-08-06 Thread Liviu Andronic
Dear all Is there an equivalent of "R CMD Sweave" for brew [1] documents? Something in the lines of "R CMD brew"? Can R be configured to parse brew documents from the commandline, without opening an interactive R session and issuing the following? require(brew) brew("featurefull.brew") I would li

Re: [R] r sig for tcl/tk?

2010-08-06 Thread Liviu Andronic
On Fri, 6 Aug 2010 14:51:59 -0500 Erin Hodgess wrote: > Dear R People: > > Is there an R sig for Tcl/Tk, please? > There is r-sig-gui that should fit most tcltk questions. Liviu __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listi

Re: [R] Signals and Noise

2010-08-06 Thread David Winsemius
On Aug 6, 2010, at 3:56 PM, TGS wrote: Is there a reference page indicating which packages or functions are available in R for the filed of electrical engineering? Have you seen?: http://cran.r-project.org/web/views/TimeSeries.html (I was surprised that tuneR was not mentioned there.)

Re: [R] image plot but data not on grid.

2010-08-06 Thread Hadley Wickham
On Fri, Aug 6, 2010 at 9:24 AM, W Eryk Wolski wrote: > Hi, > > Would like to make an image > however the values in z are not on an uniform grid. > > Have a dataset with > length(x) == length(y) == length(z) > x[1],y[1] gives the position of z[1] > > and would like to encode value of z by a color.

Re: [R] qqline error: Error in sort.list(x, partial = unique(c(lo, hi))) : 'x' must be atomic for 'sort.list' Have you called 'sort' on a list?

2010-08-06 Thread Benjamin Caldwell
All right, thanks. On Fri, Aug 6, 2010 at 1:13 PM, David Winsemius wrote: > > On Aug 6, 2010, at 4:03 PM, Benjamin Caldwell wrote: > > Woops, that should read >> e.g. >> >> qqnorm.lme(modelincrF) >> Error: could not find function "qqnorm.lme" >> > > You said you were getting expected results wi

Re: [R] qqline error: Error in sort.list(x, partial = unique(c(lo, hi))) : 'x' must be atomic for 'sort.list' Have you called 'sort' on a list?

2010-08-06 Thread David Winsemius
On Aug 6, 2010, at 4:03 PM, Benjamin Caldwell wrote: Woops, that should read e.g. >> qqnorm.lme(modelincrF) Error: could not find function "qqnorm.lme" You said you were getting expected results with: qqnorm(modelincrF) I was pointing out that the R methods dispatching was actually applyi

Re: [R] qqline error: Error in sort.list(x, partial = unique(c(lo, hi))) : 'x' must be atomic for 'sort.list' Have you called 'sort' on a list?

2010-08-06 Thread Benjamin Caldwell
Oh, and now I see the call is qqnorm, not qqnorm.lme. Guess I needed lunch. Ben Caldwell On Fri, Aug 6, 2010 at 1:03 PM, Benjamin Caldwell wrote: > Woops, that should read > e.g. > >> qqnorm.lme(modelincrF) > Error: could not find function "qqnorm.lme" > > > On Fri, Aug 6, 2010 at 12:47 PM, Benja

Re: [R] qqline error: Error in sort.list(x, partial = unique(c(lo, hi))) : 'x' must be atomic for 'sort.list' Have you called 'sort' on a list?

2010-08-06 Thread Benjamin Caldwell
Woops, that should read e.g. >> qqnorm.lme(modelincrF) Error: could not find function "qqnorm.lme" On Fri, Aug 6, 2010 at 12:47 PM, Benjamin Caldwell wrote: > Okay, yeah, so he're the deal - nlme is loaded, did the library(nlme) thing > no problem. When I run > >??qqnorm.lme > the file comes up

[R] Signals and Noise

2010-08-06 Thread TGS
Is there a reference page indicating which packages or functions are available in R for the filed of electrical engineering? I'm not an EE but I've been doing some simulations regarding signals and noise and I found the 'tuneR' to be useful. Are there any others?

[R] r sig for tcl/tk?

2010-08-06 Thread Erin Hodgess
Dear R People: Is there an R sig for Tcl/Tk, please? I looked at the User Groups list on the main page and didn't see one. However, I thought I'd double check. Thanks, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown m

Re: [R] qqline error: Error in sort.list(x, partial = unique(c(lo, hi))) : 'x' must be atomic for 'sort.list' Have you called 'sort' on a list?

2010-08-06 Thread Benjamin Caldwell
Okay, yeah, so he're the deal - nlme is loaded, did the library(nlme) thing no problem. When I run >??qqnorm.lme the file comes up fine. But, if I try to use the function, I get an error like the package isn't loaded e.g. >qqnorm.gls(modelincrF) Error: could not find function "qqnorm.gls" On Fr

[R] Running Sweave directly from Windows command line

2010-08-06 Thread julia . jacobson
Hello everybody out there using R, When I try to run the command "R CMD Sweave file.Rnw" (R Version 2.11.1) on the command line of Windows 7, an error message tells me that the command "sh" is not known. I suppose that R is trying to use a shell script, which can't be interpreted using Windows.

Re: [R] How to apply apply?!

2010-08-06 Thread Philipp Pagel
> How do I multiply only the close of every row using the 'apply' function? > And once multiplied how do I obtain a new table that also contains the new > 2*CLOSE column (without cbind?). You don't use apply in this case - a simple multiplication and variable assignment will do: > require(tserie

Re: [R] How to apply apply?!

2010-08-06 Thread Erik Iverson
Raghuraman Ramachandran wrote: guRus I have say a dataframe, d and I wish to do the following: 1) For each row, I want to take one particular value of the row and multiply it by 2. How do I do it. Say the data frame is as below: OPEN HIGH LOW CLOSE 1931.2 1931.2 1931.2 1931.2 0 0 0 999.05

Re: [R] How to apply apply?!

2010-08-06 Thread Abhijit Dasgupta, PhD
For 1, an easy way is dat <- transform(dat, CLOSE2=2*CLOSE) For 2: apply(dat,1,fun) On 08/06/2010 03:06 PM, Raghuraman Ramachandran wrote: guRus I have say a dataframe, d and I wish to do the following: 1) For each row, I want to take one particular value of the row and multiply it by 2. Ho

Re: [R] 64-bit R on 64-bit Windows box... Still not enough memory?!

2010-08-06 Thread Philipp Pagel
On Fri, Aug 06, 2010 at 09:03:09AM -0700, noclue_ wrote: > > > .Machine$sizeof.pointer > [1] 4 So it appears you are not on 64bit. Experpt form the help page: [...] sizeof.pointer: the number of bytes in a C ‘SEXP’ type. Will be ‘4’ on 32-bit builds and ‘8’ on 64-bit builds of R. [..

Re: [R] pdf indifferent to lwd after some small number< 1 (e.g. 0.18)

2010-08-06 Thread Ben Bolker
Chuen Tan yahoo.com> writes: > > Hi, > > To plot a figure, I used lwd=0.18 in the function lines() to plot > very fine lines. However, using png() or > pdf() to save the figure, it appears that lwd has no effect on > pdf() beyond some small number (e.g. 0.18) and > the lines looks much thicker

Re: [R] Creating timeSeries

2010-08-06 Thread Raghuraman Ramachandran
?xts xts will do what you want. as.xts or xts() are straightforward ways. On Fri, Aug 6, 2010 at 5:11 PM, Serdar Akin wrote: > Hi > > I want to create a TimeSeries object with already defined dates (in the > first vector) so that all the data are coerced as a time series object with > the dates

[R] How to apply apply?!

2010-08-06 Thread Raghuraman Ramachandran
guRus I have say a dataframe, d and I wish to do the following: 1) For each row, I want to take one particular value of the row and multiply it by 2. How do I do it. Say the data frame is as below: OPEN HIGH LOW CLOSE 1931.2 1931.2 1931.2 1931.2 0 0 0 999.05 0 0 0 1052.5 0 0 0 987.8 0 0 0 925.

Re: [R] stats::reshape question

2010-08-06 Thread Krishna Tateneni
Thanks for the reply, I realize that having x and y in that order in "varying" and "v.names" will work. The question is why reversing the order (i.e., y followed by x) does not work; it seems unintuitive, so I'm wondering if I've just misread the documentation. On Fri, Aug 6, 2010 at 1:45 PM, Den

Re: [R] gsub

2010-08-06 Thread Marc Schwartz
On Aug 6, 2010, at 10:14 AM, Alfredo Alessandrini wrote: > > Hi, > > I'm using gsub, but I've a problem. > >> print(i) > [1] "piante_venere.csv" >> gsub("\\.csv$", "", i) > [1] "piante_venere" >> gsub("^piante_", "", i) > [1] "venere.csv" > > > Can I combine the two expressions? > > Like th

Re: [R] Error on random forest variable importance estimates

2010-08-06 Thread Liaw, Andy
From: Pierre Dubath > > Hello, > > I am using the R randomForest package to classify variable > stars. I have > a training set of 1755 stars described by (too) many > variables. Some of > these variables are highly correlated. > > I believe that I understand how randomForest works and how >

[R] R script doesn't load libraries when called from cron

2010-08-06 Thread zerdna
I have R script that i need to run in cron. Either R libraries or some .so libraries that they depend on don't get loaded correctly. Here is an example. I have a file, call it tmp.R tmp.R = R --slave --args $0 $* < tryCatchList -> tryCatchOne -> Execution halted

[R] Grouping clusters from dendrograms

2010-08-06 Thread Julia M
Hi, I have produced a dendrogram of categorical data in R using the hclust function, although the input was a dissimilarity matrix produced in SAS, as I have defined my own distances. The dendrogram is fine and I can view and use this. However, I was wondering if there is a method by which I ca

Re: [R] 64-bit R on 64-bit Windows box... Still not enough memory?!

2010-08-06 Thread David Winsemius
You are running 32 bit R. Read the RW FAQ. On Aug 6, 2010, at 12:03 PM, noclue_ wrote: .Machine$sizeof.pointer [1] 4 -- David Winsemius, MD West Hartford, CT __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEA

Re: [R] stats::reshape question

2010-08-06 Thread Dennis Murphy
Hi: Is this what you were aiming for? reshape(d,varying=list(c("x1","x2"), c("y1","y2")),v.names=c("x","y"),dir="long") time x y id 1.11 1 5 1 2.11 2 6 2 1.22 3 7 1 2.22 4 8 2 HTH, Dennis On Fri, Aug 6, 2010 at 10:28 AM, Krishna Tateneni wrote: > Hello, > > A quick ques

Re: [R] Confidence Intervals for logistic regression

2010-08-06 Thread Troy S
Michael, Thanks for the reply. I believe Aline was sgiving me CI's on coefficients as well. So c(pred$fit + 1.96 * pred$se.fit, pred$fit - 1.96 * pred$se.fit) gives me the CI on the logits if I understand correctly? Maybe the help on predict.glm can be updated. Thanks! On 6 August 2010 01:46,

[R] pdf indifferent to lwd after some small number<1 (e.g. 0.18)

2010-08-06 Thread Chuen Tan
Hi, To plot a figure, I used lwd=0.18 in the function lines() to plot very fine lines. However, using png() or pdf() to save the figure, it appears that lwd has no effect on pdf() beyond some small number (e.g. 0.18) and the lines looks much thicker than png(). Setting lwd<0.18 does not make th

Re: [R] 64-bit R on 64-bit Windows box... Still not enough memory?!

2010-08-06 Thread noclue_
> .Machine$sizeof.pointer [1] 4 -- View this message in context: http://r.789695.n4.nabble.com/64-bit-R-on-64-bit-Windows-box-Still-not-enough-memory-tp2315742p2316493.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.

[R] Creating timeSeries

2010-08-06 Thread Serdar Akin
Hi I want to create a TimeSeries object with already defined dates (in the first vector) so that all the data are coerced as a time series object with the dates as they are. Is there anyone that have an idea what to do? 2010-07-07 3.900833 3.176667 2.754167 2.045833 1.820833 2010-04-21 4.256667

[R] gsub

2010-08-06 Thread Alfredo Alessandrini
Hi, I'm using gsub, but I've a problem. > print(i) [1] "piante_venere.csv" > gsub("\\.csv$", "", i) [1] "piante_venere" > gsub("^piante_", "", i) [1] "venere.csv" Can I combine the two expressions? Like this: > gsub(.) [1] "venere" Thanks, Alfredo -- View this message in context: ht

Re: [R] qqline error: Error in sort.list(x, partial = unique(c(lo, hi))) : 'x' must be atomic for 'sort.list' Have you called 'sort' on a list?

2010-08-06 Thread David Winsemius
On Aug 6, 2010, at 1:47 PM, Benjamin Caldwell wrote: Hi all, I'm modeling using lme in the nlme package. qqnorm makes plots just find, but when I try to add a line with qqline, I get the following error: "Error in sort.list(x, partial = unique(c(lo, hi))) : 'x' must be atomic for 'sort.lis

Re: [R] memory use without running gc()

2010-08-06 Thread Johann Hibschman
jim holtman writes: > ?memory.size Only works on Windows. I guess I should have specified; this is on Linux. Thanks, Johann __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www

Re: [R] Computation Duration Time

2010-08-06 Thread Erik Iverson
?Rprof or ?system.time TGS wrote: Is there a way to find out what the computation duration time was to complete executing a code chunk? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guid

Re: [R] m-estimators

2010-08-06 Thread Dennis Murphy
Hi: Try (install package sos first if necessary): library(sos) findFn('M-estimator') This produced 34 hits on my machine (not quite as productive as Petr's search :), but it identifies a few packages that contain functions for robust estimation. It's also a good way to get familiar with a very u

[R] Computation Duration Time

2010-08-06 Thread TGS
Is there a way to find out what the computation duration time was to complete executing a code chunk? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guid

Re: [R] memory use without running gc()

2010-08-06 Thread jim holtman
?memory.size On Fri, Aug 6, 2010 at 1:00 PM, Johann Hibschman wrote: > Is there any way to get the current memory used by R without running > gc()? > > I'd like to include the memory usage in logging output, but calling gc() > to get that information takes long enough to be noticeable (~ 6 s with

Re: [R] Plotting range of values in barplot()

2010-08-06 Thread Dennis Murphy
Hi: As far as I recall, no one has provided a horizontal barchart as a solution, so here's one using lattice: library(lattice) smw.dat<-factor(rep(c("Somewhat Disagree", "Neutral", "Somewhat Agree", "Strongly Agree"),c(1,2,7,12)), levels=c("Strongly Disagree", "Somewhat Disagree", "Ne

Re: [R] stats::reshape question

2010-08-06 Thread Wu Gong
It seems that we can't change the order of varying argument or v.names. "Notice that the order of variables in varying is like x.1,y.1,x.2,y.2. " Code can only be: reshape(d,varying=c("x1","y1","x2","y2"),v.names=c("x","y"),dir="long") - A R learner. -- View this message in context: http:

[R] qqline error: Error in sort.list(x, partial = unique(c(lo, hi))) : 'x' must be atomic for 'sort.list' Have you called 'sort' on a list?

2010-08-06 Thread Benjamin Caldwell
Hi all, I'm modeling using lme in the nlme package. qqnorm makes plots just find, but when I try to add a line with qqline, I get the following error: "Error in sort.list(x, partial = unique(c(lo, hi))) : 'x' must be atomic for 'sort.list' Have you called 'sort' on a list?" For example > modeli

Re: [R] Multiply each depth level of an array with another vector element

2010-08-06 Thread Wu Gong
It's interesting that sweep is the slowest one comparing to replicate and rep :) - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/Multiply-each-depth-level-of-an-array-with-another-vector-element-tp2315537p2316586.html Sent from the R help mailing list archive a

[R] stats::reshape question

2010-08-06 Thread Krishna Tateneni
Hello, A quick question for my edification. When I run the following (R 2.8.1 on Microsoft Windows): > d = data.frame(x1=c(1,2),x2=c(3,4),y1=c(5,6),y2=c(7,8)) > reshape(d,varying=c("y1","x1","y2","x2"),v.names=c("y","x"),dir="long") I found myself surprised by the results--the column labeled "y

Re: [R] eval-parse and lme in a loop

2010-08-06 Thread Greg Snow
> fortune(106) If the answer is parse() you should usually rethink the question. -- Thomas Lumley R-help (February 2005) Here is one approach that seems to be working: for (meanCol in paste("Mean_", 1:3, sep="")) { cat('\n##',meanCol,'\n\n') f <- formula( paste( me

[R] memory use without running gc()

2010-08-06 Thread Johann Hibschman
Is there any way to get the current memory used by R without running gc()? I'd like to include the memory usage in logging output, but calling gc() to get that information takes long enough to be noticeable (~ 6 s with ~ 20 GB of ram in use), which goes against the point of logging. Thanks, Johan

Re: [R] How to read a file inside a function?

2010-08-06 Thread Joshua Wiley
On Fri, Aug 6, 2010 at 9:29 AM, Raghuraman Ramachandran wrote: > Hi > > I wish to read a file from my local directory from inside a function. I am > passing the filename as the argument but this does not work. > Say for example > function(dat) > { > dat1=read.csv("D:\\dat.csv",header=TRUE) this d

Re: [R] Multiply each depth level of an array with another vector element

2010-08-06 Thread Greg Snow
?sweep -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Maurits Aben > Sent: Thursday, August 05, 2010 2:00 PM

Re: [R] gsub

2010-08-06 Thread Wu Gong
i <- "piante_venere.csv" gsub("^.*_(.*)\\.csv$", "\\1", i) - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/gsub-tp2316443p2316550.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org

Re: [R] plotting lines and colors

2010-08-06 Thread Joshua Wiley
On Fri, Aug 6, 2010 at 9:42 AM, Erin Hodgess wrote: > Dear R People: > > Suppose I plot the following > > plot(1:50) > > Is there a way to plot, say, [1:25] in red and [26:50] in blue, please? One simple way is with the col argument, there are certainly fancier solutions too. plot(1:50, col = re

[R] plotting lines and colors

2010-08-06 Thread Erin Hodgess
Dear R People: Suppose I plot the following plot(1:50) Is there a way to plot, say, [1:25] in red and [26:50] in blue, please? (or should I just plot 2 separate lines, please?) I'm about 99% sure that there is no way without 2 lines. thanks for any help, Sincerely, Erin -- Erin Hodgess Ass

Re: [R] How to read a file inside a function?

2010-08-06 Thread Wu Gong
ff <- function(filename) { dat1 <- read.csv(file=filename,header=TRUE) } filename <- "D:\dat.csv" ff(filename) - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/How-to-read-a-file-inside-a-function-tp2316516p2316528.html Sent from the R help mailing list archi

Re: [R] Stopping precision using 'optim'

2010-08-06 Thread Ravi Varadhan
Read the help file for optim(). ?optim It clearly says the following with regards to L-BFGS-B: factr controls the convergence of the "L-BFGS-B" method. Convergence occurs when the reduction in the objective is within this factor of the machine tolerance. Default is 1e7, that is a tolerance of ab

[R] How to read a file inside a function?

2010-08-06 Thread Raghuraman Ramachandran
Hi I wish to read a file from my local directory from inside a function. I am passing the filename as the argument but this does not work. Say for example function(dat) { dat1=read.csv("D:\\dat.csv",header=TRUE) } If I call funtion(dat) I get the following error. 'Intuitively' i understand this is

Re: [R] Is R GPL or LGPL (or can I write a commercial front end to R)?

2010-08-06 Thread Tom Quarendon
o the limitations or freedoms that they are intending to >> allow. After all, as the copyright owners they aren't going to sue if a use >> falls within their intention, even if on a strict interpretation of the >> license such use wouldn't be allowed. >> &g

[R] Tukey post hoc test for testing interaction between two or more predictors

2010-08-06 Thread Nicola Spotorno
Hi everyone, I woudl like to apply a Tukey post hoc after a repeated measure ANOVA. I followed the suggestions that I found in this help -list especially this one: /[R] Tukey HSD (or other post hoc tests) following repeated measures ANOVA You want to use lme() in package nlme, then glht()

Re: [R] Is R GPL or LGPL (or can I write a commercial front end to R)?

2010-08-06 Thread Tom Quarendon
ution Analytics http://blog.revolutionanalytics.com Tel: +1 (650) 330-0553 x205 (Palo Alto, CA, USA) __ Information from ESET NOD32 Antivirus, version of virus signature database 5347 (20100806) __ The message was checked by ESET NOD32 Antivirus. http://www.ese

Re: [R] Is R GPL or LGPL (or can I write a commercial front end to R)?

2010-08-06 Thread Tom Quarendon
rs they aren't going to sue if a use >> falls within their intention, even if on a strict interpretation of the >> license such use wouldn't be allowed. >> >> >> >> So it seems to be the intention that I can write a DLL to provide R >> functions in an add on package, whic

Re: [R] Is R GPL or LGPL (or can I write a commercial front end to R)?

2010-08-06 Thread David Smith
Tom, I would strongly echo the advice of Duncan and Marc and others already on this thread to seek expert legal advice on this issue. At Revolution we rely on the expertise of Mark Radcliffe, the General Legal Counsel of the Open Source Initiative. (Additional information here: http://www.revoluti

[R] About R base

2010-08-06 Thread Stephen Liu
Hi folks, I have R x64 2.11.1 installed on Win 7 64 bit which is running as VM (guest) on Oracle VirtualBox. Is there any difference between it and R on Linux? I can install another R on Debian 5.04, also running as VM. TIA B.R. Stephen L __ R-

[R] Colours on conditional levelplots in package "lattice"

2010-08-06 Thread gordon . morrison
I am having difficulty in getting the colours on a conditional levelplot in the package lattice to work as I want them to - I wonder if someone could help me. The colours do not completely agree with the colour key. Here is a specimen example. require(lattice) col1 <- c (1.37,2.35,0.20,1.85,0.

Re: [R] Is R GPL or LGPL (or can I write a commercial front end to R)?

2010-08-06 Thread Marc Schwartz
Tom, FWIW, since you appear to be representing World Programming in your queries (at least that is my inference given your e-mail domain), it would be prudent to get formal legal advice here and not place your company at legal and financial risk by basing decisions on comments (well intentioned

Re: [R] image plot but data not on grid.

2010-08-06 Thread David Winsemius
On Aug 6, 2010, at 10:24 AM, W Eryk Wolski wrote: Hi, Would like to make an image however the values in z are not on an uniform grid. Have a dataset with length(x) == length(y) == length(z) x[1],y[1] gives the position of z[1] and would like to encode value of z by a color. looking for some

Re: [R] data.frame: return all rows where at least one...

2010-08-06 Thread werner w
Thanks for the answers! The any function was basically exactly what I was looking for. (previously I used something with rowSums() which is probably not the most efficient way.) Thanks so much, Werner -- View this message in context: http://r.789695.n4.nabble.com/data-frame-return-all-rows-w

Re: [R] image plot but data not on grid.

2010-08-06 Thread Martyn Byng
Hi, Not really sure what you are after, but the following plots a series of points of varying colour plot(x,y,type='n') apply(cbind(x,y,z),1,function(a) {points(a[1],a[2],col=a[3],pch=".")}) but its going to be really slow for a large number of points Martyn -Original Message- From: r-

[R] Error on random forest variable importance estimates

2010-08-06 Thread Pierre Dubath
Hello, I am using the R randomForest package to classify variable stars. I have a training set of 1755 stars described by (too) many variables. Some of these variables are highly correlated. I believe that I understand how randomForest works and how the variable importance are evaluated (thr

Re: [R] Partial Function Application

2010-08-06 Thread Mog
Thank you! That's exactly what I wanted. --Mog __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained,

[R] image plot but data not on grid.

2010-08-06 Thread W Eryk Wolski
Hi, Would like to make an image however the values in z are not on an uniform grid. Have a dataset with length(x) == length(y) == length(z) x[1],y[1] gives the position of z[1] and would like to encode value of z by a color. looking for something like plot(x,y, col = z) where col for z is cleve

Re: [R] Partial Function Application

2010-08-06 Thread baptiste Auguié
Hi, I think you mean Currying, there's a function in roxygen that looks like, Curry function (f, ..., .left = TRUE) { .orig = list(...) function(...) { if (.left) { args <- c(.orig, list(...)) } else { args <- c(list(...), .orig) }

Re: [R] Partial Function Application

2010-08-06 Thread David Winsemius
On Aug 6, 2010, at 9:56 AM, Mog wrote: Hi. I would like to partially apply a function to a list of arguments, and I don't know how to do this in R, without perhaps writing default values to the formals() of my function, or writing to the environment object of a function. For context, my definit

[R] [OT] R on Atlas library

2010-08-06 Thread Matthias Gondan
Dear List, I am aware this is slightly off-topic, but I am sure there are people who already had the problem and who perhaps solved it. I am running long-lasting model fits using constrOptim command. At work there is a linux computer (Quad Core, debian) on which I already have compiled R and Atl

Re: [R] Is R GPL or LGPL (or can I write a commercial front end to R)?

2010-08-06 Thread peter dalgaard
ight owners they aren't going to sue if a use >>> falls within their intention, even if on a strict interpretation of the >>> license such use wouldn't be allowed. >>> >>> >>> >>> So it seems to be the intention that I can write a D

Re: [R] try-error within for loop

2010-08-06 Thread Olga Lyashevska
Wu Gong wrote: > So, try() inside loop should work. Like > > for () { > if (class(try(...,silent=T))=="try-error") result[[i]] <- NA > ... > } Thanks a lot, it worked for me! Cheers Olga __ R-help@r-project.org mailing list https://stat.ethz

[R] Odp: Pausing script to allow user input from keyboard.

2010-08-06 Thread Petr PIKAL
Hi Some time ago somebody advised me to use cat("\n","Enter filename","\n") # prompt x=scan(n=1) # read 1 line from console than use x in further code Regards Petr r-help-boun...@r-project.org napsal dne 06.08.2010 15:52:17: > Hi all, > > I have written a simple R script to help me analyze

Re: [R] Pausing script to allow user input from keyboard.

2010-08-06 Thread jim holtman
Don't cut/paste; 'source' in the script. readLines is trying to read from stdin which is where the commands are being read from. Using 'source' avoids that problem. You can also look at some examples I have seen using tk/tcl where you can bring up a window for user input. On Fri, Aug 6, 2010 at

[R] Partial Function Application

2010-08-06 Thread Mog
Hi. I would like to partially apply a function to a list of arguments, and I don't know how to do this in R, without perhaps writing default values to the formals() of my function, or writing to the environment object of a function. For context, my definition of partially apply is: "fix some of the

[R] Pausing script to allow user input from keyboard.

2010-08-06 Thread Johnny Tkach
Hi all, I have written a simple R script to help me analyze a large data set. I would like to have the script pause to allow the user to input a character string that is subsequently used as a filename when saving tables. I have tried to use the "readline" command - this seems to work fi

Re: [R] Exporting nlme summary

2010-08-06 Thread Ronald Wendt
Thanks for all the help. A nice and easy fix. On Thu, Aug 5, 2010 at 6:36 PM, David Winsemius wrote: > > On Aug 5, 2010, at 6:22 PM, Jun Shen wrote: > > I believe this has been discussed many times in the archives. Here is >> one way to do it. >> > > Yes, you are so right. > > >> Use function "s

Re: [R] Is R GPL or LGPL (or can I write a commercial front end to R)?

2010-08-06 Thread Tom Quarendon
king here about anything to do with code written in the > language of R. This is purely concerned with treating R as a library with an > interface and wanting to link to that interface and whether the intention or > the actuality of the license allow that. > > > > Thanks!

Re: [R] A %nin% operator?

2010-08-06 Thread Kevin Wright
There's many additional operators defined in the mvbutils package, including %!in%. Kevin On Thu, Aug 5, 2010 at 10:25 AM, David Huffer wrote: > See Harrell's Hmisc package > > -- > David Huffer, Ph.D. > Deputy Director > CSOSA/ORE > Washington, DC > > -Original Message- > From: r-h

Re: [R] Tobit Modelling

2010-08-06 Thread Cristian Montes
Hi Patrick Here is some code that might help you implement your tobit regression, if you don´t mind using maximum likelihood. #first declare a likelihood function with a censored model #assume your x2 is censored for values below -1, and using a simple #linear model in this case. Our censoring

Re: [R] data.frame: return all rows where at least one...

2010-08-06 Thread Tal Galili
One solution - let's say our data.frame is "xx" Then: xx <- matrix(rnorm(9), 3,3) apply(xx < 0, 1, any) Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostat

[R] Problems using external BLAS

2010-08-06 Thread Bjørn-Helge Mevik
I have problems building R 2.11.1 with an external BLAS. I've tried several with several libraries: # ACML: export LD_LIBRARY_PATH=/site/VERSIONS/acml-3.6.0/gfortran64_int64/lib BLAS=--with-blas="-L/site/VERSIONS/acml-3.6.0/gfortran64_int64/lib -lacml" LAPACK=--with-lapack # MKL 11: BLAS=--with-

Re: [R] data.frame: return all rows where at least one...

2010-08-06 Thread Erik Iverson
On 08/06/2010 08:03 AM, Werner W. wrote: Hi, I know ways to do this but they all seem awkward and I somehow believe that there is a convenient shortcut. Since you don't show us what you tried, I don't know what you consider 'awkward'. If I have a data.frame with many columns, how can I re

[R] data.frame: return all rows where at least one...

2010-08-06 Thread Werner W.
Hi, I know ways to do this but they all seem awkward and I somehow believe that there is a convenient shortcut. If I have a data.frame with many columns, how can I request all rows for which at least one column satisfy an expression? For instance, all rows where at least one column is negativ

  1   2   >