[R] Passing a character argument onto a function

2011-03-11 Thread Tyler Rinker
I am a new R user and am beginning to employ function creation in my statistical work. I am running into a problem when I want to pass on a character (text) to the function as an argument. I have a simple example below to demonstrate this problem. I cannot seem to find a fix in my R book or

Re: [R] Kendall Theil line as fit?

2011-03-11 Thread jonbfish
Thanks again. I guess I have been fitting in splus gui and in R Commander, not really calling it myself. I was thinking maybe there was a way to define it as a class or something. I will have to look at segments. Any thoughts if this might be easy to use with years on an axis? From: Peter Ehle

[R] Stepwise Discriminant... in R

2011-03-11 Thread Ty Smith
Hello R list, I'm looking to do some stepwise discriminant function analysis (DFA) based on the minimization of Wilks' lambda in R to end up with a composite signature (of metals "Al","Sb","Bi","Cr","Ba") capable of discriminating 100% of the source factors (LANDUSE: "A","B","C"). The Wilks' lamb

Re: [R] No response after click the "show Rules" button on Tab "Associate".

2011-03-11 Thread Xiaobo Gu
On Sat, Mar 12, 2011 at 10:02 AM, Graham Williams wrote: > On 12 March 2011 00:07, Xiaobo Gu wrote: >> On Fri, Mar 11, 2011 at 2:55 AM, Graham Williams >> wrote: >>> Did you scroll down the window to see the rules? >> OK, it takes a long time for rattle to show the rules, about 30 >> seconds, an

Re: [R] Lattice: Feature Request

2011-03-11 Thread David Winsemius
On Mar 11, 2011, at 3:00 PM, Jim Price wrote: Thanks Peter. This is true, but consider this continuation of my example (which is probably what I should have written originally): my.opts <- list(default.args = list( as.table = TRUE, bet

Re: [R] Any existing functions for reading and extracting data from path names?

2011-03-11 Thread Ista Zahn
Thanks Mikhail. I've been doing something very similar to your example below, I was just wondering if anyone had packaged functions for this task. Thanks again, Ista On Sat, Mar 12, 2011 at 12:39 AM, Mikhail Titov wrote: > I'm not sure what you are trying to achieve, but I think this can be a goo

Re: [R] (no subject)

2011-03-11 Thread Joshua Wiley
Just as a note, if you are going to convert a factor to numeric, the preferred idiom is: ## hypothetical numeric factor x <- factor(paste(10:15)) ## preferred method for conversion as.numeric(levels(x))[x] Cheers, Josh __ R-help@r-project.org mailing

Re: [R] No response after click the "show Rules" button on Tab "Associate".

2011-03-11 Thread Graham Williams
On 12 March 2011 00:07, Xiaobo Gu wrote: > On Fri, Mar 11, 2011 at 2:55 AM, Graham Williams > wrote: >> Did you scroll down the window to see the rules? > OK, it takes a long time for rattle to show the rules, about 30 > seconds, and why the message on the status bar is "the decision tree > model

Re: [R] Any existing functions for reading and extracting data from path names?

2011-03-11 Thread Mikhail Titov
I'm not sure what you are trying to achieve, but I think this can be a good starting point: files <- list.files("deleteme", full.names=TRUE, recursive=TRUE) names <- sapply(strsplit(files, "/", TRUE), "[", 2) x <- lapply(files, function(f) { out <- read.csv(f) out$city <- strsplit(f, "/",

Re: [R] Kendall Theil line as fit?

2011-03-11 Thread Peter Ehlers
On 2011-03-11 14:43, jonbfish wrote: Thanks for the response, sorry I didn't post it initially. kt.mat<- function(x,y,z){ for(i in 1:length(x)){for(j in 1:length(y)){z[i,j]<-(y[j]-y[i])/(x[j]-x[i])}} return(z)} kt.slope<- function(x,y,z,s){ count<-0 for(i in 1:length(x)){for(j in 1:length(y)){

[R] is gzcon w/ urls not implemented or used differently on linux?

2011-03-11 Thread Tyler Backman
I wrote some code which reads a gzipped text file directly from the web with gzcon(url()) and it works perfectly on OSX, but I cannot get it to work on linux at all, trying several different R versions and linux distributions. Any ideas? Here's an example of my code: z <- gzcon(url("ftp://ftp-

Re: [R] Lattice: Feature Request

2011-03-11 Thread Jim Price
Thanks Peter. This is true, but consider this continuation of my example (which is probably what I should have written originally): my.opts <- list(default.args = list( as.table = TRUE, between = list(x = 0.2, y = 0.2),

Re: [R] Kendall Theil line as fit?

2011-03-11 Thread jonbfish
Thanks for the response, sorry I didn't post it initially. kt.mat <- function(x,y,z){ for(i in 1:length(x)){for(j in 1:length(y)){z[i,j]<-(y[j]-y[i])/(x[j]-x[i])}} return(z)} kt.slope <- function(x,y,z,s){ count<-0 for(i in 1:length(x)){for(j in 1:length(y)){ if(j >= i+1) { count<-count+1 s[coun

Re: [R] Kendall Theil line as fit?

2011-03-11 Thread Peter Ehlers
On 2011-03-11 10:49, jonbfish wrote: Also called Sen's slope estimate... Could you provide some reproducible code? I have no idea how you're plotting the lines. Peter Ehlers -- View this message in context: http://r.789695.n4.nabble.com/Kendall-Theil-line-as-fit-tp3344617p3348823.html Sent

Re: [R] Reference Lines Using Grid Graphics

2011-03-11 Thread Pete Brecknock
Thanks Gabor. I owe you again. Kind regards Pete -- View this message in context: http://r.789695.n4.nabble.com/Reference-Lines-Using-Grid-Graphics-tp3349185p3349259.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.or

Re: [R] Reference Lines Using Grid Graphics

2011-03-11 Thread Gabor Grothendieck
On Fri, Mar 11, 2011 at 4:50 PM, Pete Brecknock wrote: > Hi > > I would like to be able to add reference lines to a series of plots that are > built using the Grid graphics package. These lines should coincide with tick > marks which are different on each plot. > > I can add the lines manually usi

Re: [R] 'Date' elements within a matrix

2011-03-11 Thread jim holtman
It is easy to recover the date by using as.Date: > dat <- matrix(seq(as.Date("2011-01-01"), as.Date("2011-01-09"), by="1 day"), > 3) > dat [,1] [,2] [,3] [1,] 14975 14978 14981 [2,] 14976 14979 14982 [3,] 14977 14980 14983 > str(dat) num [1:3, 1:3] 14975 14976 14977 14978 14979 ... > as.

Re: [R] Reference Lines Using Grid Graphics

2011-03-11 Thread Pete Brecknock
Apologies I forgot to include that the reference lines should be for the y axis only. Thanks. Pete -- View this message in context: http://r.789695.n4.nabble.com/Reference-Lines-Using-Grid-Graphics-tp3349185p3349206.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Error in plot.lm

2011-03-11 Thread Peter Ehlers
On 2011-03-11 13:33, Jeff Newmiller wrote: Thank you for indicating more precisely where the bug arises. I disagree with the blanket assertion that the I() is not needed. The example is purposely simplified to illustrate the problem, which lm has no difficulty with but which plot.lm does. plot.l

Re: [R] How to source a part of the file

2011-03-11 Thread jim holtman
I meant to say, but my fingers got ahead of my brain: source(textConnection(readLines(yourFile)[10:20])) On Fri, Mar 11, 2011 at 4:53 PM, jim holtman wrote: > You can do: > > source(readLines(yourFile)[10:20])   # lines 10-20 of the file > > On Fri, Mar 11, 2011 at 4:41 PM, Paul Y. Peng wrote:

Re: [R] How to source a part of the file

2011-03-11 Thread jim holtman
You can do: source(readLines(yourFile)[10:20]) # lines 10-20 of the file On Fri, Mar 11, 2011 at 4:41 PM, Paul Y. Peng wrote: > I have a text file of R commands. Some times I only want to run a few lines > of the R commands in an existing R session and wonder whether there is a > simple way to

[R] Reference Lines Using Grid Graphics

2011-03-11 Thread Pete Brecknock
Hi I would like to be able to add reference lines to a series of plots that are built using the Grid graphics package. These lines should coincide with tick marks which are different on each plot. I can add the lines manually using the grid.lines() function but would like to understand how to ge

Re: [R] How to source a part of the file

2011-03-11 Thread Gabor Grothendieck
On Fri, Mar 11, 2011 at 4:41 PM, Paul Y. Peng wrote: > I have a text file of R commands. Some times I only want to run a few lines > of the R commands in an existing R session and wonder whether there is a > simple way to do this. > > To run a few lines in a new session of R, I could use sed to pi

[R] How to source a part of the file

2011-03-11 Thread Paul Y. Peng
I have a text file of R commands. Some times I only want to run a few lines of the R commands in an existing R session and wonder whether there is a simple way to do this. To run a few lines in a new session of R, I could use sed to pick up the lines from the file and pipe them into R. source() d

Re: [R] Error in plot.lm

2011-03-11 Thread peter dalgaard
On Mar 11, 2011, at 20:31 , David Winsemius wrote: > > Are you sure you need I() on the LHS? The I function is designed to avoid the > confusion related to the dual use of the arithmetic operator symbols > affecting the construction of the model matrix, but I don't think that > applies to th

Re: [R] Error in plot.lm

2011-03-11 Thread Jeff Newmiller
Thank you for indicating more precisely where the bug arises. I disagree with the blanket assertion that the I() is not needed. The example is purposely simplified to illustrate the problem, which lm has no difficulty with but which plot.lm does. plot.lm manages to deal with I() on the right si

Re: [R] 'Date' elements within a matrix

2011-03-11 Thread Gabor Grothendieck
On Fri, Mar 11, 2011 at 4:15 PM, Bogaso Christofer wrote: > Dear all, when I put date objects (class of 'Date') in a matrix it becomes > numeric: > >> dat <- matrix(seq(as.Date("2011-01-01"), as.Date("2011-01-09"), by="1 > day"), 3) > >> dat > >      [,1]  [,2]  [,3] > > [1,] 14975 14978 14981 > >

Re: [R] 'Date' elements within a matrix

2011-03-11 Thread Phil Spector
It will be difficult or impossible to store objects of class Date in a matrix -- you'll need to store them in a data frame: pts = seq(as.Date("2011-01-01"), as.Date("2011-01-09"), by="1 day") z = data.frame(pts[1:3],pts[4:6],pts[7:9]) z pts.1.3. pts.4.6. pts.7.9. 1 2011-01-01 2011-01-04

Re: [R] Large dataset operations

2011-03-11 Thread Claudia Beleites
Haakon, as replicates imply that they all have the same data type, you can put them into a matrix which is often faster and needs less memory (though whether that can really matter depends of the number of replicates you have: for small no of replicates you won't have much effect anyways). Bu

Re: [R] Error in plot.lm

2011-03-11 Thread Peter Ehlers
On 2011-03-11 11:31, David Winsemius wrote: On Mar 11, 2011, at 2:06 PM, Jeff Newmiller wrote: > I am encountering an error with plot.lm: > >> tstdf<- data.frame( y=c(1.01,1.98,3.02,3.99),x=c(1,2,3,4)) >> plot(lm(I(y) ~ x, data=tstdf)) > Hit to see next plot: > Hit to see next plot: >

[R] 'Date' elements within a matrix

2011-03-11 Thread Bogaso Christofer
Dear all, when I put date objects (class of 'Date') in a matrix it becomes numeric: > dat <- matrix(seq(as.Date("2011-01-01"), as.Date("2011-01-09"), by="1 day"), 3) > dat [,1] [,2] [,3] [1,] 14975 14978 14981 [2,] 14976 14979 14982 [3,] 14977 14980 14983 > class(dat[1,1]) [1] "nume

Re: [R] Large dataset operations

2011-03-11 Thread Phil Spector
To get the equivalent of what your loop does, you could use lapply(data[,3:5],function(x)x/ave(x,data$plateNo,FUN=mean)) but you might find the output of sapply(data[,3:5],function(x)x/ave(x,data$plateNo,FUN=mean)) to be more useful. - Phil Spector

Re: [R] Partial Cross Correlation

2011-03-11 Thread Don McKenzie
Belay that. I misread the post. On 11-Mar-11, at 12:09 PM, Don McKenzie wrote: ?pacf On 11-Mar-11, at 9:42 AM, Kevin Boggs wrote: Does anyone know of any R code for computing partial cross- correlation? I have examples of cross correlation functions (ccfs) that are not smooth but rather

Re: [R] Partial Cross Correlation

2011-03-11 Thread Don McKenzie
?pacf On 11-Mar-11, at 9:42 AM, Kevin Boggs wrote: Does anyone know of any R code for computing partial cross- correlation? I have examples of cross correlation functions (ccfs) that are not smooth but rather consist of a peak of several high values in consecutive lags, with sharp drops on

Re: [R] Kendall Theil line as fit?

2011-03-11 Thread jonbfish
Also called Sen's slope estimate... -- View this message in context: http://r.789695.n4.nabble.com/Kendall-Theil-line-as-fit-tp3344617p3348823.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://st

[R] Partial Cross Correlation

2011-03-11 Thread Kevin Boggs
Does anyone know of any R code for computing partial cross-correlation? I have examples of cross correlation functions (ccfs) that are not smooth but rather consist of a peak of several high values in consecutive lags, with sharp drops on either side. This indicates that y(t) is a function of

[R] Large dataset operations

2011-03-11 Thread hi Berven
Hello all, I'm new to R and trying to figure out how to perform calculations on a large dataset (300 000 datapoints). I have already made some code to do this but it is awfully slow. What I want to do is add a new column for each "rep_ " column where I have taken each value and divide it by t

Re: [R] minimum distance between line segments

2011-03-11 Thread Stephan Kolassa
Hi, this sounds like a standard problem in Computational Geometry - I guess game developers have to deal with something like this all the time. You may want to look at a textbook or two. An article with the promising title "On fast computation of distance between line segments" can be found

Re: [R] Easy 'apply' question

2011-03-11 Thread Aaron Polhamus
Perfect, thanks Josh! Cheers, A 2011/3/10 Joshua Wiley > Dear Aaron, > > The problem is not with your function, but using apply(). Look at the > "Details" section of ?apply You will see that if the data is not an > array or matrix, apply will coerce it to one (or try). Now go over to > the "

Re: [R] minimum distance between line segments

2011-03-11 Thread rex.dwyer
I think I need to retract the part about 3 iterations... not true if, e.g., the segments intersect and the angle is small. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of rex.dw...@syngenta.com Sent: Friday, March 11, 2011 2:37 PM

Re: [R] minimum distance between line segments

2011-03-11 Thread rex.dwyer
I like Thomas's idea as a quick practical solution. Here is one more little variation just in case you really do have millions of these distances. Pick point P1 on line segment L1 (e.g., an endpoint). Pick 101 evenly spaced points on line segment L2. Find the nearest to P1 and call it P2. N

Re: [R] Error in plot.lm

2011-03-11 Thread David Winsemius
On Mar 11, 2011, at 2:06 PM, Jeff Newmiller wrote: I am encountering an error with plot.lm: tstdf <- data.frame( y=c(1.01,1.98,3.02,3.99),x=c(1,2,3,4)) plot(lm(I(y) ~ x, data=tstdf)) Hit to see next plot: Hit to see next plot: Error in object$coefficients : $ operator is invalid for atomic

Re: [R] Lattice: Feature Request

2011-03-11 Thread Peter Ehlers
On 2011-03-10 15:07, Jim Price wrote: Hi, I'm currently designing some global themes for use with lattice, and have hit a snag. There doesn't appear to be (in xyplot at least) a way of setting a lattice option for the 'scales' parameter at a global level - changes have to be made in each functio

[R] Error in plot.lm

2011-03-11 Thread Jeff Newmiller
I am encountering an error with plot.lm: tstdf <- data.frame( y=c(1.01,1.98,3.02,3.99),x=c(1,2,3,4)) plot(lm(I(y) ~ x, data=tstdf)) Hit to see next plot: Hit to see next plot: Error in object$coefficients : $ operator is invalid for atomic vectors Obviously I don't need the I() in this examp

Re: [R] nesting same set of values with each level of another set of values

2011-03-11 Thread Dimitri Liakhovitski
Thanks a lot, David! Exactly what I was looking for! Dimitri On Fri, Mar 11, 2011 at 1:46 PM, David Winsemius wrote: > > On Mar 11, 2011, at 1:26 PM, Dimitri Liakhovitski wrote: > >> Hello! >> >> The code below works and does what I need it to do. >> However, I think the way I create myframe (las

Re: [R] nesting same set of values with each level of another set of values

2011-03-11 Thread David Winsemius
On Mar 11, 2011, at 1:26 PM, Dimitri Liakhovitski wrote: Hello! The code below works and does what I need it to do. However, I think the way I create myframe (last step) is very un-R-like and probably not very efficient. I am sure there are better, more R-appropriate methods. Any pointers? Tha

[R] nesting same set of values with each level of another set of values

2011-03-11 Thread Dimitri Liakhovitski
Hello! The code below works and does what I need it to do. However, I think the way I create myframe (last step) is very un-R-like and probably not very efficient. I am sure there are better, more R-appropriate methods. Any pointers? Thanks a lot! Dimitri # Step 1: Creating a vector of dates: myd

Re: [R] Any existing functions for reading and extracting data from path names?

2011-03-11 Thread Ista Zahn
Thanks Henrik, that is exactly what I was hoping for! Best, Ista On Fri, Mar 11, 2011 at 1:02 PM, Henrik Bengtsson wrote: > Hi, > > the R.filesets package was designed for this.  It is heavily used by > the aroma framework (http://www.aroma-project.org/), so it got a fair > bit of mileage now (i

Re: [R] Any existing functions for reading and extracting data from path names?

2011-03-11 Thread Henrik Bengtsson
Hi, the R.filesets package was designed for this. It is heavily used by the aroma framework (http://www.aroma-project.org/), so it got a fair bit of mileage now (in a good a way). Here is how you could setup your data set and work with the data. # - - - - - - - - - - - - # Setup file data set

Re: [R] ERROR: gamm function (mgcv package). attempt to set an attribute on NULL

2011-03-11 Thread Simon Wood
Thanks. This is a bug, the source code made an implicit assumption that there would always be at least one smooth, when creating the gam object after fitting. Fixed for the next release (1.7-5). For now, you could use glmmPQL from the MASS library to get an equivalent fit when there are no smoot

Re: [R] (no subject)

2011-03-11 Thread Ista Zahn
Hi Andreas, if your factor is named "x", you can do as.numeric(as.character(x)) Best, Ista On Fri, Mar 11, 2011 at 10:45 AM, Andreas Emanuelsson wrote: > Hi, I have tried to load a file originally from Excel, via csv, text and > clipboard today. > > When I succeed I cannot change the format from

Re: [R] Generation of random numbers in a function - (Return command)

2011-03-11 Thread jim holtman
You can only return a single object. You might want to create a list if you have multiple objects: return(list(output_avg_mc, output_stdev_mc)) On Fri, Mar 11, 2011 at 10:51 AM, Vincy Pyne wrote: > Dear R helpers > > I have following data.frame and for each product_name, I have associated mean

Re: [R] (no subject)

2011-03-11 Thread Joshua Wiley
Hi Andreas, Assuming you are using read.table(), try setting the argument: stringsAsFactors = FALSE Also consider what about the Excel file is making R default to a factor rather than numerical? There may be a nonstandard reprsentation of missing data (e.g., "."), which could also be specified t

[R] Any existing functions for reading and extracting data from path names?

2011-03-11 Thread Ista Zahn
Hi helpeRs, I have inherited a set of data files that use the file system as a sort of poor man's database, i.e., the data files are nested in directories that indicate which city they come from. For example: dir.create("deleteme") for(i in paste("deleteme", c("New York", "Los Angeles"), sep="/")

Re: [R] (no subject)

2011-03-11 Thread jim holtman
If you are using 'read.csv', add the parameteras.is=TRUE to prevent conversion to factors. If you have factors that are supposed to be numeric, use the following df$mydata <- as.numeric(as.character(df$mydata)) On Fri, Mar 11, 2011 at 10:45 AM, Andreas Emanuelsson wrote: > Hi, I have trie

Re: [R] creating additional column

2011-03-11 Thread Laszlo
Thank you Philipp, it is very useful! How come I haven't figured it out myself I dont know... Have a pleasant weekend! Laszlo -- View this message in context: http://r.789695.n4.nabble.com/creating-additional-column-tp3341224p3348552.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] changing one character in the name of dataframes repeatedly

2011-03-11 Thread Ivan Calandra
Hi, I think, what you want is assign(). for (i in 1:6) assign(paste("df", i, sep="."), split(df,df$a)[[i]]) But using lists is usually a better solution since you can work with them using functions such as lapply(). First, you don't need cbind() to create your data.frame: df2 <- data.frame(a,

[R] Fwd: How to get all combinations between two character vectors?

2011-03-11 Thread roberto . muller
Hi Rainer Or maybe you are referring to the outer function. I'm a newbie in R, but I recently read something about it in the pdf book named below (pages 91-2). I send to you an excerpt: An introduction to R An introduction to R Longhow Lam 6.2.5 The outer function outer function Th

Re: [R] Timezone issue with strftime/strptime and %z and %Z

2011-03-11 Thread jdnew...@gmail.com
I have found the various "tz" arguments not to provide the support I would like in terms of arbitrary timezones. For now I use Sys.setenv(TZ="timezone_spec") prior to input or output, and do not use the tz arguments. In your case, I would consider keeping a character copy of the input to write

[R] (no subject)

2011-03-11 Thread Andreas Emanuelsson
Hi, I have tried to load a file originally from Excel, via csv, text and clipboard today. When I succeed I cannot change the format from "factor", and when I try to convert it to numerical it only gives the position of the "factor-group", not the real value in the column? Any quick suggestions

Re: [R] changing one character in the name of dataframes repeatedly

2011-03-11 Thread David Winsemius
On Mar 11, 2011, at 10:49 AM, Bodnar Laszlo EB_HU wrote: Dear R-community, I'd like to ask you a question concerning R again. I try to keep this simple because I am not willing to confuse you at all. I have a little data frame which I have created the following way: a <-c(1,1,1,1,1,2,2,2,

Re: [R] Help writing a Scheffe Contrast function for R

2011-03-11 Thread peter dalgaard
On Mar 10, 2011, at 05:49 , Tyler Rinker wrote: > > My Question: What do I need to do to correct the three error codes R gives > me and make the function run correctly? > > This is the session, code and R's error message when supplied with data: >> rm(list=ls()) >> dat1<-read.table("dat1.csv

[R] Generation of random numbers in a function - (Return command)

2011-03-11 Thread Vincy Pyne
Dear R helpers I have following data.frame and for each product_name, I have associated mean and standard deviation. I need to generate 1000 random no.s for each of these products and find the respective mean and standard deviation.   My R code is as follows.   library(plyr) library(reshape2)

[R] changing one character in the name of dataframes repeatedly

2011-03-11 Thread Bodnar Laszlo EB_HU
Dear R-community, I'd like to ask you a question concerning R again. I try to keep this simple because I am not willing to confuse you at all. I have a little data frame which I have created the following way: a <-c(1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6) b <-c(1,2,3,4,5,6

[R] changing one character in the name of dataframes repeatedly

2011-03-11 Thread Bodnar Laszlo EB_HU
Dear R-community, I'd like to ask you a question concerning R again. I try to keep this simple because I am not willing to confuse you at all. I have a little data frame which I have created the following way: a <-c(1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6) b <-c(1,2,3,4,5,6

[R] I cannot install Cairo package on R-2.12.2

2011-03-11 Thread nqueralt
Dear all, I have installed R-2.12.2 version on a Suse OS. I am trying to install the Cairo package on R but I got this error message: installing to /dades/R-2.12.2/lib64/R/library/Cairo/libs ** R ** preparing package for lazy loading ** help *** installing help indices ** building pac

Re: [R] 'autocompletion' of named elements of a list

2011-03-11 Thread Peter Ehlers
On 2011-03-11 01:07, Ivan Calandra wrote: Hi, From ?"$", you can see that using [[ instead would do what you're looking for. You should read and try to understand the whole help file. The reason is that for [[ the default is exact=TRUE, wheareas for $ the only possible value is exact=FALSE, wh

Re: [R] system(..., invisible=FALSE, show.output.on.console=FALSE) in Windows 7

2011-03-11 Thread Gabor Grothendieck
On Wed, Mar 9, 2011 at 12:14 PM, Ralph Olsson wrote: > Hello, > > I work for a company in which a number of employees use R. Many of them like > to run executables via the system function in such a way that the output of > that executable is displayed in a separate window. To give an example of

Re: [R] system(..., invisible=FALSE, show.output.on.console=FALSE) in Windows 7

2011-03-11 Thread Ralph Olsson
Hi, Thanks for taking the time to respond. After further investigation I suspect the "invisible=FALSE" has nothing to do with the problem we're having. It may also be a different issue to the one Jim has seen. Jim describes the command window flashing up and disappearing. We saw this in R 2.1

Re: [R] robust estimation

2011-03-11 Thread S Ellison
Is the L1 norm not equivalent to quantile regression for the 0.5th quantile? If so, quantreg would do it using rq with the defult value for tau. S Ellison >>> Wilhelm Caspary 11/03/2011 12:31 >>> Hi, I have been looking through all packages but I cannot find a routine for LAD-regression (L1-no

Re: [R] Timezone issue with strftime/strptime and %z and %Z

2011-03-11 Thread David Winsemius
On Mar 11, 2011, at 9:23 AM, Daniel Nüst wrote: 2011/3/11 David Winsemius : On Mar 11, 2011, at 8:54 AM, Daniel Nüst wrote: Let me rephrase my question: How can I create a time object from the character string "1995-05-25T15:30:00-10:00" and get exactly the same character string again whe

Re: [R] How to get all combinations between two character vectors?

2011-03-11 Thread David L Lorenz
Rainer, The are probably lots of ways, I'd use levels(interaction(c("a", "b"), c('x', 'y'), sep='')) Dave >Hi > >I know there is a function - I have used it before - but I always forget >what it is called... > >I need the combination of two character vectors, i.e: > >x <- c("a", "b") >y <- c

Re: [R] Timezone issue with strftime/strptime and %z and %Z

2011-03-11 Thread Daniel Nüst
2011/3/11 David Winsemius : > > On Mar 11, 2011, at 8:54 AM, Daniel Nüst wrote: >> Let me rephrase my question: How can I create a time object from the >> character string "1995-05-25T15:30:00-10:00" and get exactly the same >> character string again when formatting it/printing it? > >> x <- as.POS

Re: [R] Timezone issue with strftime/strptime and %z and %Z

2011-03-11 Thread Daniel Nüst
Update: I ran the following commands on a Linux machine: > sessionInfo() R version 2.12.1 (2010-12-16) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=de_DE.utf8 LC_NUMERIC=C [3] LC_TIME=de_DE.utf8 LC_COLLATE=de_DE.utf8 [5] LC_MONETARY=de_DE.utf8 LC_MESSAGE

Re: [R] robust estimation

2011-03-11 Thread David Winsemius
On Mar 11, 2011, at 7:31 AM, Wilhelm Caspary wrote: Hi, I have been looking through all packages but I cannot find a routine for LAD-regression (L1-norm-regression). Is there none? (In addition to the pkg::sos search results the help archives can also be reviewed.) http://search.r-proj

Re: [R] .Library in R 2.12.2 for windows

2011-03-11 Thread Oxxx
Thanks so much for the help! Sorry about not finding that info in the help. I must have overlooked it. My apologies. -- View this message in context: http://r.789695.n4.nabble.com/Library-in-R-2-12-2-for-windows-tp3347351p3348218.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] Timezone issue with strftime/strptime and %z and %Z

2011-03-11 Thread David Winsemius
On Mar 11, 2011, at 8:54 AM, Daniel Nüst wrote: 2011/3/11 David Winsemius : On Mar 10, 2011, at 8:46 PM, David Winsemius wrote: On Mar 10, 2011, at 11:17 AM, Daniel Nüst wrote: I try to parse a time stamp with time zone. I essentially just want to parse the time stamp "1995-05-25T15:30:00+1

Re: [R] robust estimation

2011-03-11 Thread Bryan Hanson
Willi, try this: install.packages("sos") library("sos") findFn("L1 norm regression") I find 34 hits but you'd have to look them over to see if any of them are the sort of thing you want. HTH, Bryan Prof. Bryan Hanson Dept of Chemistry & Biochemistry DePauw University 602 S.

Re: [R] Selecting ranges of dates from a dataframe

2011-03-11 Thread David Winsemius
On Mar 11, 2011, at 8:41 AM, Benjamin Stier wrote: Hi Francisco, Thanks for your solution. It runs pretty fast compared to my for loop. Here is a comparison of system.time(): system.time(splitVals <- by(serv, dates, aggregateDf )) user system elapsed 1.129 0.218 1.348 system.time(

Re: [R] Timezone issue with strftime/strptime and %z and %Z

2011-03-11 Thread Daniel Nüst
2011/3/11 David Winsemius : > On Mar 10, 2011, at 8:46 PM, David Winsemius wrote: >> On Mar 10, 2011, at 11:17 AM, Daniel Nüst wrote: >>> I try to parse a time stamp with time zone. I essentially just want to >>> parse the time stamp "1995-05-25T15:30:00+10:00" and output it exactly >>> like it is,

[R] robust estimation

2011-03-11 Thread Wilhelm Caspary
Hi, I have been looking through all packages but I cannot find a routine for LAD-regression (L1-norm-regression). Is there none? Willi __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide h

Re: [R] Selecting ranges of dates from a dataframe

2011-03-11 Thread Benjamin Stier
Hi Francisco, Thanks for your solution. It runs pretty fast compared to my for loop. Here is a comparison of system.time(): system.time(splitVals <- by(serv, dates, aggregateDf )) user system elapsed 1.129 0.218 1.348 system.time(... my long for loop...) user system elapsed 276.

[R] dataframe to a timeseries object

2011-03-11 Thread Daniele Amberti
I’m wondering which is the most efficient (time, than memory usage) way to obtain a multivariate time series object from a data frame (the easiest data structure to get data from a database trough RODBC). I have a starting point using timeSeries or xts library (these libraries can handle time zo

Re: [R] No response after click the "show Rules" button on Tab "Associate".

2011-03-11 Thread Xiaobo Gu
On Fri, Mar 11, 2011 at 2:55 AM, Graham Williams wrote: > Did you scroll down the window to see the rules? OK, it takes a long time for rattle to show the rules, about 30 seconds, and why the message on the status bar is "the decision tree model has been built. Time taken:0.01 secs", I have attach

Re: [R] How to calculate means for multiple variables in samples with different sizes

2011-03-11 Thread Henrique Dallazuanna
Try this: aggregate(. ~ sample, x[-2], FUN = mean) On Fri, Mar 11, 2011 at 6:32 AM, Aline Santos wrote: > Hello R-helpers: > > I have data like this: > > samplereplicateheightweightage > A1.0012.00.646.00 > A2.0012.20.386.00 > A3.0012.4

[R] Using dates on axis in persp

2011-03-11 Thread Owe Jessen
Hi, I'm trying to plot the dates on the x-axis of a persp plot, but cannot find a way of doing so. This is where I am at: |x<- seq(-10, 10, length= 30) x0<- as.Date("2000-01-01") x.dates<- seq(x0,x0+length(x)-1,1) y<- x f<- function(x,y) { r<- sqrt(x^2+y^2); 10 * sin(r)/r} z<- oute

Re: [R] How to calculate means for multiple variables in samples with different sizes

2011-03-11 Thread Matthew Dowle
Hi, One liners in data.table are : > x.dt[,lapply(.SD,mean),by=sample] sample replicate heightweight age [1,] A 2.0 12.2 0.503 6.00 [2,] B 1.5 12.75000 0.715 4.50 [3,] C 2.5 11.35250 0.5125000 3.75 [4,] D 2.0 14.9

Re: [R] insertion of a row between individuals

2011-03-11 Thread Dennis Murphy
Hi: df <- read.table(textConnection(" VAR DATETIME CONC COVAR 1 NOV20.2510 group1 1 NOV20.5 20 group1 1 NOV21 5 group1 1 NOV22 1 group1 1 NOV23 0.1 group1 2 NOV20.2510

Re: [R] insertion of a row between individuals

2011-03-11 Thread Henrique Dallazuanna
Try this: newX <- rbind(unique(transform(x, TIME = 0, CONC = 0)), x) newX[order(newX$VAR),] On Fri, Mar 11, 2011 at 9:28 AM, wrote: > Can someone help with a fairly simple task? > I have a data set where I would like to insert a 0 time event between > individuals: > > what I have: > > VAR D

Re: [R] snp-chip table

2011-03-11 Thread David Winsemius
On Mar 10, 2011, at 3:58 PM, shai uliel wrote: Dear R helpers I have a table and i need to make new table table1: sire snp1 snp2 snp3 snp4 snp5 snp6 snp7 snp8 snp9 snp10 snp11 snp12 snp13 snp14 snp15 8877 -1 -1 -1 -1 0 0 -1 -1 -1 0 1 1 1 -1 -1 7765 1 1 1 0 0 0 -1 1 1 1 0 0 0

[R] insertion of a row between individuals

2011-03-11 Thread kyle . landskroner
Can someone help with a fairly simple task? I have a data set where I would like to insert a 0 time event between individuals: what I have: VAR DATETIME CONC COVAR 1 NOV20.2510 group1 1 NOV20.5 20 group1 1 NOV21 5 group1 1

Re: [R] still a problem remainingRE: Data lebals xylattice plot: RE: displaying label meeting condition (i.e. significant, i..e p value less than 005) in plot function

2011-03-11 Thread Umesh Rosyara
Thank you for helping me and this solved the problem Best Regards Umesh R _ From: foolish.andr...@gmail.com [mailto:foolish.andr...@gmail.com] On Behalf Of Felix Andrews Sent: Friday, March 11, 2011 4:05 AM To: Umesh Rosyara Cc: R mailing list; deepayan.sar...@r-project.o

Re: [R] Selecting ranges of dates from a dataframe

2011-03-11 Thread David Winsemius
On Mar 10, 2011, at 8:23 AM, Benjamin Stier wrote: Hello list! I have a data.frame which looks like this: serv datum op.read op.write read write 1 2011-01-29 10:00:00 00 0 0 2 2011-01-29 10:00:01 00 0 0 3 2011-01-29 10:00:02 0

Re: [R] tobit regression model

2011-03-11 Thread Jen
H Zeileis, This helped out a lot - thanks!! Jen -- View this message in context: http://r.789695.n4.nabble.com/tobit-regression-model-tp3345789p3347936.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] Ifs in formula

2011-03-11 Thread Dennis Murphy
Hi: Perhaps something like f1(x, y) * I(z > 0) + f2(x, y) * I(z <= 0) ?? HTH, Dennis On Fri, Mar 11, 2011 at 3:10 AM, Otto Kässi wrote: > Dear r-helpers, > > This might be an elementary question, but I have a hard time getting > my head around it, so all help is much appreciated. > > I a

Re: [R] How to get all combinations between two character vectors?

2011-03-11 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/11/2011 12:48 PM, Eik Vettorazzi wrote: > or even simpler > paste(rep(x,each=length(y)),y,sep="") I like that one - it makes perfect sense. I might wrap it into a function and use it. > > > Am 11.03.2011 12:44, schrieb Eik Vettorazzi: >> Hi R

Re: [R] Timezone issue with strftime/strptime and %z and %Z

2011-03-11 Thread David Winsemius
On Mar 10, 2011, at 8:46 PM, David Winsemius wrote: On Mar 10, 2011, at 11:17 AM, Daniel Nüst wrote: Hello! I've been trying to get this right for quite a while now and fear there is an easy solution I just don't see. I did not have this problem in Linux, and I searched r-help and Google bu

Re: [R] How to get all combinations between two character vectors?

2011-03-11 Thread Eik Vettorazzi
or even simpler paste(rep(x,each=length(y)),y,sep="") Am 11.03.2011 12:44, schrieb Eik Vettorazzi: > Hi Rainer, > I don't know a function for literally substituting "THEFUNCTION", but > x <- c("a", "b") > y <- c("x", "y") > sort(levels(interaction(x,y,sep=""))) > > or > > as.vector(t(outer(x,y,

Re: [R] How to get all combinations between two character vectors?

2011-03-11 Thread Eik Vettorazzi
Hi Rainer, I don't know a function for literally substituting "THEFUNCTION", but x <- c("a", "b") y <- c("x", "y") sort(levels(interaction(x,y,sep=""))) or as.vector(t(outer(x,y,paste,sep=""))) will work. "sort" and "t" respectively here are used to produce the desired order. hth. Am 11.03.201

[R] predicting values from model function

2011-03-11 Thread Anna Gretschel
Dear List, I have fitted a spherical function to my variogram using "variofit(...)" from GeoR. Now I would like to predict some data with the function "predict(object,...)" from package stats. Does anyone know wether this works and if it does how to do it? Thanks a lot! Anna ___

  1   2   >