Re: [R] Print several xyplots to the same page in a pdf file

2009-10-29 Thread Deepayan Sarkar
2009/10/27 Joel Fürstenberg-Hägg : > > Hello everybody, > > I'm using the lattice package and the xyplot to make several graphs like > below. However, I can just print the three grouped plots onto one page as I'm > putting them into a pdf-file, which gives me a huge amount of pages... Is it > po

Re: [R] PDF too large, PNG bad quality

2009-10-29 Thread Deepayan Sarkar
On Fri, Oct 23, 2009 at 1:54 AM, Jim Lemon wrote: > On 10/23/2009 06:07 AM, Lasse Kliemann wrote: >> >> I wish to save a scatter plot comprising approx. 2 million points >> in order to include it in a LaTeX document. >> >> Using 'pdf(...)' produces a file of size about 20 MB, which is >> useless.

Re: [R] FW: making a plot in xyplot

2009-10-29 Thread Deepayan Sarkar
On Mon, Oct 26, 2009 at 12:19 PM, Ordaz, Sarah wrote: > Hi, > I'd like to clarify my previous posting.  See below - my updates are noted > with *s > Thanks, > Sarah Ordaz > ord...@upmc.edu > > Hello, > > I am a newbie to the lattice package in R, and I'm trying to make a plot > using the xyplot

Re: [R] fast cumulative matrix multiplication

2009-10-29 Thread Albyn Jones
If the matrices are not all the same size, then the order of computation will make a difference. simple example: A is 1xn, B is nx1, C is 1xn. A(BC) takes n^3 multiplies, while (AB)C requires 2n. albyn Quoting Todd Schneider : Hi all, I am looking for a function like cumprod() that work

Re: [R] Exclude rows in xyplot

2009-10-29 Thread Deepayan Sarkar
On Tue, Oct 27, 2009 at 12:07 PM, Dieter Menne wrote: > > > > Joel Fürstenberg-Hägg wrote: >> >> >> >> Now I'm trying to make xyplots to compare the result from three different >> categories: >> >> # Plot Pro against Glc for each of the three categories >> xyplot(Pro ~ Glc | Categories_BBCH_I

Re: [R] Re ading and Creating Shape Files

2009-10-29 Thread Nikhil Kaza
Have you tried readShapePoints writePointsShape both in maptools. Also, I don't think you really need a proj4string specified unless you are actually doing some spatial operations such as buffers and distances. I take it that you have already considered and discarded the possibility of

[R] how to test for stationarity in time series?

2009-10-29 Thread Luna Laurent
Hi all, Could anybody tell me how to test for stationarity in time series? Thanks a lot! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide ht

Re: [R] ggplot2: Histogram with negative values on x-axis doesn't work

2009-10-29 Thread hadley wickham
> I can reproduce it with for example > x=c(-9.23, -9.56, -1.40) > > But adding a single positive number, even .001, fixes it, while > adding a similar negative number introduces a new error message, so it > really looks like a bug in ggplot2 when all the values are negative. > > Report it to t

Re: [R] Trouble retrieving data (.xls) from folder on my computer.

2009-10-29 Thread Gabor Grothendieck
Check out the relevant HOWTO here: http://code.google.com/p/batchfiles/#HOWTO On Thu, Oct 29, 2009 at 5:06 PM, tobiasfa wrote: > > How do i make sure perl is in my PATH, and if its not how do i put it there? > > > > Either make sure that perl is on your PATH or if the path/filename you > specifie

Re: [R] Removing & generating data by category

2009-10-29 Thread Steven Kang
> > Color me puzzled. Can you express the run more clearly in Boolean logic? > > Its a bit tedious to explain in Boolean logic.. Suppose the data is subsetted according to two distinct 'clm' variables (i.e 1 set consisting of only "General" & other only of "Life") * General.dat* * * id loc

Re: [R] Trouble retrieving data (.xls) from folder on my computer.

2009-10-29 Thread tobiasfa
How do i make sure perl is in my PATH, and if its not how do i put it there? Either make sure that perl is on your PATH or if the path/filename you specified is correct then try with backslashes just in case: "C:\\perl\\bin\\perl.exe" Also check the upper/lower case of each component of your

Re: [R] Summing identical IDs

2009-10-29 Thread PDXRugger
Terrific help thank you. dupbuild<-aggregate(DF$Acres, list(Bldgid), sum) This line worked best. Now im going to challenge everyone (i think?) Consider the following: Acres<-c(100,101,100,130,156,.5,293,300,.09,100,12.5) Bldgid<-c(1,2,3,4,5,5,6,7,7,8,8) Year<-c(1946,1952,1922,1910,1955,1955,

Re: [R] Temperature Prediction Model

2009-10-29 Thread Aneeta
Thank you Clint for your response. I am happy to know that you have gotten interested in this analysis.:-) Let me give you some details about sensor networks that would help you understand my goal better. Sensor nodes run on small batteries which have limited life. So communication amongst variou

Re: [R] Summing identical IDs

2009-10-29 Thread Jorge Ivan Velez
Hi JR, Try also with(DF, tapply(Acres, Bldgid, sum) ) HTH, Jorge On Thu, Oct 29, 2009 at 3:03 PM, PDXRugger <> wrote: > > Hello All, > I would like to select records with identical IDs then sum an attribute > then and return them to the data frame as a single record. Please consider > > >

Re: [R] Fast optimizer

2009-10-29 Thread Ravi Varadhan
This optimization should not take you 1-2 mins. My guess is that your coding of the likelihood is inefficient, perhaps containing for loops. Would you mind sharing your code with us? As far as incorporating inequality constraints, there are at least 4 approaches: 1. You could use `constrOpt

Re: [R] Removing & generating data by category

2009-10-29 Thread David Winsemius
Color me puzzled. Can you express the run more clearly in Boolean logic? If someone has five policies: 3 Life and 2 General ... is he in or out? Applying the alternate strategy to that data set I get: out <- tapply( dat$clm, dat$uid, paste ,collapse=",") > > out A1.B1

Re: [R] Fast optimizer

2009-10-29 Thread R_help Help
Ok. I have the following likelihood function. L <- p*dpois(x,a)*dpois(y,b+c)+(1-p)*dpois(x,a+c)*dpois(y,b) where I have 100 points of (x,y) and parameters c(a,b,c,p) to estimate. Constraints are: 0 < p < 1 a,b,c > 0 c < a c < b I construct a loglikelihood function out of this. First ignoring th

Re: [R] Fast optimizer

2009-10-29 Thread Bill.Venables
Dear R_Help Help, The critical questions are a) how many parameters do you have b) how pathological is the log-likelihood function c) how good are your initial values and d) how efficiently have you coded your objective function? Of these, the last is most likely the critical one, and the one

Re: [R] Fast optimizer

2009-10-29 Thread Ravi Varadhan
You have hardly given us any information for us to be able to help you. Give us more information on your problem, and, if possible, a minimal, self-contained example of what you are trying to do. Ravi. Ravi Varadhan, Ph.D. A

Re: [R] Removing & generating data by category

2009-10-29 Thread Steven Kang
Highly appreciate for all the help. I have one more thing to resolve.. Suppose 3 additional records are binded to the previous arbitrary data set. i.e > a <- data.frame(id=c(c("A1","A2","A3","A4","A5"),c("A3","A2","A3","A4","A5")),loc=c("B1","B2","B3","B4","B5"),clm=c(rep(("General"),6),rep("Life

Re: [R] R crashes

2009-10-29 Thread cls59
premmad wrote: > > My R crashes frequently when run with huge data. > I'm afraid this is nowhere near enough information for anyone on this list to provide any sort of meaningful insight. At the very least we need to know: * What operating system are you using? * Specifically, for "lar

[R] Fast optimizer

2009-10-29 Thread R_help Help
Hi, I'm using optim with box constraints to MLE on about 100 data points. It goes quite slow even on 4GB machine. I'm wondering if R has any faster implementation? Also, if I'd like to impose equality/nonequality constraints on parameters, which package I should use? Any help would be appreciated.

Re: [R] comparing two data.frames

2009-10-29 Thread Marc Schwartz
On Oct 29, 2009, at 7:05 PM, Adrian Johnson wrote: Dear group, I have two data.frames X and Y identical except for values. X gene fc A1CF -0.10050677 A2BP1 -2.03093217 A2M -0.09092704 A4GALT 0.04124563 A4GNT -0.10336042 Y gene fc A1CF -0.085709770 A2BP1 1.05

[R] comparing two data.frames

2009-10-29 Thread Adrian Johnson
Dear group, I have two data.frames X and Y identical except for values. > X gene fc A1CF -0.10050677 A2BP1 -2.03093217 A2M -0.09092704 A4GALT 0.04124563 A4GNT -0.10336042 > Y gene fc A1CF -0.085709770 A2BP1 1.058642812 A2M 0.142530426 A4GALT0.0094631

Re: [R] deriv() to take vector of expressions as 1st arg?

2009-10-29 Thread Gabor Grothendieck
OK. Try this: sapply(expression(x^2+y^3, x^5+y^6), deriv, c("x", "y")) On Thu, Oct 29, 2009 at 7:11 PM, Rolf Turner wrote: > > On 30/10/2009, at 11:35 AM, Gabor Grothendieck wrote: > >> Try this: >> >> deriv(expression(x^2+y^3, x^5+y^6), c("x","y")) > > Did *you* try it Gabor?  I did just now a

Re: [R] deriv() to take vector of expressions as 1st arg?

2009-10-29 Thread Rolf Turner
On 30/10/2009, at 11:35 AM, Gabor Grothendieck wrote: Try this: deriv(expression(x^2+y^3, x^5+y^6), c("x","y")) Did *you* try it Gabor? I did just now and it returns only the gradient of the first component: > deriv(expression(x^2+y^3, x^5+y^6), c("x","y")) expression({ .value <- x^2

Re: [R] fast cumulative matrix multiplication

2009-10-29 Thread David Winsemius
This morning I did 10,000 replicates of multiplying 3 small matrices using a for-loop andalso with Reduce and found that the for-loop was roughly twice as fast, so I didn't post. > m1 <- matrix(1:9, 3) > m2 <- matrix(1:9, 3) > m3 <- matrix(1:9, 3) > system.time(replicate(1000, Reduce("%*%" ,

Re: [R] fast cumulative matrix multiplication

2009-10-29 Thread Gabor Grothendieck
Don't know if its any faster but try this: Reduce("%*%", list(M1, M2, M3), accumulate = TRUE) On Thu, Oct 29, 2009 at 9:56 AM, Todd Schneider wrote: > Hi all, > > I am looking for a function like cumprod() that works for matrix > multiplication. > > In other words, I have matrices [M1, M2, ..

Re: [R] deriv() to take vector of expressions as 1st arg?

2009-10-29 Thread Gabor Grothendieck
Try this: deriv(expression(x^2+y^3, x^5+y^6), c("x","y")) On Thu, Oct 29, 2009 at 3:31 PM, wrote: > The deriv() function takes an 'expression' as its first argument). I was > wondering if the this function can take an array or a vector of > expressions as its first argument. Aside, I saw how t

Re: [R] How to create a "heatline" -- heatmap in one dimension?

2009-10-29 Thread Jim Lemon
On 10/30/2009 08:42 AM, Woolner, Keith wrote: Hi, I'm trying to create a "heatmap" that is just a line segment. That is, a graphic that shows an interval and how a dependent variable varies along that interval, with the value of the dependent variable shown by color rather than on a y-axis.

Re: [R] x-y plot as an histogram

2009-10-29 Thread Jim Lemon
On 10/30/2009 06:12 AM, Federico Abascal wrote: Hi, I am investigating a problem for which I found no solution. I have a matrix with two columns. I have plotted it as an x-y plot (plot(matrix[,1],matrix[,2]) But this is not apropriate for my purposes. I need to group the data in matrix[,1] int

Re: [R] strsplit() and Windows file paths

2009-10-29 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Nordlund, Dan (DSHS/RDA) > Sent: Thursday, October 29, 2009 12:57 PM > To: r-help@r-project.org > Subject: Re: [R] strsplit() and Windows file paths > > > -Original Message---

Re: [R] changing default character size depending on settings for mfcol: How to scale font consistently?

2009-10-29 Thread Jim Lemon
On 10/29/2009 09:49 PM, Kim MILFERSTEDT wrote: ... My question is, how do I find out the current default for character size so that I can calculate an appropriate scaling factor? Or are there any better alternatives? Hi Kim, You can get the current scaling with: par("cex") Jim ___

[R] How to create a "heatline" -- heatmap in one dimension?

2009-10-29 Thread Woolner, Keith
Hi, I'm trying to create a "heatmap" that is just a line segment. That is, a graphic that shows an interval and how a dependent variable varies along that interval, with the value of the dependent variable shown by color rather than on a y-axis. The image() function produces something cl

[R] how to control the label position on panels of trellise plot

2009-10-29 Thread zrl
Hi, I am wondering how to control the label position on panels of trellise plot. I have 6 panels, I want to all x label positions at the bottom of each panel. How should I do that? Similar, how should I control y label positions of each panel? Thanks. [[alternative HTML version deleted]]

[R] ggplot2-caption on graphics

2009-10-29 Thread Felipe Carrillo
Hi: I am trying to add some caption at the bottom of the graphic by using the 'xlab' and just adding a new line to it. Is there another way to do this or this is the correct way? Thanks library(ggplot2) library(effects) df <- data.frame( x = c(3, 1, 5), y = c(2, 4, 6), label = c("a","b","

Re: [R] how to fetch rows with certain characteristics

2009-10-29 Thread Marek Janad
Try > x <- read.table(textConnection( + "1.2 1 + 1.2 1 + 1.3 1 + 1.5 1 + 1.1 2 + 1.2 2 + 9.9 2 + 0.1 3 + 1.1 3 + 1.9 3") ) > x.min <- tapply(x[,1], x[,2], min) > x[x.min[x[,2]]==x[,1],] V1 V2 [1,] 1.2 1 [2,] 1.2 1 [3,] 1.1 2 [4,] 0.1 3 2009/10/29 Ista Zahn > I still don't under

Re: [R] package:svMisc

2009-10-29 Thread Philippe Grosjean
A new version of svMisc was send today to CRAN. It should be available soon for R 2.10. Best, Philippe Grosjean ..<°}))>< ) ) ) ) ) ( ( ( ( (Prof. Philippe Grosjean ) ) ) ) ) ( ( ( ( (Numerical Ecology of Aquatic Systems ) ) ) ) )

Re: [R] Re commendation for dealing with mixed input types in CSV

2009-10-29 Thread Ben Bolker
Jason Rupert wrote: > > Currently I have a CSV with mixed input types that I am trying to read in > and reformat without having to list off all the column names.  Below is an > example of the data: > > HouseColor, HouseSize, HouseCost > Blue, 1600, 160e3 > Blue, 1600, 160e3 > > [snip] > I'm

[R] Announcement: the 2nd Chinese R Conference

2009-10-29 Thread Yihui Xie
Hi everyone, Sorry for the so late announcement: we are organizing the 2nd Chinese R Conference now following the one held last year in Beijing (see "Conference Review: The 1st Chinese R Conference". The R Journal. Vol1/1. P69.) The conference will be focused on: * introducing and popularizing

[R] package:svMisc

2009-10-29 Thread Frank Lawrence
I am using Tinn-R 2.3.2.3 and R 2.10.0 on a windows vista [64bit] machine. When I activate R from Tinn-R I get the following warning message: Warning message: package 'svMisc' was built under R version 2.9.1 and help will not work correctly Please re-install it However, when I attempt to install

Re: [R] Recommendation for dealing with mixed input types in CSV

2009-10-29 Thread David Winsemius
On Oct 29, 2009, at 3:26 PM, Jason Rupert wrote: Currently I have a CSV with mixed input types that I am trying to read in and reformat without having to list off all the column names. Below is an example of the data: HouseColor, HouseSize, HouseCost Blue, 1600, 160e3 Blue, 1600, 160e3 A

Re: [R] strsplit() and Windows file paths

2009-10-29 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Robert Baer > Sent: Thursday, October 29, 2009 12:40 PM > To: r-help@r-project.org > Subject: [R] strsplit() and Windows file paths > > There are two ways to express file paths wi

Re: [R] x-y plot as an histogram

2009-10-29 Thread David Winsemius
On Oct 29, 2009, at 3:12 PM, Federico Abascal wrote: Hi, I am investigating a problem for which I found no solution. I have a matrix with two columns. I have plotted it as an x-y plot (plot(matrix[,1],matrix[,2]) But this is not apropriate for my purposes. I need to group the data in matri

[R] strsplit() and Windows file paths

2009-10-29 Thread Robert Baer
There are two ways to express file paths with the Windows environment: > a=file.choose() > a [1] "C:\\Documents and Settings\\rbaer\\Desktop\\_VNT_Test\\coordFocused 20k F5 0ng Ki8751 t20.txt" and >b= paste(getwd(),"/",dir()[1],sep="") >b [1] "C:/Documents and Settings/rbaer/Desktop/_VNT_Test/co

[R] deriv() to take vector of expressions as 1st arg?

2009-10-29 Thread t121
The deriv() function takes an 'expression' as its first argument). I was wondering if the this function can take an array or a vector of expressions as its first argument. Aside, I saw how to give a vector argument to the second argument. like to have something like: deriv(c(~x^2+y^3, ~x^5+y^6), c

[R] Recommendation for dealing with mixed input types in CSV

2009-10-29 Thread Jason Rupert
Currently I have a CSV with mixed input types that I am trying to read in and reformat without having to list off all the column names.  Below is an example of the data: HouseColor, HouseSize, HouseCost Blue, 1600, 160e3 Blue, 1600, 160e3 Actually I have about 60 columns like this, so imagine t

Re: [R] Summing identical IDs

2009-10-29 Thread Dimitris Rizopoulos
one option is the following: Acres <- c(100,101,100,130,156,.5,293,300,.09) Bldgid <- c(1,2,3,4,5,5,6,7,7) DF <- data.frame(Acres, Bldgid) aggregate(DF, list(Bldgid), sum) I hope it helps. Best, Dimitris PDXRugger wrote: Hello All, I would like to select records with identical IDs then

Re: [R] x-y plot as an histogram

2009-10-29 Thread milton ruser
Hi Federico, Have you checked google R graph library? bests milton On Thu, Oct 29, 2009 at 3:12 PM, Federico Abascal wrote: > Hi, > > I am investigating a problem for which I found no solution. > I have a matrix with two columns. I have plotted it as an x-y plot > (plot(matrix[,1],matrix[,2])

[R] x-y plot as an histogram

2009-10-29 Thread Federico Abascal
Hi, I am investigating a problem for which I found no solution. I have a matrix with two columns. I have plotted it as an x-y plot (plot(matrix[,1],matrix[,2]) But this is not apropriate for my purposes. I need to group the data in matrix[,1] into groups (as an histogram would do). Then I hav

[R] Summing identical IDs

2009-10-29 Thread PDXRugger
Hello All, I would like to select records with identical IDs then sum an attribute then and return them to the data frame as a single record. Please consider Acres<-c(100,101,100,130,156,.5,293,300,.09) Bldgid<-c(1,2,3,4,5,5,6,7,7) DF=cbind(Acres,Bldgid) DF<-as.data.frame(DF) So that:

Re: [R] "The system cannot find the file specified"

2009-10-29 Thread Mark Knecht
On Thu, Oct 29, 2009 at 9:58 AM, hadley wickham wrote: >> Do you have write permission in C:\Program Files\R\R-2.9.2\library?  It >> could be that the installer just tried to create the QRMlib subdir, and >> failed, and that's why it doesn't exist. > > One possible reason for failure is that your

Re: [R] how to fetch rows with certain characteristics

2009-10-29 Thread Ista Zahn
I still don't understand. Please look at the example I provided in my last response. What is it that you want that my example does not do? On Thu, Oct 29, 2009 at 3:08 PM, Waverley @ Palo Alto wrote: > The reason %in% does not work is that there are might be values which > are not min in other cl

Re: [R] "The system cannot find the file specified"

2009-10-29 Thread Mark Knecht
On Thu, Oct 29, 2009 at 9:45 AM, Jim Burke wrote: > I think your are using R 2.10.0. > No, I was using 2.9 and updating to 2.10 solved it for me. - Mark __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read t

Re: [R] how to fetch rows with certain characteristics

2009-10-29 Thread Waverley @ Palo Alto
The reason %in% does not work is that there are might be values which are not min in other class which are the same as the min of different classes. In the example I provided before, this situation did not exist. See the new example: > + 1.2 1 > + 1.3 1 > + 1.5 1 > + 1.1 2 > + 1.2 2 > + 9.9 2 >

Re: [R] R crashes

2009-10-29 Thread Rolf Turner
On 29/10/2009, at 11:13 PM, premmad wrote: My R crashes frequently when run with huge data. Isn't that ***fascinating***!!! cheers, Rolf Turner ## Attention:\ This e-mail message is privileged and

Re: [R] how to fetch rows with certain characteristics

2009-10-29 Thread Ista Zahn
Hi, I guess I don't understand why you think %in% won't work. > x <- read.table(textConnection("1.2 1 + 1.2 1 + 1.3 1 + 1.5 1 + 2.1 2 + 2.0 2 + 9.9 2 + 1.4 3 + 1.8 3 + 1.9 3") ) > x <- as.matrix(x) > x.min <- tapply(x[,1], x[,2], min) > x[x[,1] %in% x.min,] > ## all matches V1 V2 [1,] 1.2 1

[R] What is the best way to efficiently construct a data frame from multiple source files?

2009-10-29 Thread Mark Connolly
I have an arbitrary number of spreadsheets that I want to consolidate into a single data frame. The spreadsheets all have the same structure: location, depth1Reading, depth2reading, depth3reading, depth4reading, depth5reading The spreadsheets have their reading date in their file name. This

Re: [R] Re trieving comments from PostgreSQL tables with RODBC and psqlodbc

2009-10-29 Thread Jim Cser
Upgrading the driver did not help, but you're right, I should have tried that first. Thank you for your response. Regards, Jim Cser Prof Brian Ripley wrote: > > You seriously need to update your way-obsolete software (see the > posting guide), but you are seeing what your ODBC driver is retu

Re: [R] How to turn individual consecutive information into survival objects?

2009-10-29 Thread Karl Ove Hufthammer
On Thu, 29 Oct 2009 10:21:23 -0700 (PDT) Guido van Steen wrote: > I would like to transform this dataset into information on the > lenght of the first spell of unemployment. (If there are multiple > spells I would just like to use the first one.) If 'dat' is your data frame (or matrix): l.su

Re: [R] Question about is.na for missing data

2009-10-29 Thread Karl Ove Hufthammer
On Thu, 29 Oct 2009 18:12:34 +0100 Karl Ove Hufthammer wrote: > > rhs is the wrong length for indexing by a logical matrix > > > > An inspection of the data set reveals no value of the sort give above. > > Any thoughts? > > I would venture to guess that your 'asd' object is not of the type

[R] How to turn individual consecutive information into survival objects?

2009-10-29 Thread Guido van Steen
Dear R List, I have a dataset with the following structure: """personal_id, p_0, p_1, p_2, , p_36, p_37 1, NA, 1, 4, , 1, NA 2, NA, NA, NA, , 4, NA . . . 6020, NA, 3, 3, , NA, NA 6021, NA, 2, 2, , 4, NA """ I used some made-up data. It is just meant to show the struc

Re: [R] "The system cannot find the file specified"

2009-10-29 Thread Prof Brian Ripley
On Thu, 29 Oct 2009, hadley wickham wrote: (quoting Duncan Murdoch without attribution, tut tut) Do you have write permission in C:\Program Files\R\R-2.9.2\library?  It could be that the installer just tried to create the QRMlib subdir, and failed, and that's why it doesn't exist. One possibl

Re: [R] Weird error: Error in xj[i] : invalid subscript type 'list'

2009-10-29 Thread Duncan Murdoch
On 10/29/2009 12:28 PM, Peng Yu wrote: I got the error. I haven't been able to get a stand along case so that I can show it here. But could somebody give some clue on what could cause this error? Since I never defined xj[i], I don't understand where this error come from. Error in xj[i] : invalid

Re: [R] Question about is.na for missing data

2009-10-29 Thread Karl Ove Hufthammer
On Thu, 29 Oct 2009 11:45:19 -0500 David Kaplan wrote: > asd[is.na(asd)] <- mean(asd,na.rm=TRUE) > > This has worked quite well in the past. Now, however, I am getting the > following error messsage. > > Error in `[<-.data.frame`(`*tmp*`, is.na(asd), value = > c(2433.64150943396, : > rhs

Re: [R] "The system cannot find the file specified"

2009-10-29 Thread Duncan Murdoch
On 10/29/2009 12:58 PM, hadley wickham wrote: Do you have write permission in C:\Program Files\R\R-2.9.2\library? It could be that the installer just tried to create the QRMlib subdir, and failed, and that's why it doesn't exist. One possible reason for failure is that your virus checker preve

[R] a minor bug in "venn" from gplots?

2009-10-29 Thread Tao Shi
Hi list, I found this one when I was trying to output the Venn diagram to a .pdf file.  When there are 4 sets of groups to draw, the .pdf file automatically has 3 pages and the figure only appears on the 3rd page in the .pdf file with the first 2 pages being blank.  Try the following: (I'm us

Re: [R] Rounding and printing

2009-10-29 Thread David Winsemius
On Oct 29, 2009, at 12:29 PM, Alan Cohen wrote: Hello, I am trying to print a table with numbers all rounded to the same number of digits (one after the decimal), but R seems to want to not print ".0" for integers. I can go in and fix it one number at a time, but I'd like to understand

Re: [R] "The system cannot find the file specified"

2009-10-29 Thread hadley wickham
> Do you have write permission in C:\Program Files\R\R-2.9.2\library?  It > could be that the installer just tried to create the QRMlib subdir, and > failed, and that's why it doesn't exist. One possible reason for failure is that your virus checker prevented the R installer from creating a new di

[R] Question about is.na for missing data

2009-10-29 Thread David Kaplan
Greetings, I am trying to a simple mean imputation using the following command (yes, I know it is not an ideal way to impute missing data) asd[is.na(asd)] <- mean(asd,na.rm=TRUE) This has worked quite well in the past. Now, however, I am getting the following error messsage. Error in `[<-

Re: [R] Rounding and printing

2009-10-29 Thread Karl Ove Hufthammer
On Thu, 29 Oct 2009 12:29:42 -0400 Alan Cohen wrote: > I am trying to print a table with numbers all rounded to the same > number of digits (one after the decimal), but R seems to want to not > print ".0" for integers. 'round' only rounds numbers; it doesn't format them. Use 'formatC' instead

Re: [R] Weird error: Error in xj[i] : invalid subscript type 'list'

2009-10-29 Thread David Winsemius
On Oct 29, 2009, at 12:28 PM, Peng Yu wrote: I got the error. I haven't been able to get a stand along case so that I can show it here. But could somebody give some clue on what could cause this error? Since I never defined xj[i], I don't understand where this error come from. Error in xj[i] :

Re: [R] Weird error: Error in xj[i] : invalid subscript type 'list'

2009-10-29 Thread Karl Ove Hufthammer
On Thu, 29 Oct 2009 11:28:44 -0500 Peng Yu wrote: > > I got the error. I haven't been able to get a stand along case so that > I can show it here. But could somebody give some clue on what could > cause this error? Since I never defined xj[i], I don't understand > where this error come from. > >

Re: [R] "The system cannot find the file specified"

2009-10-29 Thread Jim Burke
I think your are using R 2.10.0. I get similar messages when I have too many resources in use. Like FireFox eating memory and CPU. When you get this message go look in your R installation "library" subdirectory. You will see a weird number as a folder name. Under that folder is the package you

Re: [R] Trouble retrieving data (.xls) from folder on my computer.

2009-10-29 Thread Gabor Grothendieck
Either make sure that perl is on your PATH or if the path/filename you specified is correct then try with backslashes just in case: "C:\\perl\\bin\\perl.exe" Also check the upper/lower case of each component of your path just in case. On Thu, Oct 29, 2009 at 11:52 AM, tobiasfa wrote: > > This i

Re: [R] how to fetch rows with certain characteristics

2009-10-29 Thread Waverley @ Palo Alto
Thanks. That works. However, in my own case, there are more columns of other kinds of data. So to me, it is more important to get the row index of those that has the min values of particular column in particular class (which is another column). Can you help more as how to get those row index? O

[R] Rounding and printing

2009-10-29 Thread Alan Cohen
Hello, I am trying to print a table with numbers all rounded to the same number of digits (one after the decimal), but R seems to want to not print ".0" for integers. I can go in and fix it one number at a time, but I'd like to understand the principle. Here's an example of the code. The pro

[R] Weird error: Error in xj[i] : invalid subscript type 'list'

2009-10-29 Thread Peng Yu
I got the error. I haven't been able to get a stand along case so that I can show it here. But could somebody give some clue on what could cause this error? Since I never defined xj[i], I don't understand where this error come from. Error in xj[i] : invalid subscript type 'list' _

Re: [R] Trouble retrieving data (.xls) from folder on my computer.

2009-10-29 Thread tobiasfa
This is what R says: > xls <- read.xls(file.choose()) Converting xls file to csv file... Error in system(cmd, intern = !verbose) : perl not found Error in file.exists(tfn) : invalid 'file' argument > xls <- read.xls(file.choose(), perl="C:/perl/bin/perl.exe") Converting xls file to csv file... Er

Re: [R] singular variance-covariance warning in lmer

2009-10-29 Thread Weber, Sam
Hi Ista, The command looks like: $ female : Factor w/ 18 levels "2","4","5","8",..: 1 1 1 1 2 2 2 3 4 4 ... Female is a factor with 18 levels, so I assume this is how the analysis is being grouped. Best Sam From: Ista Zahn [istaz...@gmail.com] Sent:

Re: [R] New variables "remember" how they were created?

2009-10-29 Thread Skipper Seabold
On Wed, Oct 28, 2009 at 12:40 PM, Adaikalavan Ramasamy wrote: > Your example is too complicated for me. But few points: > > 1) What do you mean by "instrument"? Do you mean variable? > By instruments, I mean instrumental variables. Very common in econometrics: http://en.wikipedia.org/wiki/Instru

Re: [R] The 'subset matching' challenge

2009-10-29 Thread Detlef Steuer
If you look for "subset sum problem", you will find relevant information. A starter: http://en.wikipedia.org/wiki/Subset_sum_problem Detlef On Thu, 29 Oct 2009 15:47:22 +0100 Yvonnick Noël wrote: > Dear all, > > The following problem just has been submitted to me by an accountant. > > In h

Re: [R] output of "for"

2009-10-29 Thread Greg Snow
Look at the collapse argument to the paste function. You should be able to do what you want much simpler without any explicit for loops. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-hel

Re: [R] lmer and negative binomial family

2009-10-29 Thread Ben Bolker
John Sorkin wrote: > > Patrick, > I am not sure about this but > (1) I think you need to load the lme4 package, not MASS > (2) I don't think neg.bin is allowable. I suggest you load lme4 and then > type ?family > > John > > This conversation would probably go better on r-sig-mixed-mod...@r

[R] Keeping NAs in model.matrix for glm.fit

2009-10-29 Thread Ted
Hi, For efficiency purposes I'm using glm.fit instead of glm, and I'm pre-constructing a model design matrix using model.matrix(). I'm finding that the 'NAs' in the x are being removed by model.matrix by default, and would like to know how could I keep them (or remove the corresponding NAs i

[R] change in default behavior of ?functionname in R 2.10?

2009-10-29 Thread Jenny Drnevich
Hi everyone, I just installed R 2.10 using the Windows binary. At some point in the past using the Windows binary installation, the default behavior of ?functionname changed from plain text to a nice html interface. Now with R 2.10, the default behavior has changed back to the plain text help.

Re: [R] The 'subset matching' challenge

2009-10-29 Thread Ben Bolker
yvonnick noel wrote: > > Dear all, > > The following problem just has been submitted to me by an accountant. > > In his new job, he has to close some old accounts. He has yearly > amounts, and a list of products that have been bought over the years, at > certain prices for which he has an e

Re: [R] Invert the sign of a number

2009-10-29 Thread Karl Ove Hufthammer
On Thu, 29 Oct 2009 09:05:22 -0400 Duncan Murdoch wrote: > You want the unary - operator. For example, > > -x It even has a nice help page: ?"-" -- Karl Ove Hufthammer __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-h

[R] The 'subset matching' challenge

2009-10-29 Thread Yvonnick Noël
Dear all, The following problem just has been submitted to me by an accountant. In his new job, he has to close some old accounts. He has yearly amounts, and a list of products that have been bought over the years, at certain prices for which he has an exhaustive record. The problem is: He do

Re: [R] Error installing RSPerl.

2009-10-29 Thread Duncan Temple Lang
Hi Grainne There is one likely cause. But before getting into the explanation, can you send me the output from when you installed the package, e.g. the output from R CMD INSTALL RSPerl and any configuration arguments you specified. You can send this to me off-list and we can summarize a

Re: [R] R 2.10 under Windows XP: glitches and successes

2009-10-29 Thread Duncan Murdoch
On 29/10/2009 10:23 AM, Blair Christian wrote: On a related note, on windows xp + ESS + R 2.9.2, I have long waits when I run: browseURL( unitTestOutFile, browser="C:/Program Files/Mozilla Firefox/firefox.exe") Firefox is always already open, and sometimes the old test results are already open

Re: [R] Trouble retrieving data (.xls) from folder on my computer.

2009-10-29 Thread Gabor Grothendieck
If its already on your computer try one of these: xls <- read.xls("myfile.xls") # if its in current directory xls <- read.xls("/path/to/myfile.xls") # to specify path xls <- read.xls(file.choose()) # use explorer style interface to choose On Thu, Oct 29, 2009 at 9:36 AM, tobiasfa wrot

Re: [R] singular variance-covariance warning in lmer

2009-10-29 Thread Ista Zahn
Hi Sam, Just a stab in the dark here, but is your grouping variable really female? What does str(data.frame(mean.sst, female) look like? How many levels does female have? -Ista On Thu, Oct 29, 2009 at 7:10 AM, Weber, Sam wrote: > Dear R Users, > > I was hoping for some help with a recurrent er

Re: [R] Trouble retrieving data (.xls) from folder on my computer.

2009-10-29 Thread David Winsemius
On Oct 29, 2009, at 9:36 AM, tobiasfa wrote: Using gdata on windows and im having trouble to retrieve an excel file from a folder on my computer. This is my dummy: R > download.file("http://people.su.se/~lundh/data/cpi_kpix.rda";, + "cpi_kpix.rda") R > URL <- "http://people.su.se/"; R > P

Re: [R] "The system cannot find the file specified"

2009-10-29 Thread Mark Knecht
Thanks Duncan. 2.10 seems to install things correctly. Cheers, Mark On Thu, Oct 29, 2009 at 6:52 AM, Mark Knecht wrote: > Is 2.10 out? I'll give it a try. > > Thanks, > Mark > > On Thu, Oct 29, 2009 at 6:45 AM, Duncan Murdoch wrote: >> On 29/10/2009 9:43 AM, Mark Knecht wrote: >>> >>> On Thu, O

Re: [R] R 2.10 under Windows XP: glitches and successes

2009-10-29 Thread Blair Christian
On a related note, on windows xp + ESS + R 2.9.2, I have long waits when I run: browseURL( unitTestOutFile, browser="C:/Program Files/Mozilla Firefox/firefox.exe") Firefox is always already open, and sometimes the old test results are already open too. Sometimes it takes minutes to open up, som

Re: [R] Re ading and Creating Shape Files

2009-10-29 Thread cls59
PDXRugger wrote: > > Hello R Community, >I have imported a dataset which contain X Y coordinates and would like > to recreate a shape file after some data analysis. What i have done is to > import some taxlot data and join them based on some criteria. I want to > check to see how well the

Re: [R] What happen for Negative binomial link in Lmer fonction?

2009-10-29 Thread E. Robardet
Thank you for your answers, I have an exemple of that i was using: m1a<-lmer(atpos~ninter+saison+milieu*zone+(1|code),family=neg.bin(0.429),method="Laplace",data=manu) summary(m1a) Generalized linear mixed model fit using Laplace Formula: atpos ~ ninter + saison + milieu * zone + (1 | code)

[R] Trouble retrieving data (.xls) from folder on my computer.

2009-10-29 Thread tobiasfa
Using gdata on windows and im having trouble to retrieve an excel file from a folder on my computer. This is my dummy: R > download.file("http://people.su.se/~lundh/data/cpi_kpix.rda";, + "cpi_kpix.rda") R > URL <- "http://people.su.se/"; R > PATH <- "~lundh/data/" R > FILE <- "cpi_kpix.rda" R >

Re: [R] x11(title=' ')

2009-10-29 Thread ms.com
Dear all sorry that i am late to reply for the question about my OS, I am using MS Windows XP 2003 OS thanking you Warm RegardMSNepal > Date: Wed, 28 Oct 2009 22:20:50 +1100 > From: j...@bitwrit.com.au > CC: r-help@r-project.org > Subject: Re: [R] x11(title=' ') > > On 10/28/2009 09:51 PM, P

  1   2   >