Re: [R] assign()ing within apply

2008-12-12 Thread Thompson, David (MNR)
Any tips? DaveT. -Original Message- From: Thompson, David (MNR) Sent: December 9, 2008 04:03 PM To: 'r-help@r-project.org' Subject: assign()ing within apply Hello, I'm trying to convert a character column in several dataframes to lower case. ### # # Sample data and 'spp' column

Re: [R] assign()ing within apply

2008-12-12 Thread Thompson, David (MNR)
: Jorge Ivan Velez [mailto:jorgeivanve...@gmail.com] Sent: December 12, 2008 11:11 AM To: Thompson, David (MNR) Subject: Re: [R] assign()ing within apply Dear David, Try this: ban.ovs.93[,'spp']-tolower(ban.ovs.93[,'spp

[R] assign()ing within apply

2008-12-09 Thread Thompson, David (MNR)
Hello, I'm trying to convert a character column in several dataframes to lower case. ### # # Sample data and 'spp' column summaries: # dput(ban.ovs.1993[sample(row.names(ban.ovs.1993), 20), 1:4]) ban.ovs.93 - structure(list(oplt = c(43L, 43L, 38L, 26L, 35L, 8L, 39L, 1L, 34L, 50L, 10L, 29L, 31L,

Re: [R] a bit off topic: data for dragsters?

2008-11-17 Thread Thompson, David (MNR)
Roland, I don't know of the specific data you are asking for but the official website of the 'National Hot Rod Assoc' (?) is www.nhra.com. DaveT. * Silviculture Data Analyst Ontario Forest Research Institute Ontario Ministry of Natural Resources [EMAIL

Re: [R] Date classes in ggplot2

2008-10-20 Thread Thompson, David (MNR)
Is not melt part of reshape package, i.e., require(reshape)? DaveT. -Original Message- From: stephen sefick [mailto:[EMAIL PROTECTED] Sent: October 19, 2008 12:12 PM To: hadley wickham Cc: R Help Subject: Re: [R] Date classes in ggplot2 well I must have either resolve it without

Re: [R] package Utils Sweave Example Error

2008-10-17 Thread Thompson, David (MNR)
(Question/suggestion inline below) -Original Message- From: Duncan Murdoch [mailto:[EMAIL PROTECTED] Sent: October 16, 2008 02:17 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [R] package Utils Sweave Example Error On 10/16/2008 12:19 PM, Felipe Carrillo wrote: This is

Re: [R] YALAQ - Yet Another LApply Question

2008-10-15 Thread Thompson, David (MNR)
Please forgive this repost, it's been a week without a squeak. No comments? Original post: https://stat.ethz.ch/pipermail/r-help/2008-October/176340.html Hello, Two lapply questions (system info and sample data below): 1) Why does the first form of command1 add the name of y _after_ the str()

Re: [R] YALAQ - Yet Another LApply Question

2008-10-15 Thread Thompson, David (MNR)
] 801.408.8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] project.org] On Behalf Of Thompson, David (MNR) Sent: Wednesday, October 15, 2008 10:19 AM To: r-help@r-project.org Subject: Re: [R] YALAQ - Yet Another LApply Question Please forgive this repost, it's been

[R] Fatal error: unable to restore saved data in .RData

2008-10-10 Thread Thompson, David (MNR)
Hello, I am unable to start an R session by double-clicking on an existing .RData file from the Windoze file explorer. A dialogue appears with the message Fatal error: unable to restore saved data in .RData, and I notice in the R Console the last few lines are: Loading required

Re: [R] Fatal error: unable to restore saved data in .RData

2008-10-10 Thread Thompson, David (MNR)
this after reading the help for bindenv {base} and the phrase . . . experimental interface . . . JUMPED right out at me. Again, I don't know if this was _actually_ the cause of my problem but, I am underway again. Thanx, DaveT. -Original Message- From: Thompson, David (MNR) Sent: October

[R] YALAQ - Yet Another LApply Question

2008-10-09 Thread Thompson, David (MNR)
Hello, Two lapply questions (system info and sample data below): 1) Why does the first form of command1 add the name of y _after_ the str() output rather than before as does the second (preferred) form? # command1 version1 invisible(lapply(ls(pattern='bn'), function(y) cat(y, \n,

[R] YAPMQ - Yet Another PlotMath Question

2008-06-19 Thread Thompson, David (MNR)
Hello, I'm having trouble finding (remembering) how to pass values into text functions in plots, as demonstrated by: slope - 45 ; plot(1:10) ; text(2, 7, labels = expression(45~degree)) ; text(2, 5, labels = paste(bquote(.(slope)), expression(degree))) Thanx, DaveT.

Re: [R] YAPMQ - Yet Another PlotMath Question

2008-06-19 Thread Thompson, David (MNR)
-Original Message- From: Peter Dalgaard [mailto:[EMAIL PROTECTED] Sent: June 19, 2008 04:23 PM To: Thompson, David (MNR) Cc: r-help@r-project.org Subject: Re: [R] YAPMQ - Yet Another PlotMath Question Thompson, David (MNR) wrote: Hello, I'm having trouble finding (remembering) how

Re: [R] YAPMQ - Yet Another PlotMath Question

2008-06-19 Thread Thompson, David (MNR)
-Original Message- From: Katharine Mullen [mailto:[EMAIL PROTECTED] Sent: June 19, 2008 04:26 PM To: Thompson, David (MNR) Cc: r-help@r-project.org Subject: Re: [R] YAPMQ - Yet Another PlotMath Question by example: slope - 45 plot(1:10) text(2, 7, labels = expression(45~degree)) ; text

[R] echo Rprofile.site on startup

2008-06-17 Thread Thompson, David (MNR)
Hello, I have not been able to find how to have R echo the Rprofile.site contents to the console on start-up. Changing the windoze shortcut to include the '--verbose' option does not show what I am looking for. I would like to see the options and commands listed, in addition to the library()

Re: [R] ggplot questions

2008-06-06 Thread Thompson, David (MNR)
Thanx Thierry, Suggestion #1 had no effect. I have been playing with variants on #2 along the way. DaveT. -Original Message- From: ONKELINX, Thierry [mailto:[EMAIL PROTECTED] Sent: June 6, 2008 04:02 AM To: Thompson, David (MNR); hadley wickham Cc: r-help@r-project.org Subject: RE: [R

Re: [R] ggplot questions

2008-06-06 Thread Thompson, David (MNR)
: June 6, 2008 02:06 PM To: Thompson, David (MNR) Cc: r-help@r-project.org Subject: Re: [R] ggplot questions Does the difference have something to do with ggplot() using ranges derived from the data? When I modify my original 'test' dataframe with two extra rows as defined below, I get expected

Re: [R] ggplot questions

2008-06-05 Thread Thompson, David (MNR)
Thanx Hadley, More questions inline. -Original Message- From: hadley wickham [mailto:[EMAIL PROTECTED] Sent: June 5, 2008 01:09 PM To: Thompson, David (MNR) Cc: r-help@r-project.org Subject: Re: [R] ggplot questions On Wed, Jun 4, 2008 at 2:03 PM, Thompson, David (MNR) [EMAIL

[R] ggplot questions

2008-06-04 Thread Thompson, David (MNR)
Hello, A few questions about the following examples: 1. Why do the two plotting versions not produce the same result? 2. Is the 'scale_x_continuous' (or *_y_* or *_*_discrete) geom the best way to setup grids (as in visual guide-lines) in polar (or for that matter, any) coordinate system? 3. Why

Re: [R] Thank you

2008-05-30 Thread Thompson, David (MNR)
Yes! Again, thank you ALL very, very much. Even simply lurking on the list generates many gems worth collecting. DaveT. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] I totally agree both of you. This is a super place to mature the R. I learn a lot from this R heaven! Chunhao Quoting Esmail

Re: [R] list manipulation

2008-05-07 Thread Thompson, David (MNR)
Beautiful! Thanks Jim. DaveT. -Original Message- From: jim holtman [mailto:[EMAIL PROTECTED] Sent: May 6, 2008 07:33 PM To: Thompson, David (MNR) Subject: Re: [R] list manipulation The reason for the NULLs is that is the output of the lapply you are executing. If you don't want to see

[R] list manipulation

2008-05-06 Thread Thompson, David (MNR)
Hello, I have a set of one-liners (many thanks to previous responses from this list) that I use to look at newly imported data sets with functions like dim(), names(), str(), etc. within lapply(). Generally, these commands work for me but, I am apparently still missing some aspect of list

Re: [R] list manipulation

2008-05-06 Thread Thompson, David (MNR)
(which was probably what I was _actually_ looking for) than what I had started with. Thanx, DaveT. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: May 6, 2008 02:47 PM To: Thompson, David (MNR) Subject: RE: [R] list manipulation Hi: i would guess that you

[R] Recovering SPlus GraphSheets

2008-04-10 Thread Thompson, David (MNR)
Hello, Is it possible with R to recover the contents of SPlus GraphSheets (*.sgr) without access to SPlus? Also, some of the .sgr files may have multiple pages. Thanx, DaveT. * Silviculture Data Analyst Ontario Forest Research Institute Ontario Ministry of

[R] Changing default plot behaviour

2008-04-09 Thread Thompson, David (MNR)
Hello, How would I make the default behaviour of my plots produce output such as the following (i.e. tick marks inside on all axes, labels only on two (arbitrary?) sides) without needing the five additional commands each time? plot(1:10, axes=FALSE) axis(1, tcl=0.5) axis(2, tcl=0.5) axis(3,

Re: [R] Changing default plot behaviour

2008-04-09 Thread Thompson, David (MNR)
To: Thompson, David (MNR); r-help@r-project.org Subject: Re: [R] Changing default plot behaviour This may be a bit simple minded but why not change those commmands into a single function something like this and run it rather than the actual plot command? myfunction - function(a) { plot(a, axes=FALSE

Re: [R] Finding Interaction and main effects contrasts for two-way ANOVA

2008-03-07 Thread Thompson, David (MNR)
Dale, Other than the first SAS contrast, does the following demonstrate what your asking for? summary(twoway) material temp voltage 1:12 50:12 Min. : 20 2:12 65:12 1st Qu.: 70 3:12 80:12 Median :108 Mean :106 3rd

[R] Summary: Reorder data frame columns by negating list of names

2008-02-12 Thread Thompson, David (MNR)
* - Original Message - From: Thompson, David (MNR) [EMAIL PROTECTED] To: r-help@r-project.org Sent: Tuesday, February 12, 2008 6:19 PM Subject: [R] Reorder data frame columns by negating list of names Hello, I would like to reorder columns in a data frame by their names as demonstrated below

[R] Reorder data frame columns by negating list of names

2008-02-12 Thread Thompson, David (MNR)
Hello, I would like to reorder columns in a data frame by their names as demonstrated below: Take this data frame: xxx - data.frame(matrix(1:40, ncol=8)) names(xxx) - letters[1:8] xxx a b c d e f g h 1 1 6 11 16 21 26 31 36 2 2 7 12

[R] Can I index a dataframe with a reference from/to a second dataframe?

2008-02-08 Thread Thompson, David (MNR)
Hello, I am unable to figure out how to code a new column in a data frame based on an existing column that matches a column in a reference data frame, in a relational-db fashion. I would like this to maintain a minimum set of reference tables that may be reused over several similar datasets.

Re: [R] Converting plots to ggplot2

2008-01-18 Thread Thompson, David (MNR)
Hello Hadley, Thank you (and Domenico) for your help. I'm almost there. For convenience, I'll restate the question. With the following data: a - seq(0, 360, 5)*pi/180 ; a ac - sin(a + (45*pi/180)) + 1 ; ac s - seq(5, 45, 10)*pi/180 ; s asc - lapply(s, function(x) x*cos(ac) +

[R] Converting plots to ggplot2

2008-01-17 Thread Thompson, David (MNR)
Hello Hadley, I am trying to reproduce the following with ggplot: a - seq(0, 360, 5)*pi/180 ; a ac - sin(a + (45*pi/180)) + 1 ; ac plot(a, ac, type='b', xaxt = n) axis(1, at=seq(0,6,1), labels=round(seq(0,6,1)*180/pi),1) abline(v=c(45*pi/180, 225*pi/180)) I can get the basic

[R] Solution: Available environment variables

2007-12-21 Thread Thompson, David (MNR)
Thank you Duncan (additional comments below), -Original Message- From: Duncan Murdoch [mailto:[EMAIL PROTECTED] Sent: December 20, 2007 02:36 PM To: Thompson, David (MNR) Cc: r-help@r-project.org Subject: Re: [R] Available environment variables On 20/12/2007 2:13 PM, Thompson, David

Re: [R] str() options

2007-11-29 Thread Thompson, David (MNR)
Beautiful! Exactly what I was looking for. Thank you, Gabor -Original Message- From: Gabor Grothendieck [mailto:[EMAIL PROTECTED] Sent: November 27, 2007 05:02 PM To: Thompson, David (MNR) Subject: Re: [R] str() options On Nov 27, 2007 1:55 PM, Thompson, David (MNR) [EMAIL PROTECTED

[R] Summary: Process multiple columns of data.frame

2007-11-22 Thread Thompson, David (MNR)
Thank you Jim Holtman and Mark Leeds for your help. Original question: How do I do the following more concisely? Bout[is.na(Bout$bd.n), 'bd.n'] - 0 Bout[is.na(Bout$ht.n), 'ht.n'] - 0 Bout[is.na(Bout$dbh.n), 'dbh.n'] - 0 . . . Solution: for (i in c('bd.n', 'ht.n', 'dbh.n'))

Re: [R] Process multiple columns of data.frame

2007-11-20 Thread Thompson, David (MNR)
to be on my way again. Thanx again, DaveT. * -Original Message- From: jim holtman [mailto:[EMAIL PROTECTED] Sent: November 20, 2007 04:21 PM To: Thompson, David (MNR) Cc: r-help@r-project.org Subject: Re: [R] Process multiple columns of data.frame The problem