Re: [R] catering for rescaling

2014-03-11 Thread Geoffrey
Jim, I read the code - strwidth(). is the function i needed. Geoff. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, m

Re: [R] catering for rescaling

2014-03-11 Thread Geoffrey
Thanks Jim. I see you maintain the package. What r primitive do those functions use to do font metrics so that the margin can adjusted? Geoff. On 11/03/14 06:27, Jim Lemon wrote: On 03/10/2014 10:34 PM, Geoffrey wrote: My barplot has nicely left justified horizontal labels, the names of

[R] strucchange w dummy variables

2014-03-10 Thread Geoffrey Smith
Hello, I am having trouble with the output from the strucchange package for a dummy variable regression. Why do I still get an intercept term in the output of lm03, below? library(lmtest) library(strucchange) data(GermanM1) #regular dummy regression with intercept lm01 <- lm(m ~ as.factor(seaso

[R] catering for rescaling

2014-03-10 Thread Geoffrey
My barplot has nicely left justified horizontal labels, the names of people. Written using text() . I use par("user")[1] - OFFSET to get the placed nicely. Now of course if i manually rescale/zoom the plot the labels get redrawn at the 'wrong' location, including off the left of the plot. I

Re: [R] aes and parameter evaluation problems

2013-12-31 Thread Geoffrey
es_string(y=n,colour=n)) } return(g) } A.K. On Monday, December 30, 2013 7:49 PM, Geoffrey wrote: I am trying add geom_line's using a loop but the nature of unevaluated parameters is causing me problems. This code works: ex <- function() { d <- data.frame(x=1:5,a=1:5,b=2:6,c=3:7)

[R] aes and parameter evaluation problems

2013-12-30 Thread Geoffrey
I am trying add geom_line's using a loop but the nature of unevaluated parameters is causing me problems. This code works: ex <- function() { d <- data.frame(x=1:5,a=1:5,b=2:6,c=3:7) g <- ggplot(d, aes(x)) g <- g + geom_line(aes(y=a,colour=a)) + geom_line(aes(y=b,colour=b)) + g

[R] Structural break test Andrews (2003)

2013-11-25 Thread Geoffrey Smith
Dear Friends, I am looking for an R version of the structural break test in Andrews (2003). The excellent strucchange package does not include this test (yet?). Is this test available in another package? If not, might there already be a function written to do this test? Thank you very much. Ci

[R] strucchange breakpoints r-squared

2013-01-20 Thread Geoffrey Smith
Can anyone please tell me how to get the r-squared output from a piecewise (segmented) regression using the strucchange package? Here is the R code I have tried thus far. library(lmtest) library(strucchange) data <- ts(c(rnorm(30), runif(30)), frequency = 12, start = c(2005, 01)) bpts <- breakp

Re: [R] defmacro and bwplot incompatibilities?

2012-12-10 Thread Geoffrey
Engineer (Solar/BatteriesO.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. Geoffrey wrote: My macro doesn't

[R] defmacro and bwplot incompatibilities?

2012-12-09 Thread Geoffrey
My macro doesn't work for bwplot. But is working elsewhere. What changes should i make to fix my macro. Thanks. The complete code sample is: library(gtools) library(lattice) pic <- defmacro(fn, plotfunc, expr={png(filename=fn); plotfunc; dev.off()}) # this one fails. pic("bw.png", {bwplot(Speci

[R] Dozen+ Online R Courses: $110-$150 total cost thru 9/3

2012-08-27 Thread Geoffrey Hubona
VCU faculty and non-profit Georgia R School offer 11-14 substantial (4-10 classes each) online courses using R on: Fundamentals; Graphics; Data Manipulation; Data Mining; Multivariate Statistics; PLS Path Modeling; Programming; Simulation; and more. Take until May 15, 2013 to complete as many cours

[R] data.table vs plyr reg output

2012-06-26 Thread Geoffrey Smith
Hello. The data.table package is very helpful in terms of speed. But I am having trouble actually using the output from linear regression. Is there any way to get the data.table output to be as pretty/useful as that from the plyr package? Below is an example. library('data.table'); library('pl

[R] grouping function

2012-05-08 Thread Geoffrey Smith
Hello, I would like to write a function that makes a grouping variable for some panel data . The grouping variable is made conditional on the begin year and the end year. Here is the code I have written so far. name <- c(rep('Frank',5), rep('Tony',5), rep('Edward',5)); begin <- c(seq(1990,1994),

[R] Online Course PLS and R and free, public videos

2011-10-03 Thread Geoffrey Hubona
The Georgia R School (http://georgia-r-school.org) is a non-profit educational organization. With faculty from Virginia Commonwealth University, we are conducting live, interactive, synchronous month-long online courses on PLS path modeling and R statistical software during October and November. A

[R] Newbie question - struggling with boxplots

2011-08-16 Thread Geoffrey Stoel
virginica", select = (1:4))); but I am lazy AND I want all three to be plotted besides each other AND I don't want to manually type the Species myself. is there an easier way to do this probably yes... If you want to help me out... would be deeply appreciated.. Kind regards,

Re: [R] days between dates

2011-05-23 Thread Geoffrey Smith
Thank you for the email. The data is unbalanced, meaning that some days are missing. So the sequence of days could be something like Tuesday, Wednesday, Friday, Monday. The diff function would produce 1, 2, 3. But I would like it to produce 1, 2, 1 since there is really only 1 day between Frida

[R] days between dates

2011-05-23 Thread Geoffrey Smith
Hello, I have some unbalanced panel data that is measured on weekdays only (i.e., excluding Saturday and Sunday). I would like to get the number of days between dates such that the number of days between a Friday and a Monday is 1 (and not 3). Here is some code to illustrate my problem: library(

[R] NEW SUMMER ONLINE R COURSE: Fundamentals of Using R

2011-05-03 Thread Geoffrey Hubona
NEW SECTION BEGINS JUNE 1 (11AM-2PM ET) AND MAY 27 (6PM-9PM ET) The non-profit organization Information Institute ( http://www.information-institute.org) is offering a live, interactive, synchronous online course entitled Fundamentals of Using R. The registration cost for the 14-hour, 5 week cou

[R] NEW ONLINE R COURSE: Fundamentals of Using R

2011-04-17 Thread Geoffrey Hubona
EARLY REGISTRATION ENDS APRIL 22 The non-profit organization *Information Institute* ( http://www.information-institute.org) and faculty from Virginia Commonwealth University (VCU) are offering a live, interactive, synchronous online course entitled Fundamentals of Using R. The early registratio

[R] bind mean to a df

2011-04-11 Thread Geoffrey Smith
Hello, I would like to take the mean of a column from a data frame and then bind the mean back to the data frame. I can do this using the following lines of code, but I am looking for a more elegant solution. Thank you very much. Geoff name <- c('Frank','Frank','Frank','Tony','Tony','Tony','Ed'

[R] LIVE, ONLINE COURSE: Using R Software for Academic Research Analyses

2011-04-03 Thread Geoffrey Hubona
The Information Institute (http://www.information-institute.org), a charitable, non-profit, educational and scientific organization, in conjunction with faculty from Virginia Commonwealth University (VCU), is offering live, interactive, synchronous online classes (one AM and one PM to reach all tim

[R] lags for unbalanced panel data

2011-03-08 Thread Geoffrey Smith
he Year-to-Year percentage change in Score that accounts for the missing data?; #Notice that Tony is missing data for the Year 2007 and Edward is missing the Year 2005; #Note as well that we will need to end up losing the Year 2005 in the calculation; -- Geoffrey Smith Visiting Assistant Professo

[R] tapply output

2010-10-06 Thread Geoffrey Smith
a$group, myData$name), mean); #The raw output from the tapply function is fine, but I would; #really like the output to look like this; # class group name mean # 0 ATom62.5 #0 BJane58.5 #1 AEnzo

[R] normality tests

2010-08-11 Thread Geoffrey Smith
Hello, does anyone know how to compute the following two normality tests using R: (1) the Kiefer-Salmon (1983) statistic, Economics Letters 11, p. 123-127 (2) the modified Shapiro-Wilk statistic? Thank you very much. Geoff [[alternative HTML version deleted]] __

[R] mgcv out of memory

2010-06-27 Thread Geoffrey Smith
Hello, I am trying to update the mgcv package on my Linux box and I keep getting an "Out of memory!" error. Does anyone know of a fix for this? Below is a snippet of the message that I keep getting: Thank you. Geoff ** R ** inst ** preparing package for lazy loading ** help *** installing help

[R] percent by subset

2010-05-02 Thread Geoffrey Smith
Suppose my data looks like this: Obs, Male, Female, Height 1, T, F, 66 2, F, T, 64 3, T, F, 59 4, T, F, 55 5, F, T, 62 6,

[R] panel data

2010-04-02 Thread Geoffrey Smith
" the missing YEAR such that the end result will be balanced and look like: ID,YEAR,HEIGHT Tom,2007,65 Tom,2008,66 Mary,2007,45 Mary,2008,50 Harry,2007,62 Harry,2008,62 James,2007,68 James,2008,NA Jack,2007,70 Jack,2008,NA Jordan,2007,NA Jordan,2008,72 Thank you. Geoff -- Geoffrey Smit

[R] mean for subset

2010-01-05 Thread Geoffrey Smith
Dawn and Clara? Thank you. -- Geoffrey Smith Visiting Assistant Professor Department of Finance W. P. Carey School of Business Arizona State University [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https

Re: [R] 'persp' query

2009-10-06 Thread Geoffrey William Heard
id Winsemius Cc: Geoffrey William Heard; r-help@r-project.org Subject: Re: [R] 'persp' query David Winsemius wrote: > > On Oct 6, 2009, at 4:46 AM, Geoffrey William Heard wrote: > >> Hi All >> >> I'm creating some 3-D plots using the function 'pers

[R] 'persp' query

2009-10-06 Thread Geoffrey William Heard
Hi All I'm creating some 3-D plots using the function 'persp', and have a query regarding the ability to make changes to the label of the z-axis. There are two things I would like to do. First, the default setting places the label a little close to the axis for my liking. Is there any way of

[R] Cross-validation question

2009-01-13 Thread Geoffrey Zhu
data points or leave out 1/k random years. What do you think? Thanks, Geoffrey [[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 http://www.R

[R] memisc package and rounding

2008-08-29 Thread Geoffrey Smith
Greetings, Is there a way to control the number of digits after the decimal from linear regression output using the memisc package? I have tried the following code, but it does not work: fm <- lm(y ~ X) mtable(fm, digits=9) The default seems to be 3 digits after the decimal. Also, is there a

[R] survival package test stats

2008-07-02 Thread Geoffrey Smith
Geoffrey Smith Visiting Assistant Professor Department of Finance University of Illinois at Urbana-Champaign __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

[R] HELP: How to subtract a vector out of each row of a matrix or array

2007-11-15 Thread Geoffrey Zhu
9 V10 0.037819506 0.021107303 0.039035427 0.002694224 Get the mean of each column. Q3: Now the big question. I want to substract V1 from each element of column 1, V2 from each element of column 2, ... How do I do this? I ended up doing this, which is highly inefficient. > z<- t(t(