Re: [R] playwith package does not work on Ubuntu?

2008-07-02 Thread Felix Andrews
Hi Ingo / Karl / Graham, I have now set up a GNU/Linux system (Ubuntu 8.04), and tracked down the problem. There were several problems stemming from the GTK+ event loop not running / updating continuously, and multiple-threads problems. A new version 0.9-0 should appear on CRAN soon (next few day

[R] randomForest.error: length of response must be the same as predictors

2008-07-02 Thread Soumyadeep Nandi
My data looks like: A,B,C,D,Class 1,2,0,2,cl1 1,5,1,9,cl1 3,2,1,2,cl2 7,2,1,2,cl2 2,2,1,2,cl2 1,2,1,5,cl2 0,2,1,2,cl2 4,2,1,2,cl2 3,5,1,2,cl2 3,2,12,3,cl2 3,2,4,2,cl2 **The steps followed are: trainfile <- read.csv("TrainFile",head=TRUE) datatrain <- subset(trainfile,select=c(-Class)) classtrain <

Re: [R] what can we do when R gives no response

2008-07-02 Thread Peng Jiang
Hi, Jim thanks for your reply, I tried the scripts it still does not give any response on my mac. I have to stop in manually. what is your sessionInfo ? Thanks again. On 2008-7-3, at 上午10:10, jim holtman wrote: I ran you script and it came back in less than 1 second: x <- rnbinom(100,

Re: [R] NLME questions -- interpretation of results

2008-07-02 Thread ctu
Hi Jenny, (I use the data you provide in the previous e-mail) For the 1st question, let me assume you only want to compare loc: A vs. B So you could specified your code like this: fmAB <- nlme(Y ~ SSlogis(X, Asym, R0, lrc),data = LAST, random = Asym ~1, fixed = Asym+R0+lrc

Re: [R] Plotting Prediction Surface with persp()

2008-07-02 Thread Duncan Murdoch
On 02/07/2008 8:47 PM, Rory Winston wrote: Hi all I have a question about correct usage of persp(). I have a simple neural net-based XOR example, as follows: library(nnet) xor.data <- data.frame(cbind(expand.grid(c(0,1),c(0,1)), c(0,1,1,0))) names(xor.data) <- c("x","y","o") xor.nn <- nnet(o ~

Re: [R] Processing 10^8 rows and 1^3 columns

2008-07-02 Thread Gabor Grothendieck
The sqldf package makes it easy to use DBI, RSQLite and sqlite to read a large file directly to an sqlite database without going through R and then read all or a portion of it into R using an arbitrary SQL statement. See example 6 on the home page: http://sqldf.googlecode.com On Wed, Jul 2, 2008

[R] Otpmial initial centroid in kmeans

2008-07-02 Thread Chua Siang Li
Helo there. I am using kmeans of base package to cluster my customers. As the results of kmeans is dependent on the initial centroid, may I know: 1) how can we specify the centroid in the R function? (I don't want random starting pt) 2) how to determine the optimal (if not, a good

[R] Processing 10^8 rows and 1^3 columns

2008-07-02 Thread Daren Tan
With smaller tab-limited files, I could load them using read.table and the likes. Now I have a gigantic 10^8 rows and 1^3 columns tab-limited file for processsing, please throw some ideas how to handle it. Thanks _ Publish your ph

[R] lm() question

2008-07-02 Thread Ranney, Steven
I have data that looks like YC Age Num 82 11 2 83 10 0 84 9 8 85 8 21 86 7 49 87 6 18 88 5 79 89 4 28 90 3 273 91 2 175 with a program mod1=lm(log(Num+1)~YC, data=box44) plot(lo

Re: [R] what can we do when R gives no response

2008-07-02 Thread jim holtman
I ran you script and it came back in less than 1 second: > x <- rnbinom(100, mu = 10, size = 10) > hdev <- function(par) { + -sum(dnbinom(x, mu = par[1], size = par[2], log = TRUE)) + } > nlminb(c(9, 12), hdev) $par [1] 9.760001 13.802305 $objective [1] 278.9434 $convergence [1] 0 $message

Re: [R] NLME questions -- interpretation of results

2008-07-02 Thread Jenny Sun
Thank you for your reply Chunhao! I attached only part of the test data and that is why you might not be able to get convergence. Sorry. I have a couple more questions: For the second question you answered, how to specify the correct length of starting values. I tried using the length of lev

Re: [R] problem with lm and predict - no predictions made

2008-07-02 Thread Jorge Ivan Velez
Dear Keld, See ?predict.lm and its examples. HTH, Jorge On Wed, Jul 2, 2008 at 9:40 PM, Keld Jørn Simonsen <[EMAIL PROTECTED]> wrote: > Hi > > I have a problem with lm and predict > > I have > > us > [1] 2789.53 3128.43 3255.03 3536.68 3933.18 4220.25 4462.83 4739.48 > [9] 5103.75

Re: [R] problem with lm and predict - no predictions made

2008-07-02 Thread Erik Iverson
Hello - Keld Jørn Simonsen wrote: Hi I have a problem with lm and predict I have us [1] 2789.53 3128.43 3255.03 3536.68 3933.18 4220.25 4462.83 4739.48 [9] 5103.75 5484.35 5803.08 5995.93 6337.75 6657.40 7072.23 7397.65 [17] 7816.83 8304.33 8746.98 9268.43 9816.98 1012

Re: [R] how to capture matching words in a string ?

2008-07-02 Thread Gabor Grothendieck
Try this and see the gsubfn home page for more info: http://gsubfn.googlecode.com > library(gsubfn) Loading required package: proto > > s <- "sID23423424 apple pID324234325 orange" > strapply(s, "ID[0-9]+")[[1]] [1] "ID23423424" "ID324234325" On Wed, Jul 2, 2008 at 9:33 PM, Daren Tan <[EMAIL PR

[R] problem with lm and predict - no predictions made

2008-07-02 Thread Keld Jørn Simonsen
Hi I have a problem with lm and predict I have us [1] 2789.53 3128.43 3255.03 3536.68 3933.18 4220.25 4462.83 4739.48 [9] 5103.75 5484.35 5803.08 5995.93 6337.75 6657.40 7072.23 7397.65 [17] 7816.83 8304.33 8746.98 9268.43 9816.98 10127.95 10469.60 10960.75 [25] 11685.93 1

Re: [R] How do I paste double quotes arround a character string?

2008-07-02 Thread Erik Iverson
Philip James Smith wrote: Hi R Community: I've got a character string that looks like: New Mexico What does this mean? I do not think I understand. Do you have a vector with one element (New Mexico) in it? I think we need a few more details, like what it is exactly you have (class of your

[R] how to capture matching words in a string ?

2008-07-02 Thread Daren Tan
I need to capture matching words in a string, any ideas ? I tried using gregexpr, but it was no help. In this example, I need to capture ID23423424 and ID324234325 > s <- "sID23423424 apple pID324234325 orange"> gregexpr("ID[0-9]+", s)[[1]][1] > 2 20attr(,"match.length")[1] 10 11 __

[R] How do I paste double quotes arround a character string?

2008-07-02 Thread Philip James Smith
Hi R Community: I've got a character string that looks like: New Mexico How to I create the new character string that looks like: "New Mexico" That is, it is the original string (New Mexico) with double quotes infront and behind it? Thanks, Phil Smith __

[R] Plotting Prediction Surface with persp()

2008-07-02 Thread Rory Winston
Hi all I have a question about correct usage of persp(). I have a simple neural net-based XOR example, as follows: library(nnet) xor.data <- data.frame(cbind(expand.grid(c(0,1),c(0,1)), c(0,1,1,0))) names(xor.data) <- c("x","y","o") xor.nn <- nnet(o ~ x + y, data=xor.data, linout=FALSE, size=1)

[R] what can we do when R gives no response

2008-07-02 Thread Peng Jiang
Hi, dear R experts , I am new. I met this problem when I am trying to learn how to use the nlminb() function. I tried the example which the document provides ( as the following code ) and R gives no response . I don't know whether it is running or not and it takes a very long time but

Re: [R] Migrating from S-Plus to R - Exporting Tables

2008-07-02 Thread jim holtman
Does something like this get you close: x <- list() keys <- LETTERS[1:6] # create for (i in keys){ x[[i]] <- data.frame(a=1:5, b=1:5, c=1:5) } # output output <- file('tempxx.txt', 'w') for (i in keys){ write.table(i, row.names=FALSE, col.names=FALSE, file=output, quote=FALSE) write.ta

Re: [R] A regression problem using dummy variables

2008-07-02 Thread rlearner309
I think it is zero, because you have lots of zeros there. It is not like continous variables. Thomas Lumley wrote: > > On Wed, 2 Jul 2008, rlearner309 wrote: > >> >> I think the covariance between dummy variables or between dummy variables >> and >> intercept should always be zero. meaning:

[R] Removing or overwriting an XML node

2008-07-02 Thread Steffen Neumann
Hi, I have an existing XML document on disk, which I'd like to use as a template, and exchange a subnode with my own newly created subtree: Duncan Temple Lang created by e.g.  library(XML) tr <- xmlTree("Du

[R] neural networks

2008-07-02 Thread Donna Tucker
Hello all, I am trying to use the neuralnet function from the neural package to train neural networks. I am finishing my thesis over statistical learning in which I am comparring the MSE values for various algorithms with random data sets, so I do not have a specific application. I have two i

Re: [R] plot.zoo labels

2008-07-02 Thread Gabor Grothendieck
xlab = "" and ylab = "" suppress the labels but that won't change the margins. For that you need to set mar= . If z is a zoo object: plot(z, xlab = "", ylab = "", mar=...) See ?par for description of mar. On Wed, Jul 2, 2008 at 12:59 PM, <[EMAIL PROTECTED]> wrote: > Thank you for your time

Re: [R] auto.key in xyplot in conjunction with panel.text

2008-07-02 Thread Deepayan Sarkar
On 7/2/08, David Afshartous <[EMAIL PROTECTED]> wrote: > > > All, > > I can't seem to get auto.key to work properly in an xyplot that is employing > panel.text. Specifically, I often change the default grouping colors then > use auto.key accordingly, but for some reason the same functionality

Re: [R] NLME questions -- interpretation of results

2008-07-02 Thread ctu
Hi Jenny, I try your code but I did not get in converge in fm3 (see the below). For the first question, you could use fm1 to interpret the result without bothering fm2 and fm3. It means that R0 and lrc can be treated as pure fixed effects (Pinherir and Bates, 2000 Book). For the second quest

Re: [R] flow map lines between point pairs (latitude/longitude)

2008-07-02 Thread Richard and Barbara Males
made my day, thanks, worked just fine with a little bit of tweaking (flipping x and y around, basically). rapid response much appreciated Dick On Wed, Jul 2, 2008 at 5:25 PM, Ray Brownrigg <[EMAIL PROTECTED]> wrote: > Here's one solution, YMMV: > library(maps) > # Note, plot the map first to get

Re: [R] help on list comparison

2008-07-02 Thread Jorge Ivan Velez
Dear Ramya, Try # Gene list with 3 genes genelist=list(gene1=rnorm(100),gene2=rnorm(100),gene3=rnorm(100)) genelist # Map file with 50 genes mapfile=data.frame(gene=paste("gene",1:50,sep=""),coordinate=runif(50,6180,6300)) mapfile # Genes in genelist (names) NAMES=names(genelist) NAMES

Re: [R] flow map lines between point pairs (latitude/longitude)

2008-07-02 Thread Ray Brownrigg
Here's one solution, YMMV: library(maps) # Note, plot the map first to get the aspect ratio (or projection) right map("county", xlim=range(df2VisitTrips[, c(5, 7)]), ylim=range(df2VisitTrips[, c(4, 6)]), col=8) map("state", add=T) map.axes() for (i in 1:length(df2VisitTrips[, 1])) { lines(df2Vi

Re: [R] Accessing a field in a data fram

2008-07-02 Thread jim holtman
?"[[" decision <- "one" raw[[decision]] On Wed, Jul 2, 2008 at 3:10 PM, R_Learner <[EMAIL PROTECTED]> wrote: > > raw <- read.csv(file=filename, head=TRUE,sep=",") > > I've read in a csv file, and I'm looking to access a column whose name is > held in a string. > > For example, I want to access ra

Re: [R] Insert text in data.frame

2008-07-02 Thread jim holtman
Try this: x <- read.table(textConnection("Conc Lat LonDepth Point 56.25-5.65 70 Point0001 56.55-5.35 85 Point0002 56.25-5.65 65 Point0003 56.37-5.21 80 Point0004 56.45-5.23 30 Point 56.25-5.55 75

Re: [R] Reading CSV file with unequal record length

2008-07-02 Thread Marc Schwartz
on 07/02/2008 01:55 PM Viswanathan Shankar wrote: Hello , I am having some difficulty reading a CSV file of unequal record length in R . The data has 26 columns and do not have header and is generated from a R syntax - write.table(schat,"schat.csv", sep=",", col.names=FALSE, append = TRUE)

Re: [R] multiplication question

2008-07-02 Thread Kenn Konstabel
for example ... x <- 1:5 ; y<- 6:8 (m <- x %o% y) # is this what you mean by product of two vectors? sum(m[row(m)!=col(m)]) # or ... sum(m)-sum(diag(m)) On Wed, Jul 2, 2008 at 7:30 PM, Murali Menon <[EMAIL PROTECTED]> wrote: > > folks, > > is there a clever way to compute the sum of the produ

[R] set values in data.frame to NA conditional on another data.frame

2008-07-02 Thread Carson Farmer
Hello List, Is there a faster way to set values in one data.frame equal to NA conditional on the corresponding value in another data.frame? Currently I am using: > b[is.na(a)] <- NA where 'a' and 'b' are data.frames of equal size/dimensions, and 'a' contains NAs but 'b' does not. This is extr

Re: [R] multiplication question

2008-07-02 Thread Henrique Dallazuanna
I'm sorry: sum(v1 %o% v2 - diag(v1*v2)) On Wed, Jul 2, 2008 at 6:03 PM, Henrique Dallazuanna <[EMAIL PROTECTED]> wrote: > Try something about like this: > > v1 %o% v2 - diag(v1*v2) > > On Wed, Jul 2, 2008 at 1:30 PM, Murali Menon <[EMAIL PROTECTED]> wrote: > >> >> folks, >> >> is there a clever

Re: [R] Accessing a field in a data fram

2008-07-02 Thread Marc Schwartz
on 07/02/2008 02:10 PM R_Learner wrote: raw <- read.csv(file=filename, head=TRUE,sep=",") I've read in a csv file, and I'm looking to access a column whose name is held in a string. For example, I want to access raw$one or raw$two, but this will depending on the string. Let's say that the stri

Re: [R] Reading CSV file with unequal record length

2008-07-02 Thread Peter Dalgaard
Viswanathan Shankar wrote: Hello , I am having some difficulty reading a CSV file of unequal record length in R . The data has 26 columns and do not have header and is generated from a R syntax - write.table(schat,"schat.csv", sep=",", col.names=FALSE, append = TRUE) 1.0,1.0,0.0,0.1,0.1,0.1

Re: [R] multiplication question

2008-07-02 Thread N. Lapidus
Hi Murali, Just an idea, probably not the best : x<-1:4 y<-1:6 z<-matrix(1:(length(x)*length(y)),nrow=length(x)) I <- matrix(1,nrow=length(x),ncol=length(y)) I[row(I)==col(I)] <- 0 sum (outer (x, y, '*') * I) sum (outer (x, y, '*') * z * I) Hope this helps, Nael On Wed, Jul 2, 2008 at 6:3

Re: [R] conversion of data for use within barchart

2008-07-02 Thread Deepayan Sarkar
On 7/2/08, Karin Lagesen <[EMAIL PROTECTED]> wrote: > > > I have a data matrix like this: > > > > data[1:10,] >aaname grp cluster count > 1 Ala All Singleton 432 > 2 Arg All Singleton 1239 > 3 Asn All Singleton 396 > 4 Asp All Singleton 152 > 5 Cys All Single

[R] NLME questions -- interpretation of results

2008-07-02 Thread Jenny Sun
My special thanks to Chunhao Tu for the suggestions about testing significance of two locations. I used logistic models to describe relationships between Y and X at two locations (A & B). And within each location, I have four groups (N,E,S,W)representing directions. So the test data can be arra

Re: [R] multiplication question

2008-07-02 Thread Henrique Dallazuanna
Try something about like this: v1 %o% v2 - diag(v1*v2) On Wed, Jul 2, 2008 at 1:30 PM, Murali Menon <[EMAIL PROTECTED]> wrote: > > folks, > > is there a clever way to compute the sum of the product of two vectors such > that the common indices are not multiplied together? > > i.e. if i have vect

[R] Accessing a field in a data fram

2008-07-02 Thread R_Learner
raw <- read.csv(file=filename, head=TRUE,sep=",") I've read in a csv file, and I'm looking to access a column whose name is held in a string. For example, I want to access raw$one or raw$two, but this will depending on the string. Let's say that the string is decision<-"one". How would I access

Re: [R] multiplication question

2008-07-02 Thread Peter Alspach
Murali I don't know about 'clever', but does this do what you want? v1 <- 1:3 v2 <- 4:6 sum(matrix(rep(v1, length(v1)), nrow=length(v1))%*%v2)-sum(v1*v2) Peter Alspach > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Murali Menon > Sent: Thursda

[R] question on dispersion parameter

2008-07-02 Thread jpl
Hi, I'm programming in R and below is a summary of a generalized linear model: ** *** Call: glm(formula = offspring ~ degdays, family = quasi(link = "log", variance = "mu"), data = fecundity) Deviance Residuals: Min 1Q Median 3Q Max -0.76674 -0.291

Re: [R] plot.zoo labels

2008-07-02 Thread ryan . sheftel
Thank you for your time to help. I don't think I was completely clear, I want to keep the axis ticks and labels (which I now see is what R calls the values like "Jan, Feb, Mar") but want to suppress the label titles. So a generic plot(thisZoo) would produce a plot whose X axis is the dates, tic

Re: [R] Plotting Bi-Gamma Distribution

2008-07-02 Thread Wolfgang Raffelsberger
Hi, you can try the 'mixdist' package which allows fitting of multiple (superposed) distributions to your vector of data. The package is available on http://www.math.mcmaster.ca/peter/mix/mix.html Unfortunately this package doesn't support combination of normal with gamma etc..., but it could

[R] Reading CSV file with unequal record length

2008-07-02 Thread Viswanathan Shankar
Hello , I am having some difficulty reading a CSV file of unequal record length in R . The data has 26 columns and do not have header and is generated from a R syntax - write.table(schat,"schat.csv", sep=",", col.names=FALSE, append = TRUE) 1.0,1.0,0.0,0.1,0.1,0.1,0.2,0.2,0.3,0.3,0.4,0.4,0.5

[R] multiplication question

2008-07-02 Thread Murali Menon
folks, is there a clever way to compute the sum of the product of two vectors such that the common indices are not multiplied together? i.e. if i have vectors X, Y, how can i compute Sum (X[i] * Y[j]) i != j where i != j also, what if i wanted Sum (X[i] * Y[j] * R[i, j]) i != j w

[R] Usage of rJava (.jcall) with Weka functions, any example?

2008-07-02 Thread Josep Maria Campanera Alsina
Dear All, I'd like to use Weka functions that are not implemented (do not have interface) in RWeka, like the Remove function and others in the future! The .java() functionality is for that purpose but I haven't seen any example with Weka functions. Could anyone give me hand in how to do it? For i

[R] Extracting regression coef. and p-values in JRClient

2008-07-02 Thread Amine Mohamed ROUANE HACENE
Hi there, I am using JRClient to build logistic regression model in the following manner : Rconnection c = new Rconnection(); c.eval("KSN<-read.table(\"/Users/amine/Documents/Research/ Tools/R/D2R1.txt\",header=T,sep=\",\")"); c.eval("result <- glm(Nausea ~ Kaletra*S

[R] Extracting regression coef. and p-values in JRClient

2008-07-02 Thread Amine Mohamed ROUANE HACENE
Hi there, I am using JRClient to build logistic regression model in the following manner : Rconnection c = new Rconnection(); c.eval("KSN<-read.table(\"/Users/amine/Documents/Research/ Tools/R/D2R1.txt\",header=T,sep=\",\")"); c.eval("result <- glm(Nausea ~ Kaletra*Su

[R] Insert text in data.frame

2008-07-02 Thread Mafalda Viana
Dear R-helper, I wonder if anyone can help me. I am trying to convert a dataset to a format recognizable by a software onboard a research vessel but I am having problems with some steps. I have a data frame as follows: Conc Lat LonDepth Point 56.25-5.65

Re: [R] heatmap

2008-07-02 Thread Nair, Murlidharan T
I tried the following myself and I almost have something to work with. But I still need a little input. #Plots a filled contour # Can someone help me in increasing the resolution as my data range is 0-11? Also I need to put the row and column names on the axes. x <- 1:nrow(data) y <- 1:ncol(data

Re: [R] exporting ftable

2008-07-02 Thread Henrique Dallazuanna
See ?write.ftable On Wed, Jul 2, 2008 at 4:56 PM, Leandro Marino <[EMAIL PROTECTED]> wrote: > > > How can I export an ftable object in the same format that appears in R > command window? > For testing that i was using this example that is in help of this function. > > > ## Start with a continge

Re: [R] help appreciated to make a plot

2008-07-02 Thread Gabor Grothendieck
Check out gap.plot in the plotrix package. On Wed, Jul 2, 2008 at 2:49 PM, Zheng Lu <[EMAIL PROTECTED]> wrote: > > > Dear All: > > I have the following data: > >0 100 > 0.5 79.9605 >0.75

Re: [R] Sunset in Dortmund

2008-07-02 Thread Marc Schwartz
on 07/02/2008 02:37 PM Johannes Huesing wrote: Marc Schwartz <[EMAIL PROTECTED]> [Wed, Jul 02, 2008 at 06:22:40PM CEST]: For those attending useR! 2008 next month, something to look forward to: http://www.gnome-look.org/content/show.php/show.php?content=84455 THIS is a sunset over Dortmund:

Re: [R] Problem with strucchange package

2008-07-02 Thread Achim Zeileis
On Wed, 2 Jul 2008, [EMAIL PROTECTED] wrote: Dear R Users, I am attempting to use the strucchange package but get an error which is difficult to decipher. I get the following error with breakpoints: bp<-breakpoints(regr[,1]~regr[,2]+regr[,3]) Error in my.RSS.table[as.character(i), 3:4] <- c

[R] exporting ftable

2008-07-02 Thread Leandro Marino
How can I export an ftable object in the same format that appears in R command window? For testing that i was using this example that is in help of this function. ## Start with a contingency table. ftable(Titanic, row.vars = 1:3) ftable(Titanic, row.vars = 1:2, col.vars = "Survived") ftable(

Re: [R] Sunset in Dortmund

2008-07-02 Thread Johannes Huesing
Marc Schwartz <[EMAIL PROTECTED]> [Wed, Jul 02, 2008 at 06:22:40PM CEST]: > For those attending useR! 2008 next month, something to look forward to: > > http://www.gnome-look.org/content/show.php/show.php?content=84455 THIS is a sunset over Dortmund: http://www.23hq.com/mBusolt/photo/2230816 D

Re: [R] Multiple time series plots

2008-07-02 Thread Gabor Grothendieck
Incompatability? zoo can work with any date/time class that supports certain methods and such methods have specifically been written for fCalendar's timeDate class. In fact there is a section in vignette("zoo") on the timeDate class. Also we can readily convert between fSeries' timeSeries class

[R] graph woes

2008-07-02 Thread Patrick Jackson
Hey Gang, Here is the situation. First of all I am a newbie, in the arena of R, so please bare with me. I am trying to make a plot with a series of plot lines that uses logs on the x axis, and when I plot it I am having a few odd things go on that I do not know how to correct. 1. the tick mark

[R] Goodness of fit test

2008-07-02 Thread martin . gaston
Dear R users, I have some data sets and I'd want to test if they are genarated under different probability functions. That is, some of them by gamma distribution, exponential one etc. Could anybody propose me any test (or procedure) to see that. I search something similar to the normality tests.

[R] flow map lines between point pairs (latitude/longitude)

2008-07-02 Thread Richard and Barbara Males
I have a dataset giving traffic between pairs of ports, and the lat/lon of each port, roughly as follows: sample data as follows > df2VisitTrips[1:4,] Origin Destination NumberOfTrips OriginLatitude OriginLongitude DestinationLatitude DestinationLongitude 1 P1 P16 1

[R] help appreciated to make a plot

2008-07-02 Thread Zheng Lu
Dear All: I have the following data: 0 100 0.5 79.9605 0.75 84.7098 1.5 72.1793 2.5 97.4924 4.5

[R] heatmap

2008-07-02 Thread Nair, Murlidharan T
I am interested in plotting a matrix of data using heatmap to reflect frequency of positional occurrence of certain strings. I am not interested in clustering them. I also want to make a key for the colors.Can someone help me with that. I am appending a portion of my data here. Thanks ../Murli

[R] Problem with strucchange package

2008-07-02 Thread tolga . i . uzuner
Dear R Users, I am attempting to use the strucchange package but get an error which is difficult to decipher. I get the following error with breakpoints: > bp<-breakpoints(regr[,1]~regr[,2]+regr[,3]) Error in my.RSS.table[as.character(i), 3:4] <- c(pot.index[opt], break.RSS[opt]) : nothing

Re: [R] Multiple time series plots

2008-07-02 Thread Kerpel, John
Stephen: That works great - thanks! I have to admit it gets a little frustrating having to switch back and forth between packages because of cross-package incompatibility, but hey, more functionality = good. Best, john From: stephen sefick [mailto:

Re: [R] how do I read only specific columns using read.csv or other read function

2008-07-02 Thread Charles C. Berry
On Wed, 2 Jul 2008, Ben Tupper wrote: On Jul 2, 2008, at 6:53 AM, Philip James Smith wrote: Hi R people: I have huge files with as many as 5000 columns. I'd really like to read only certain columns of those files. I know column names I want to read. I looked at the documentation of read.c

Re: [R] Multiple time series plots

2008-07-02 Thread stephen sefick
have you tried package(zoo) it works very well and should do what you want On Wed, Jul 2, 2008 at 10:54 AM, Kerpel, John <[EMAIL PROTECTED]> wrote: > Hi all: > > > > I'm trying to plot two time series created in Rmetrics and label the > x-axis with dates. I tried the following: > > > > dates <-

[R] error on predict

2008-07-02 Thread Michele Santacatterina
Hi, i have this glm: shuttle.glm.test <- glm(cbind(r,m-r)~temperature,family=binomial,data=shuttle) and when i try to find a probability of var r (with temperature=31 and pressure=200): predict(shuttle.glm.test,data.frame(temperatura=31,pressure=200),type="response",se=T) i have this error: W

Re: [R] Problem reading from a data frame

2008-07-02 Thread Marc Schwartz
Not likely the factor issue: x <- factor(c("MT2342","MT0982","MT2874")) > x [1] MT2342 MT0982 MT2874 Levels: MT0982 MT2342 MT2874 > gsub("[^0-9]", "", x) [1] "2342" "0982" "2874" gsub() and friends coerce to character internally already: > gsub function (pattern, replacement, x, igno

Re: [R] Hmisc latex function with longtable option

2008-07-02 Thread Frank E Harrell Jr
Erik Iverson wrote: Hello - I'm trying to use Hmisc's latex function to produce a postscript file of a data.frame, using the longtable = TRUE option. When I run, for example, ## sample R code dvips(latex(data.frame(a = rnorm(100), b = rnorm(100)), longtable = TRUE), file = "test.

Re: [R] get formatted regression output

2008-07-02 Thread Abhijit Dasgupta
library(Hmisc) has latex and html functions to convert the output into latex (then to pdf, if you wish), and into html. A useful link for this is http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/SweaveConvert Bunny, lautloscrew.com wrote: Hi everybody, I have a simple regression summary

[R] auto.key in xyplot in conjunction with panel.text

2008-07-02 Thread David Afshartous
All, I can't seem to get auto.key to work properly in an xyplot that is employing panel.text. Specifically, I often change the default grouping colors then use auto.key accordingly, but for some reason the same functionality isn't working for this different type of plot. Any help much apprecia

[R] Sunset in Dortmund

2008-07-02 Thread Marc Schwartz
For those attending useR! 2008 next month, something to look forward to: http://www.gnome-look.org/content/show.php/show.php?content=84455 :-) Cheers, Marc Schwartz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Problem reading from a data frame

2008-07-02 Thread jim holtman
Seems to work fine for me: > x <- c("MT2342","MT0982","MT2874") > gsub("[^0-9]", "", x) [1] "2342" "0982" "2874" > You might have 'factors' so you should use as.character to convert to character strings: gsub('[^0-9]','',as.character(PthwyGenes)) On Wed, Jul 2, 2008 at 10:24 AM, <[EMAI

Re: [R] Optimal lag selection in Granger Causality tests

2008-07-02 Thread tolga . i . uzuner
Hmm, I guess one selects the lag that minimizes AIC, which appears to be what selection is returning. That's great, many thanks Matt. Tolga Matthieu Stigler <[EMAIL PROTECTED]> 02/07/2008 14:12 To [EMAIL PROTECTED], r-help@r-project.org cc [EMAIL PROTECTED] Subject Re: [R] Optimal lag sel

[R] help on list comparison

2008-07-02 Thread Rajasekaramya
hi I want to compare two list by its names and get the values of that list. can anybody let me know the syntax of comparing the list by their names using a for loop c.genes<- list() for(i in 1:100) c.genes[[1]]<- geneset(which(geneset == tobecampared[i])) } here geneset is a list and also to

[R] get formatted regression output

2008-07-02 Thread Bunny, lautloscrew.com
Hi everybody, I have a simple regression summary created by summary.lm and I wonder how i can export it to another file format which can be used on the web. .pdf would be possible, a html table would be nicer than your momma on your birthday. any suggestions ? thx so much in advance matth

[R] Hmisc latex function with longtable option

2008-07-02 Thread Erik Iverson
Hello - I'm trying to use Hmisc's latex function to produce a postscript file of a data.frame, using the longtable = TRUE option. When I run, for example, ## sample R code dvips(latex(data.frame(a = rnorm(100), b = rnorm(100)), longtable = TRUE), file = "test.ps") latex runs succ

Re: [R] passing a variable at the command line

2008-07-02 Thread Luke Tierney
commandArgs may do what you want. Best, luke On Tue, 1 Jul 2008, Erin Hodgess wrote: Dear R People: I have used ./R --no-save -q -f e.in >stuff.out with great success on SUSE10.1 with R-2.7.1. My question is, please: is there a way to pass in a variable to the e.in file? I'm fairly sure

[R] log plots woes

2008-07-02 Thread Patrick Jackson
Hey Gang, Here is the situation. First of all I am a newbie, in the arena of R, so please bare with me. I am trying to make a plot with a series of plot lines that uses logs on the x axis, and when I plot it I am having a few odd things go on that I do not know how to correct. 1. the tick mark

Re: [R] Zoo plotting behavior

2008-07-02 Thread Gabor Grothendieck
I can't tell what you are doing from that description. See last line to every message to r-help. It should be possible to copy your code and just paste it into a running R session and see the problem If there is interaction give detailed descriptions. On Wed, Jul 2, 2008 at 10:42 AM, stephen sef

[R] Multiple time series plots

2008-07-02 Thread Kerpel, John
Hi all: I'm trying to plot two time series created in Rmetrics and label the x-axis with dates. I tried the following: dates <- as.Date(seriesPositions(x.agg)) r <- as.Date(range(dates)) ts.plot([EMAIL PROTECTED],c(1,5)],gpars=list(ylab="Volume", lty=c(1:2),xaxt="n",main="Plot of V

[R] Tobit Estimation with Panel Data

2008-07-02 Thread Arne Henningsen
Hi all! Do you know if there is any R function/package that can be used to estimate "tobit" models with panel data (e.g. with random individual effects)? In economics, a "tobit" model is a model with a dependent variable that is left-censored at zero. Hence, it is a special case of a survival

Re: [R] variable as part of file name

2008-07-02 Thread Hans-Jörg Bibiko
On 02.07.2008, at 15:31, Laura Poggio wrote: Dear all, sorry for this very basic question, but I did not find any good example yet. I would like to set up a variable that can be recall later to substitute a part of a file name. As example: var_filename = as.name("aaa") jpeg("var_filena

Re: [R] Zoo plotting behavior

2008-07-02 Thread Gabor Grothendieck
With that format you will need a custom function based on chron and sub as you were doing at the beginning. On Wed, Jul 2, 2008 at 9:53 AM, stephen sefick <[EMAIL PROTECTED]> wrote: > one other thing- should I read the data in with the argument FUN=as.chron > ? if this is the case how do I tell

Re: [R] Zoo plotting behavior

2008-07-02 Thread stephen sefick
sorry, I am still trying to figure R out. window worked just fine with chron, but when I use d <- locator() as.chron(d) it returns results that are not consistent with the plot do I need to put in the format argument. I am still trying to figure out these date time classes. On Wed, Jul 2, 200

Re: [R] A regression problem using dummy variables

2008-07-02 Thread Thomas Lumley
On Wed, 2 Jul 2008, rlearner309 wrote: I think the covariance between dummy variables or between dummy variables and intercept should always be zero. meaning: no sigularity problem?? No. You can easily check that this is not true using the cov() function. Indicator variables for mutually

Re: [R] Problem reading from a data frame

2008-07-02 Thread Jorge Ivan Velez
Dear Nina, Is this what you want? x=c("MT2342","MT0982","MT2874") substr(x,3,nchar(x)) HTH, Jorge On Wed, Jul 2, 2008 at 10:24 AM, <[EMAIL PROTECTED]> wrote: > Hi, > > I have a data frame with strings that have two letters and four numbers. > When I > store a whole row as a new vector and t

Re: [R] Zoo plotting behavior

2008-07-02 Thread Gabor Grothendieck
Same with 1.5-3 > methods(window) [1] window.default* window.ts* window.zoo* Non-visible functions are asterisked > packageDescription("zoo")$Version [1] "1.5-3" > R.version.string [1] "R version 2.7.1 RC (2008-06-16 r45949)" On Wed, Jul 2, 2008 at 10:31 AM, Gabor Grothendieck <[EMAIL P

Re: [R] Zoo plotting behavior

2008-07-02 Thread Gabor Grothendieck
Seems to be there: > library(zoo) > methods(window) [1] window.default* window.ts* window.zoo* Non-visible functions are asterisked > packageDescription("zoo")$Version [1] "1.5-2" On Wed, Jul 2, 2008 at 10:08 AM, stephen sefick <[EMAIL PROTECTED]> wrote: > R 2.7.1 windows xp and versio

Re: [R] Zoo plotting behavior

2008-07-02 Thread stephen sefick
R 2.7.1 windows xp and version of zoo upgraded with new installation of R 2.7.1 yesterday from CA1 mirror window.zoo is not there? On Wed, Jul 2, 2008 at 10:00 AM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > ?plot.zoo and the zoo faq vignette have examples of custom axes. > In the case of chr

Re: [R] Odp: FW: RES: bug in axis.Date? was (Re: newbie needs help plottingtimeseries)

2008-07-02 Thread Kathi
Thanks, Petr, for all your help! I haven't called chron package explicitely, so I don't think it's from chron package. Although I have to admit that I don't know. I think I'm starting to understand the problem: When I start my plot using plot(x, y, axes=FALSE, ylim=c(405,410),col="red",...)

[R] Problem reading from a data frame

2008-07-02 Thread naw3
Hi, I have a data frame with strings that have two letters and four numbers. When I store a whole row as a new vector and try to remove the preceding letters using the gsub command, it returns characters of single numbers that have no relation to the numbers in each string. I also noticed that whe

[R] Migrating from S-Plus to R - Exporting Tables

2008-07-02 Thread Leandro Marino
Hi, I want to export an table using the write.table and i want is this format: (this table was exported in s-plus) Q01 row.names Num Percmeabstdev min P5 P10 P25 P50 P75 P90 P95 max A 10237 47.88 183.48 38.84 86.98 126.52

Re: [R] Zoo plotting behavior

2008-07-02 Thread stephen sefick
one other thing- should I read the data in with the argument FUN=as.chron ? if this is the case how do I tell chron that the data is not in -mm-dd HH:MM:SS but in the format m/d/y HH:MM:SS ? thanks stephen On Wed, Jul 2, 2008 at 9:32 AM, stephen sefick <[EMAIL PROTECTED]> wrote: > Like for

Re: [R] Zoo plotting behavior

2008-07-02 Thread Gabor Grothendieck
?plot.zoo and the zoo faq vignette have examples of custom axes. In the case of chron, the axes are done by chron:::axis.times in the chron package. On Wed, Jul 2, 2008 at 9:32 AM, stephen sefick <[EMAIL PROTECTED]> wrote: > Like for instance that the xlim is small enough where the plot is showing

Re: [R] A regression problem using dummy variables

2008-07-02 Thread rlearner309
I think the covariance between dummy variables or between dummy variables and intercept should always be zero. meaning: no sigularity problem?? rlearner309 wrote: > > This is actually more like a Statistics problem: > I have a dataset with two dummy variables controlling three levels. The >

  1   2   >