Re: [R] Are there free R webinar recordings somewhere ?

2009-12-07 Thread Tal Galili
Thanks D . Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com/ (English)

Re: [R] How to get last day of a month?

2009-12-07 Thread Alex Brussee
To get the last day of the month, I used the following statement: as.Date(format(as.Date(format(as.Date("20090323","%Y%m%d"), "%Y%m01"), "%Y%m%d")+31,"%Y%m01"), "%Y%m%d")-1 Of course, "20090323" is the original mmdd input date here. It's not very sophisticated, but gets the job done in a sim

Re: [R] Help with Nested loop - very slow, can I use an apply?

2009-12-07 Thread Nikhil Kaza
From an old post by Gabor http://tolstoy.newcastle.edu.au/R/help/04/01/0147.html apply (outer (landmark_c,t(store_c),"-"),c(1,4),function(x)sqrt(sum(diag(x*x On 7 Dec 2009, at 10:58PM, dolar wrote: Hi there I have two tables, with longitudinal and latitudinal coordinates. what I

Re: [R] Simplex Density Plots

2009-12-07 Thread Duncan Murdoch
On 07/12/2009 11:12 PM, Graham Neubig wrote: Hello, I have just started using R, and have found it quite easy to make plots of probability densities for normal and beta distributions, etc. Now, I'm looking at trying to make a simplex plot of a Dirichlet density, but have gotten stuck and was ho

[R] Help with Nested loop - very slow, can I use an apply?

2009-12-07 Thread dolar
Hi there I have two tables, with longitudinal and latitudinal coordinates. what I want is a cross table between each coordinate, to find the distance between each building and different landmarks I currently have this nested loop which is fine for when i have 10 stores of interest, against 200

[R] Serial Correlation in panel data regression

2009-12-07 Thread sayan dasgupta
Dear R users, I have a question here library(AER) library(plm) library(sandwich) ## take the following data data("Gasoline", package="plm") Gasoline$f.year=as.factor(Gasoline$year) Now I run the following regression rhs <- "-1 + f.year + lincomep+lrpmg+lcarpcap" m1<- lm(as.formula(paste("lgaspca

[R] Simplex Density Plots

2009-12-07 Thread Graham Neubig
Hello, I have just started using R, and have found it quite easy to make plots of probability densities for normal and beta distributions, etc. Now, I'm looking at trying to make a simplex plot of a Dirichlet density, but have gotten stuck and was hoping that someone could help. Ideally, the plot

[R] SSfpl question

2009-12-07 Thread Airey, David C
In using SSfpl() recently with nlsList(), I came across a data set of mine that failed, because the call to nls() inside SSfpl() exceeded 50 iterations. nlsList converges with my own starting values and extra allowed iterations. Has anyone else experienced this with SSfpl() and what do you do ab

[R] lm: RME vs. ML

2009-12-07 Thread John Sorkin
windows XP R 2.10 As pointed out by Prof. Venables and Ripley (MASS 4th edition, p275), the results obtained from lme using method="ML" and method="REML" are often different, especially for small datasets. Is there any way to determine which method is preferable for a given set of data? Thanks,

Re: [R] R-squared for ANOVA model

2009-12-07 Thread David Winsemius
On Dec 7, 2009, at 8:12 PM, ZeMajik wrote: Hey, In SAS after doing an ANOVA you also get the aptness of fit as R- squared in the ANOVA table. I've tried getting the R-squared from R but have failed miserably. I've tried searching google and the manual as well Is it possible to extract R-

Re: [R] Multiple regression script

2009-12-07 Thread GlenB
Joel Fürstenberg-Hägg said: "Multiple linear regression [...] I would like to check every possible combination of factors, evalute the results based for instance on their p values, and then choose the best regression model." By "every possible combination of factors", I assume you mean that for

[R] {Lattice} help.

2009-12-07 Thread Xin Ge
Hi All, I have a 4-dimensional data. I'm using barchart() function from lattice package. The R code and data are below - code includes one for stack=TRUE and other for stack=FALSE. I would like to present the data in another form which would be plotting Factor3 levels (P, Q, R, S) as two stacked

[R] data manipulation/subsetting and relation matrix

2009-12-07 Thread Juliet Hannah
Hi List, Here is some example data. myDat <- read.table(textConnection("group id 1 101 1 201 1 301 2 401 2 501 2 601 3 701 3 801 3 901"),header=TRUE) closeAllConnections() corr_mat <-read.table(textConnection("1 1 .5 0 0 0 0 0 0 0 2 .5 1 0 0 0 0 0 0 0 3 00 1.0

Re: [R] Starting estimates for nls Exponential Fit

2009-12-07 Thread dave fournier
Thanks to Dennis Murphy who pointed out that ExponCycles is undefined. It is an R gotcha. I had shortened the name but R still remembered it so the script worked but only on my computer. This should fix that. ExponValues=c(2018.34,2012.54,2018.85,2023.52,2054.58,2132.61,2247.17,2468.32,27 78.47) E

[R] R-squared for ANOVA model

2009-12-07 Thread ZeMajik
Hey, In SAS after doing an ANOVA you also get the aptness of fit as R-squared in the ANOVA table. I've tried getting the R-squared from R but have failed miserably. I've tried searching google and the manual as well Is it possible to extract R-squared from ANOVA models in R? [[alternativ

Re: [R] Label individual points in lattice by and ID

2009-12-07 Thread Felix Andrews
xyplot(y~x | f1 + f2, data= dat, groups=ID, type="l", panel= function(x, y,groups, subscripts, ...){ panel.xyplot(x, y, groups = groups, subscripts = subscripts, ...) panel.text(x, y, groups[subscripts]) }) 2009/12/8 Pat Schmitz : > Thanks > > This works, but I lose the ability to say

Re: [R] Starting estimates for nls Exponential Fit

2009-12-07 Thread dave fournier
I thought maybe my suggestion for reparameterizing this simple problem was ignored because I didn't supply R code for the problem. Here it is using optim for the optimization. It converges trivially with an initial value for E of 1000. As I stated before, there is nothing at all difficult about th

[R] histbackback function

2009-12-07 Thread Katie N
Hi, I'm trying to recreate a sensitivity-specificity graph using the histbackback function. The only problem is that these graphs are typically drawn with vertical rather than horizontal bar plots (and the histbackback function only seems to work with horiz=TRUE argument, using "horiz=FALSE" does

Re: [R] multiple plots using summary in rms package

2009-12-07 Thread Frank E Harrell Jr
Mike, You are not using rms functions in your example; you are using Hmisc's summary.formula function and its plot method. For method='reverse', multiple plots may be produced by the plot method so par(mfrow=c( )) is not well defined. There is also a problem with the dotchart2 function (cal

Re: [R] Regular expression help

2009-12-07 Thread Gabor Grothendieck
If I understand correctly you wish to extract strings of digits more than 5 characters long: s <- c("UV7C11-F9-E1 MCS#9831019", "MCS Lot #9512516") library(gsubfn) strapply(s, "\\d{6,}", c) Depending on what you want to get back you might wish to add the simplify=TRUE argument to strapply, as wel

Re: [R] Regular expression help

2009-12-07 Thread Phil Spector
Ramya - Try strings = c('UV7C11-F9-E1 MCS#9831019','MCS Lot #9512516') sub('^.*?(\\d{5,}).*?$','\\1',strings,perl=TRUE) [1] "9831019" "9512516" The regular expression finds the first string of five or more numbers in the strings. Since you said the numbers could occur anywhere in the stri

Re: [R] Regular expression help

2009-12-07 Thread Marc Schwartz
On Dec 7, 2009, at 5:04 PM, Ramya wrote: Hi there I have a string like this i want to extract 9831019 from this string i used a regular expresion \d+ by which i can only make it to see 7 and returns. This type of number(9831019) appears in any part of the string and is definitely more t

Re: [R] data.frame to "stacked frame"

2009-12-07 Thread Ista Zahn
One option is library(reshape) dfr <- melt(dfw, id.vars="group") -Ista On Mon, Dec 7, 2009 at 8:20 AM, Christian Schulz wrote: > Hi, > > have anybody a hint how i could avoid the cumbersome way (..especially the > value part) > change the data representation from  n column data.frame to an stac

[R] Regular expression help

2009-12-07 Thread Ramya
Hi there I have a string like this i want to extract 9831019 from this string i used a regular expresion \d+ by which i can only make it to see 7 and returns. This type of number(9831019) appears in any part of the string and is definitely more than 5 digits all the time and i want to give that

Re: [R] RandomForest - getTree status code

2009-12-07 Thread NCS
Not the entire tree - I just selected a few rows. On the first tree, the only status codes I saw were -1 and -3, which makes sense. I am guessing the final tree should never have a status of -2, which looks like an intermediate status, unless I am missing something. Thanks for the response.

Re: [R] Announce: edtdbg, integrating R's debug() with your text editor

2009-12-07 Thread Norm Matloff
The files seem to be inaccessible, and I can't see why. Neither can my department Web technician. So, for the time being, simply go to http://heather.cs.ucdavis.edu/~matloff/R/edtdbg/ and then download the 3 files as directed. Meanwhile, I've thought of an interesting enhancement, and a couple

Re: [R] Label individual points in lattice by and ID

2009-12-07 Thread Pat Schmitz
Thanks This works, but I lose the ability to say plot a line by group connecting the numbered points, how do I recover this, or say color the groups by ID.. xyplot(y~x | f1 + f2, data= dat, groups=ID, type="l", panel= function(x, y,groups, subscripts, ...){ panel.text(x, y, groups[subscripts]

[R] problem in labeling the nodes of tree drawn by rpart

2009-12-07 Thread kaida ning
Hi all, I used rpart to fit a model, where the covariates in the model are categorical variables. Then I plotted the tree (mytree) and used the command "text" to add labels to the tree. In the nodes of the tree, the values of the covariates are represented with a, b or c. Is there a way to show t

[R] zelig logit survey

2009-12-07 Thread Frank Lawrence
When I use zelig to compute parameter estimates with "model = logit.survey", I receive the following error: Nicholas Carnes. 2007. "logt.surveyWarning message: In eval(expr, envir, enclose) : non-integer #successes in a binomial glm! I believe this is because the model is not using "quasibinomial"

[R] сЛyЖБа PAcCЫЛoK

2009-12-07 Thread Наталия
E-MAIL РАССЫЛКИ Доступные цены - высокое качество Наш прайс-лист: Рассылка по всей Москве - 5 000 руб., 4 рассылки по Всей Москве - 10 000 руб. Рассылка по всей России - 10 000 руб., 4 рассылки по всей России - 20 000 руб. Рассылка по России и СНГ - 15 000 руб. , 4 рассылки по России и СНГ - 30 00

Re: [R] SAS

2009-12-07 Thread Jonathan Lisic
Marshall Feldman uri.edu> writes: > > Regarding the various methods people have suggested, what if a typical > tab-delimited data line looks like: > > SMS11001 1990 M01 688.0 > > and the SAS INPUT statement is > > INPUT survey $ 1-2 seasonal $ 3 state $ 4-5 area $ 6-10

Re: [R] yeroon.net/ggplot2 web application v0.11

2009-12-07 Thread Jeroen Ooms
Hi Felipe, my apps are completely webbased, so you cannot use them offline, unless you are hosting a mirror locally or in your LAN (which can be arranged if you are interested). Jeroen 2009/12/7 Felipe Carrillo : > Hi Jeroen: > This is great for someone who is point and click oriented. Can thi

[R] Help required with NLME syntax

2009-12-07 Thread Surujbally, Bernie
Hi there, I am attempting to analyse data from a crossover study using a mixed effect Emax model in R using nlme. I am having problems ascertaining how to fit the model. Subjects are randomly assigned to 1 of 4 treatments in a complete block design. The response variable of interest is recorded

Re: [R] bootstrap help

2009-12-07 Thread Marek Janad
If I read your question now, I think, that I didn't understand you correctly, but... My code generates 50 bootstrap samples (50 tables) and for each calculates mean of column x and mean of column y, so the final result is matrix with means. If you don't want to calculate means, code below generat

Re: [R] SAS "datalines" or "cards" statement equivalent in R?

2009-12-07 Thread David Winsemius
On Dec 7, 2009, at 12:37 PM, Marshall Feldman wrote: I totally agree with Barry, although it's sometimes convenient to include data with analysis code for debugging and/or documentation purposes. However, the example actually applies equally to separate data files. In fact, the example i

Re: [R] Are there free R webinar recordings somewhere ?

2009-12-07 Thread D Kelly O'Day
Tal I have a series of basic introduction tutorials for new R users at this link. http://processtrends.com/Learn_R_Toolkit.htm http://processtrends.com/Learn_R_Toolkit.htm These videos are geared to Excel users who want to learn about R and see it in action. D Kelly O'Day http://procestrends

Re: [R] SAS "datalines" or "cards" statement equivalent in R?

2009-12-07 Thread Barry Rowlingson
On Mon, Dec 7, 2009 at 8:54 PM, Marshall Feldman wrote: > > > Barry Rowlingson wrote: >> >>  I'd love to duplicate this functionality of SAS, however, I fear: >> >> http://www.sas.com/news/preleases/SASsuit.html >> >> > > Amazing, since input statements in SAS bear an uncanny resemblance to how >

Re: [R] MLE in R

2009-12-07 Thread Francisco J. Zagmutt
Hello Liang, Besides looking at ?optim, you may also want to look into this nice working example www.mayin.org/ajayshah/KB/R/documents/mle/mle.html Regards, Francisco Francisco J. Zagmutt Vose Consulting 1643 Spruce St., Boulder Boulder, CO, 80302 USA www.voseconsulting.com Liang Wang wrote

Re: [R] SAS "datalines" or "cards" statement equivalent in R?

2009-12-07 Thread Marshall Feldman
Barry Rowlingson wrote: I'd love to duplicate this functionality of SAS, however, I fear: http://www.sas.com/news/preleases/SASsuit.html Amazing, since input statements in SAS bear an uncanny resemblance to how PL/I handles input from text files. _

[R] Reminder: ASA Stat Comp/Graph Student Paper Competition Deadline 12/14

2009-12-07 Thread Fei Chen
Just a gentle reminder that the deadline for submission to the Student Paper Competition is fast approaching. All application materials must be received by 5:00 PM EST, Monday, December 14, 2009. For submission guidelines, please visit http://stat-computing.org/awards/student/announceme

[R] Reminder: ASA Stat Comp/Graph Student Paper Competition Deadline 12/15

2009-12-07 Thread Fei Chen
Just a gentle reminder that the deadline for submission to the Student Paper Competition is fast approaching. All application materials must be received by 5:00 PM EST, Monday, December 14, 2009. For submission guidelines, please visit http://stat-computing.org/awards/student/announcement.html

Re: [R] Are there free R webinar recordings somewhere ?

2009-12-07 Thread Thomas Adams
Tal, You might look here: http://www.fort.usgs.gov/brdscience/LearnR.htm I just googled "r stats webinar" Tom Tal Galili wrote: Hi all, A friend just sent me this: http://www.mathworks.com/company/events/webinars/index.html?id=&language=en

[R] Are there free R webinar recordings somewhere ?

2009-12-07 Thread Tal Galili
Hi all, A friend just sent me this: http://www.mathworks.com/company/events/webinars/index.html?id=&language=en And asked me if there is something of the like in the R community. Does anyone know of such a think ? Cheers,

Re: [R] [GGPLOT] Legends at different layers

2009-12-07 Thread hadley wickham
You mean: dat <- data.frame(x = rnorm(100)) dat1 <- data.frame( x = c(0,0), y = c(1,0), Label = c("Point1", "Point2") ) ggplot(dat, aes(x)) + geom_histogram(aes(fill = ..count..)) + geom_point(aes(x, y, colour = Label), data = dat1, size = 4) + scale_fill_gradient("Count", low = "gre

[R] Convert a list of N dataframes to N dataframes

2009-12-07 Thread Mark Na
Hello, I have used the following command: datalist<-list(data1,data2,data3,data4,data5,data6) to make a list of my dataframes, which I then manipulated with these commands: datalist<-llply(datalist,"LogDepth") datalist<-llply(datalist,"LogArea") datalist<-llply(datalist,"p") datalist<-llply(dat

Re: [R] SAS "datalines" or "cards" statement equivalent in R?

2009-12-07 Thread Rolf Turner
On 8/12/2009, at 5:43 AM, Barry Rowlingson wrote: On Mon, Dec 7, 2009 at 3:53 PM, Marshall Feldman wrote: Regarding the various methods people have suggested, what if a typical tab-delimited data line looks like: SMS11001 1990 M01 688.0 and the SAS INPUT statement is I

Re: [R] Very basic R workflow question for Windows users

2009-12-07 Thread Duncan Murdoch
On 07/12/2009 1:31 PM, Mark Na wrote: Hi all, If you use the R Editor (not another text editor), please read on... So, my usual R workflow involves having two windows open (R Console, R Editor), writing a line of code in the R Editor and then typing Ctrl-R to run that line. Then, quite frequent

Re: [R] Sweave and license message when loading mclust package

2009-12-07 Thread Achim Zeileis
On Mon, 7 Dec 2009, Titus von der Malsburg wrote: When loading mclust, it shows a license agreement message. This message shows up in my document when I use Sweave. I did the following: <>= library(mclust) @ Is this a problem with mclust, Sweave or with me? How can it be fixed? By ?Rwe

[R] Sweave and license message when loading mclust package

2009-12-07 Thread Titus von der Malsburg
When loading mclust, it shows a license agreement message. This message shows up in my document when I use Sweave. I did the following: <>= library(mclust) @ Is this a problem with mclust, Sweave or with me? How can it be fixed? Thanks for any suggestions! Titus

Re: [R] yeroon.net/ggplot2 web application v0.11

2009-12-07 Thread Felipe Carrillo
Hi Jeroen: This is great for someone who is point and click oriented. Can this program be downloaded to be used offline or its just web based? My field crew usually take toughbooks to the field and since they don't know how to program it will be nice to make the graphics just by pointing and cli

Re: [R] [Ann] R brush for SyntaxHighlighter

2009-12-07 Thread Demitri Muna
Hi, On Dec 5, 2009, at 2:43 AM, Romain Francois wrote: There is also the R package "highlight" [1,2] serving the same purpose but based on information from the R parser, not a static list. Thanks for the pointer - I wasn't aware of that package. I'll make a mention of it on my web page. Ho

[R] Very basic R workflow question for Windows users

2009-12-07 Thread Mark Na
Hi all, If you use the R Editor (not another text editor), please read on... So, my usual R workflow involves having two windows open (R Console, R Editor), writing a line of code in the R Editor and then typing Ctrl-R to run that line. Then, quite frequently, I want to run a new command to check

Re: [R] [ggplot2] Wind rose orientation

2009-12-07 Thread Thomas S. Dye
On Dec 7, 2009, at 7:00 AM, hadley wickham wrote: >> The idea of plotting a wind rose must be fairly common. I wonder >> if it >> would make sense to have a switch that would wrap data around the >> ends of a >> continuous scale? > > Probably - but it requires a lot of work, because ggplot2

Re: [R] Output multiple files

2009-12-07 Thread David Winsemius
On Dec 7, 2009, at 12:42 PM, Muhammad Rahiz wrote: Hello, I want the ouput to take the name of the original file. I have the following code - but the problem is that the output overrides the original file which I desire not. So given an input file called File1.txt, I want the ouput to be

Re: [R] SAS "datalines" or "cards" statement equivalent in R?

2009-12-07 Thread David Winsemius
On Dec 7, 2009, at 12:37 PM, Marshall Feldman wrote: I totally agree with Barry, although it's sometimes convenient to include data with analysis code for debugging and/or documentation purposes. However, the example actually applies equally to separate data files. In fact, the example i

Re: [R] SAS "datalines" or "cards" statement equivalent in R?

2009-12-07 Thread Gabor Grothendieck
strapply in the gsubfn package can parse any input format that can be described using a regular expression and generally requires only one line of code to do the parsing. See: http://gsubfn.googlecode.com On Mon, Dec 7, 2009 at 12:37 PM, Marshall Feldman wrote: > I totally agree with Barry, alt

[R] Multiple regression script

2009-12-07 Thread Joel Fürstenberg-Hägg
Hi all, I'm doing Multiple linear regression for a data set. However, it takes a lot of time, as I would like to check every possible combination of factors, evalute the results based for instance on their p values, and then choose the best regression model. So, I wonder if anyone might have

Re: [R] SAS "datalines" or "cards" statement equivalent in R?

2009-12-07 Thread Barry Rowlingson
On Mon, Dec 7, 2009 at 5:37 PM, Marshall Feldman wrote: > I totally agree with Barry, although it's sometimes convenient to include > data with analysis code for debugging and/or documentation purposes. > > However, the example actually applies equally to separate data files. In > fact, the exampl

Re: [R] SAS "datalines" or "cards" statement equivalent in R?

2009-12-07 Thread Seeliger . Curt
> [stuff about SAS CARDS statement, I think] > > INPUT survey $ 1-2 seasonal $ 3 state $ 4-5 area $ 6-10 supersector $ > > 11-12 @13 industry $8. datatype $ 21-22 year period $ value footnote $ ; > ... > This just seems like horrendously bad practice, which is one reason > it's kludgy in R. I

[R] Output multiple files

2009-12-07 Thread Muhammad Rahiz
Hello, I want the ouput to take the name of the original file. I have the following code - but the problem is that the output overrides the original file which I desire not. So given an input file called File1.txt, I want the ouput to be called File1.out.txt, or something along this line. I'm

Re: [R] Setting Repositories in the .Rprofile file

2009-12-07 Thread David Winsemius
On Dec 7, 2009, at 12:18 PM, Richardson, Patrick wrote: Is there any way to select (during startup) all repositories by modifying the Rprofile.site file? If so, could someone let me know the syntax to use (or direct me to where I can find it)? ?options options(repos=c(CRAN = "http://lib

Re: [R] SAS "datalines" or "cards" statement equivalent in R?

2009-12-07 Thread Marshall Feldman
I totally agree with Barry, although it's sometimes convenient to include data with analysis code for debugging and/or documentation purposes. However, the example actually applies equally to separate data files. In fact, the example is from the U.S. Bureau of Labor Statistics at ftp://ftp.bls.

Re: [R] Subset of time observations where timediff > 60 secs

2009-12-07 Thread Gabor Grothendieck
There is an example at the end of the Prices and Returns section of the zoo-quickref vignette in the zoo package. library(zoo) vignette("zoo-quickref") If speed is your main concern check this recent thread that was posted on R-sig-finance: http://n4.nabble.com/SUMMARY-Reducing-an-intra-day-datas

[R] Setting Repositories in the .Rprofile file

2009-12-07 Thread Richardson, Patrick
Is there any way to select (during startup) all repositories by modifying the Rprofile.site file? If so, could someone let me know the syntax to use (or direct me to where I can find it)? Thank you, Patrick This email message, including any attachments, is for th...{{dropped:9}}

Re: [R] SAS "datalines" or "cards" statement equivalent in R?

2009-12-07 Thread Gabor Grothendieck
On Mon, Dec 7, 2009 at 11:43 AM, Barry Rowlingson wrote: >  This just seems like horrendously bad practice, which is one reason > it's kludgy in R. If it was good practice, someone would surely have > written a way to do it neatly. > >  Keep your data in data files, and your functions in .R functi

[R] [GGPLOT] Legends at different layers

2009-12-07 Thread Megh
Here I have following code : dat = rnorm(100) ggplot() + geom_histogram(aes(dat, fill=..count..)) + scale_fill_gradient("Count", low="green", high="red") + opts(legend.position="none") # Above is without any legend ## Now I want to place two points with legends dat1 <- data.frame(c(0,0), c(1,0))

Re: [R] SAS "datalines" or "cards" statement equivalent in R?

2009-12-07 Thread Barry Rowlingson
On Mon, Dec 7, 2009 at 3:53 PM, Marshall Feldman wrote: > Regarding the various methods people have suggested, what if a typical > tab-delimited data line looks like: > >     SMS11001 1990 M01 688.0 > > and the SAS INPUT statement is > >   INPUT survey $ 1-2 seasonal $ 3 state $ 4-5 ar

Re: [R] anova/factor

2009-12-07 Thread David Winsemius
On Dec 7, 2009, at 11:38 AM, oscar linares wrote: Dear Wiza[R]ds, I have the following data in a data.frame. I need to do an anova with multiple comparison but I don't know how to factor the groups for analysis. There are 3 groups, 1,2 and 3 labelled in column 1. Help appreciated with tha

[R] anova/factor

2009-12-07 Thread oscar linares
Dear Wiza[R]ds, I have the following data in a data.frame. I need to do an anova with multiple comparison but I don't know how to factor the groups for analysis. There are 3 groups, 1,2 and 3 labelled in column 1. Help appreciated with thanks in advance. Group SI Sif SG

Re: [R] [ggplot2] Wind rose orientation

2009-12-07 Thread hadley wickham
> The idea of plotting a wind rose must be fairly common.  I wonder if it > would make sense to have a switch that would wrap data around the ends of a > continuous scale? Probably - but it requires a lot of work, because ggplot2 doesn't currently support circular scales, which is what you really

Re: [R] optim with constraints

2009-12-07 Thread JPO
Steven, A quick trick to deal with problems of this nature (i.e. forcing parameters to stay positive although the parameter search isn't bound to non-negatives or positives) without resorting to another package is to re-parametrize the density function. Notice, x \in (-\infty,\infty) for x \in (-

Re: [R] [ggplot2] Wind rose orientation

2009-12-07 Thread Thomas S. Dye
Hi Hadley, Thank you very much! The idea of plotting a wind rose must be fairly common. I wonder if it would make sense to have a switch that would wrap data around the ends of a continuous scale? All the best, Tom On Dec 6, 2009, at 7:51 PM, hadley wickham wrote: > Hi Tom, > > The proble

[R] multiple plots using summary in rms package

2009-12-07 Thread Mike Babyak
Dear All, I wonder if someone can point me in the right direction here. I'm working with the rms library, R 2.9.2 under Windows XP. I'm trying to arrange two plots side by side for a colleague. mfrow or mfcol do not seem to work, however, so I am obviously missing something important. I know t

[R] different model performance because of nlevels()???

2009-12-07 Thread LWF
Hello everybody, I came across a problem when building a randomForest model. Maybe someone can help me. I have a training- and a testdataset with a discrete response and ten predictors (numeric and factor variables). The two datasets are similar in terms of number of predictor, name of variable

Re: [R] latex.table for table with character and numeric columns

2009-12-07 Thread Gerrit Draisma
Ha Charlie, It helped. It is just what i was looking for. Gerrit. Gerrit Draisma wrote: Hallo, I have a dataset with one or two columns with character data and the rest with numeric data. Using latex.table from the quantreg package produced a table, but I cannot set the decimals. For instance:

[R] Subset of time observations where timediff > 60 secs

2009-12-07 Thread Karl Ove Hufthammer
Dear list members I have a rather large vector (part of a data frame) giving the time (date + time, POSIXct) of observations. The times are irregular (with both small and large jumps) but increasing, and there are several millions of them. I now wish to reduce my data set, so that I only have

Re: [R] SAS "datalines" or "cards" statement equivalent in R?

2009-12-07 Thread Marshall Feldman
Regarding the various methods people have suggested, what if a typical tab-delimited data line looks like: SMS11001 1990 M01 688.0 and the SAS INPUT statement is INPUT survey $ 1-2 seasonal $ 3 state $ 4-5 area $ 6-10 supersector $ 11-12 @13 industry $8. datatype $ 21-22

[R] A Gamma-GLM with log link

2009-12-07 Thread choonhong ang
Hi, I have a set of data (total number of record = 144,122), and I would like to use gamma-glm with log link to set up a model. IC is number of records IL is paid amount The table below shows that I have 30.578% of the data in the level of "1 - 1000" paid amount 20.320% of the data in the level

Re: [R] How to apply five lines of code to ten dataframes?

2009-12-07 Thread guohao.huang
For example, tt1 = 2:4 ind = 1 evalstr = paste("xx = tt", ind, sep = "") eval(parse(text=evalstr)) ==> x = 2, 3, 4 It's easy for you to write a for loop to solve your problems Guo-Hao Hua

Re: [R] How to apply five lines of code to ten dataframes?

2009-12-07 Thread baptiste auguie
Hi, You could define a function that does the calculations for a given data.frame and apply it to all your data.frames, d1 <- data.frame(a=1:10, b=rnorm(10)) d2 <- data.frame(a=-(1:10), b=rnorm(10)) calculations <- function(d){ if(is.character(d)) d <- get(d) transform(d, c =

[R] How to apply five lines of code to ten dataframes?

2009-12-07 Thread Mark Na
Hello R-helpers, I have 10 dataframes (named data1, data2, ... data10) and I would like to add 5 new columns to each dataframe using the following code: data1$LogDepth<-log10(data1[,2]/data1[,4]) data1$LogArea<-log10(data1[,3]/data1[,5]) data1$p<-2*data1[,6]/data1[,7] data1$Exp<-data1[,2]^(2/data

Re: [R] Subset sum problem.

2009-12-07 Thread guohao.huang
The problem is NP-Complete and the real problem is how you can solve it. According to the wiki page, you can use the bottom algorithm(Polynomial time approximate algorithm) to solve your problems. If you had trouble with writing R code, you can read ``R-introduction''. regards

[R] Subset sum problem.

2009-12-07 Thread Geert Janssens
Hi, I'm quite new to the R-project. I was suggested to look into it because I am trying to solve the "Subset sum" problem", which basically is: Given a set of integers and an integer s, does any non-empty subset sum to s? (See http://en.wikipedia.org/wiki/Subset_sum_problem) I have been searchin

Re: [R] Forest Plot

2009-12-07 Thread Viechtbauer Wolfgang (STAT)
If you just want a forest plot, then the forest() function. If you have the betas and corresponding variances, then you can create a forest plot with: forest(betas, varbetas) And yes, estimate +/- 1.96*sqrt(variance of estimate) would be an *approximate* 95% CI. Best, -- Wolfgang Viechtbauer

Re: [R] outputting functions in lapply

2009-12-07 Thread baptiste auguie
Hi, I was about to send the exact same answer as you just received, so I'll add a note instead. Your problem looks a bit like Currying, Curry <- # original from roxygen function (f, ..., .left=TRUE) { .orig = list(...) function(...){ if(.left) {args <- c(.orig, list(...))} else {

Re: [R] optim with constraints

2009-12-07 Thread Ravi Varadhan
Steven, You haven't given us much information to help you. Are you `maximizing' the log-likelihood or are you `minimizing' the negative log-likelihood? If it is the former, you have to specify the control argument, control$fnscale = -1. This is a common mistake when using optim for likelihood e

Re: [R] outputting functions in lapply

2009-12-07 Thread Duncan Murdoch
On 07/12/2009 8:53 AM, Rune Schjellerup Philosof wrote: How come the k is 3 in all of this output? I expected it to be equal to r. > tmp3 <- lapply(1:3, function(k) function(r) print(paste(r, "<- r | k ->", k))) > for (i in 1:3) { tmp3[[i]](i) } [1] "1 <- r | k -> 3" [1] "2 <- r | k -> 3" [1] "3

Re: [R] savePlot for Mac and / or Linux?

2009-12-07 Thread James W. MacDonald
Hi Christophe, No, there isn't anything close to savePlot() on either Linux or MacOS. But the difference is that savePlot() is used to save something that has already been plotted. Since your function appears to be intended to give the user the ability to save something that has yet to be plot

Re: [R] Passing arguments to gpar

2009-12-07 Thread Sebastien Bihorel
Hi, Yes, that is exactly it. Charlie Sharpsteen gave me the same solution last week but he probably just replied to me, so his email did not go to the list. Thanks for the reply, I appreciate it I always forget about this do.call function. Paul Murrell wrote: Hi Sebastien Bihorel wro

Re: [R] optim with constraints

2009-12-07 Thread Prof. John C Nash
Without the data / script, I'm guessing that it is likely an attempt to evaluate the loss function at an inadmissible point e.g., at the constraint where there is a log(0). Different optimization tools handle things differently, and there are a couple of us working (very slowly due to other th

[R] outputting functions in lapply

2009-12-07 Thread Rune Schjellerup Philosof
How come the k is 3 in all of this output? I expected it to be equal to r. > tmp3 <- lapply(1:3, function(k) function(r) print(paste(r, "<- r | k ->", k))) > for (i in 1:3) { tmp3[[i]](i) } [1] "1 <- r | k -> 3" [1] "2 <- r | k -> 3" [1] "3 <- r | k -> 3" -- Med venlig hilsen Rune Schjellerup P

Re: [R] RandomForest - getTree status code

2009-12-07 Thread Liaw, Andy
Is that the entire tree? If so there's a problem. The node status is defined as follows in rf.h of the source code: #define NODE_TERMINAL -1 #define NODE_TOSPLIT -2 #define NODE_INTERIOR -3 i.e., "-3" means "non-terminal" node. Andy > -Original Message- > From: r-help-boun...@r-pro

Re: [R] Installing RandomForest on SuSe Linux - warnings

2009-12-07 Thread Liaw, Andy
Those are the same warnings I get when I test the package (before submitting to CRAN) and have been that way for a long time. They stemmed from conditional allocation of arrays in C. gcc -wall seems to always pick on that. As far as I know, they are harmless. Andy > -Original Message--

Re: [R] data.frame to "stacked frame"

2009-12-07 Thread Henrique Dallazuanna
Try this: cbind(stack(dfw, select = -group), dfw$group) On Mon, Dec 7, 2009 at 11:20 AM, Christian Schulz wrote: > Hi, > > have anybody a hint how i could avoid the cumbersome way (..especially the > value part) > change the data representation from  n column data.frame to an stacked > represent

[R] data.frame to "stacked frame"

2009-12-07 Thread Christian Schulz
Hi, have anybody a hint how i could avoid the cumbersome way (..especially the value part) change the data representation from n column data.frame to an stacked representation. many thanks Christian #example data dfw <- as.data.frame(matrix(runif(10*10),ncol=10)) dfw$group <- sample(c("X","

Re: [R] regression tests still fail for R version 2.10.0

2009-12-07 Thread Gavin Simpson
Do you have R_LIBS set to you library of packages? I got this error without fail when trying to R CMD check on my hand compiled R 2.10-patched. R_LIBS was set to my own library and it was full of 2.9.x packages. When I looked in ./tests/reg-tests-1.Rout I got the error about out of date packages or

Re: [R] Filtering a zoo object based on index of another object

2009-12-07 Thread Gabor Grothendieck
Since DATE2 is a subset of time(myzoo) either of these should work window(myzoo, DATE2) myzoo[DATE2] If DATE2 were not a subset of time(myzoo) then you could do this: myzoo2 <- na.locf(merge(myzoo, zoo(, DATE2))) and now use either of the first two expressions with myzoo2 in place o

Re: [R] Filtering a zoo object based on index of another object

2009-12-07 Thread Achim Zeileis
On Mon, 7 Dec 2009, Subodh Acharya wrote: Hello everybody, I have two datasets, observed and predicted. Since my observed dataset is not in regular intervals, I need to filter my predicted dataset based on the measurement date of my observed data. Here, is an example similar to what I have lib

Re: [R] Announce: edtdbg, integrating R's debug() with your text editor

2009-12-07 Thread Duncan Murdoch
On 07/12/2009 2:39 AM, Norm Matloff wrote: I've just developed edtdbg, a small package that integrates R's debug() with one's text editor. Excerpt from the README file: Goal The debug() function in R is primitive. My goal was to make it more usable by integrating it with one's t

[R] Filtering a zoo object based on index of another object

2009-12-07 Thread Subodh Acharya
Hello everybody, I have two datasets, observed and predicted. Since my observed dataset is not in regular intervals, I need to filter my predicted dataset based on the measurement date of my observed data. Here, is an example similar to what I have library(chron);library(zoo) DATE<- seq(as.Date

  1   2   >