[R] Sorting factors

2007-12-21 Thread tom sgouros
Hello all: I'm sorry to take up bandwidth with easy questions, but as an R beginner, I continue to be surprised by factors. If someone can shed some light for me, I'd be grateful: > d Total z02801 z02802 z02804 z02806 z02807 z02808 z02809 z02812 z02813 54813 29 51169 236810

Re: [R] data shape

2007-12-20 Thread tom sgouros
Charilaos Skiadas <[EMAIL PROTECTED]> wrote: > > 2. What's the easiest way to read such a data array from a text > > file? > > I can do some editing of a csv file produced from the > > spreadsheet, > > but don't really know what to aim for. > > Here is the code I used to read your ex

[R] data shape

2007-12-20 Thread Tom Sgouros
Hello: I have been give a spreadsheet to work with formed as one big table. What it consists of is a 10-row-by-40-column table for each of about 70 different locations. In other words, the table row names are repeated 70 times, once for each of the locations (whose names also appear in the same

Re: [R] documenting yoru progress

2007-12-03 Thread tom sgouros
Duncan Murdoch <[EMAIL PROTECTED]> wrote: > I think Gabor has answered your question directly, but another > approach to solve the same underlying problem might be to work with > Sweave. (Or ODFweave, etc.) Thank you, that is pretty marvelous. I will use it next time around. -tom -- ---

Re: [R] documenting yoru progress

2007-12-02 Thread tom sgouros
do this? as.character doesn't do it. More generally, is there a way to inspect an object of some class I don't know about to find its members and methods? I suspect that will save me some posts like this in the future. Thanks, -tom > > > On Dec 2, 2007 6:55 PM, tom sgouros

Re: [R] documenting yoru progress

2007-12-02 Thread tom sgouros
uot;survey.write" was invoked, whether it was invoked as "survey.write(res.raw,res.q)" or "survey.write(bus.raw,bus.q)". Obviously I have access to the values of the arguments, but I want the names of those arguments, or a string containing it all. Thanks, -tom > > This

[R] documenting yoru progress

2007-12-02 Thread Tom Sgouros
Hello all: I have a function that writes a fairly elaborate report based on some survey data. For documentation and bookkeeping purposes, I'd like to write out in the report the function call that produced the report, or at least enough information to help me recreate the steps that led to that

[R] vector sprintf argument

2007-11-29 Thread Tom Sgouros
Hello all: If I have a vector and a format, I want to do this: > A <- c(3,4,5) > F <- "Number: %d, %d, %d" > sprintf(F,A) This doesn't work because A isn't three arguments, it's just one. Is there a way to peel the vector members out of A so that sprintf can get at them? I would like to do

Re: [R] One pdf file with plots and text output

2007-10-17 Thread tom sgouros
Latex has its own search path for packages like sweave.sty. Run the texconfig program and look at the configuration. The TEXMF variable is the one you're interested in. Search your system for a file called texmf.cnf, and edit that to change the TEXMF. It sounds like the sweave installation doe

Re: [R] avoiding a loop?

2007-10-15 Thread tom sgouros
I knew it was simple. Thanks very much. -tom jim holtman <[EMAIL PROTECTED]> wrote: > ?table to count the factors > > > x > [1] "a" "b" "c" "d" "e" > > paste(head(x, -1), tail(x, -1), sep='') > [1]

[R] avoiding a loop?

2007-10-15 Thread Tom Sgouros
Hi All: I feel like there must be a slick R-native no-loop way to get the counts for the entries in a factor, but I'm unable to see how. Right now I'm doing this: hn.ent<-data.frame(rep(0,length(levels(hnf))), row.names=levels(hnf)) colnames(hn.ent)<-c("count") for (lev in levels(hnf)) { hn.e

Re: [R] simulated data using empirical distribution

2007-10-11 Thread tom sgouros
Hello all: Many thanks to the people who have responded to my question, on and off-list. My problem isn't completely solved, though, and perhaps you can help again. The problem, again, is that I have what is essentially a histogram, but not the underlying data, and I want to simulate data that

[R] simulated data using empirical distribution

2007-10-10 Thread Tom Sgouros
Hello all: I'm sure this is a trivial request, but I'm still a beginner at this, and haven't been able to find it. I need to create simulated data based on some empirical distributions of a single variable. I've found R functions to help me simulate data based on analytical distributions, or to

Re: [R] curvilinear grid

2007-09-27 Thread tom sgouros
[EMAIL PROTECTED] wrote: > Ask on R-sig-geo? I haven't seen a query from you come through over > there... and that would be the logical place to ask questions about > the sp package and similar bits... > No query from me over there because I managed to overlook it. Many thanks. -tom --

Re: [R] curvilinear grid

2007-09-26 Thread tom sgouros
m after, but I can't figure out if there is a way to invoke it that does what I want, or if I'm barking up the wrong tree. Thanks, -tom > > On 9/26/07, Tom Sgouros <[EMAIL PROTECTED]> wrote: > > > > Hello all: > > > > A question from a new user. I have

[R] curvilinear grid

2007-09-26 Thread Tom Sgouros
Hello all: A question from a new user. I have data on a geo-referenced curvilinear grid. This is a grid with 75 rows and 51 columns, is not aligned north-south, and the rows and columns are not straight. (And the coordinates are in meters.) I want to make image plots of this data, but where th