Re: [R] Version control (git, mercurial) for R packages

2012-02-10 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 CCd to r-devel as suggested by Peter. On 09/02/12 19:28, Hadley Wickham wrote: I'm exploring using a version control system to keep better track of changes to the packages I maintain. I'm leaning towards git (although mercurial also looks good)

Re: [R] Importing a CSV file

2012-02-10 Thread peter dalgaard
On Feb 10, 2012, at 04:20 , sezgin ozcan wrote: I use mac. I tried this command also a-read.table(clipboard,sep=”\t”,row.names=1,header=T) Something is wrong with those quotes around \t... Also, last I needed this, using file=clipboard to read from the clipboard didn't work on Mac, but

Re: [R] Custom caret metric based on prob-predictions/rankings

2012-02-10 Thread Yang Zhang
Actually, is there any way to get at additional information beyond the classProbs? In particular, is there any way to find out the associated weights, or otherwise the row indices into the original model matrix corresponding to the tested instances? On Thu, Feb 9, 2012 at 4:37 PM, Yang Zhang

Re: [R] Finding all the coefficients for a logit model

2012-02-10 Thread peter dalgaard
On Feb 10, 2012, at 06:08 , R. Michael Weylandt wrote: Add -1 to your glm to remove the intercept term -- that will force Friday to have its own coefficient. That's one answer. Another one is that the coefficient (in the model with an intercept term) for Friday is zero with an s.e. of

[R] Recall@p plot using ROCR?

2012-02-10 Thread Yang Zhang
Is it possible to use ROCR to plot a simple recall@p plot? I.e., a plot where the x-axis is the position into the ranked test set, and the y-axis is the recall, so you can see what's the recall in the top 10% of the ranked results. I searched through the performance() manual but found nothing.

Re: [R] ggplot using scale_x_date gives Error in seq.int(r1$year, to$year, by)

2012-02-10 Thread Hadley Wickham
Hi Aidan, str is your friend: str(g) 'data.frame': 9 obs. of 3 variables: $ Date: chr 2011-12-23 2011-12-30 2012-01-06 2011-12-23 ... $ variable: Factor w/ 3 levels Price,Yield,..: 1 1 1 2 2 2 3 3 3 $ value : num 86.78 86.04 86.44 9.74 9.54 ... You haven't turned the Date

Re: [R] GGplot controlling point size across range

2012-02-10 Thread Hadley Wickham
On Thu, Jan 12, 2012 at 5:27 PM, Darran King darran.k...@csiro.au wrote: Hi all New to R and GGplot2 but loving the potential. I am trying to plot four separate point plots by looping over the data and plotting a different subset each time. When I plot the data as a point plot, the size of

Re: [R] pretty(range(data$z),10) Error

2012-02-10 Thread Hadley Wickham
Hi Mario, If you're still having problems, I'd suggest sending a small reproducible example (https://github.com/hadley/devtools/wiki/Reproducibility) to the ggplot2 mailing list. Hadley On Tue, Jan 17, 2012 at 12:32 PM, Mario Giesel rr.gie...@yahoo.de wrote: Hello, R-List, I'm getting error

Re: [R] Plotting bar graph over a geographical map

2012-02-10 Thread Hadley Wickham
Hi Simon, You might want to try sending a small reproducible example (https://github.com/hadley/devtools/wiki/Reproducibility) to the ggplot2 mailing list. Hadley On Tue, Jan 31, 2012 at 10:53 PM, sjlabrie sjlab...@mit.edu wrote: Hi, I am looking for a way to plot bar on a map instead of the

Re: [R] ggplot2 geom_polygon fill

2012-02-10 Thread Hadley Wickham
Hi Raimund, To increase your chances of getting help, I'd recommend using the ggplot2 mailing list, and reducing your example down to the essence of the problem. For example, the theme components don't affect the problem, but make the code longer, and so harder to understand. Hadley On Mon,

[R] Multiple comparisons of lme model - interactions?

2012-02-10 Thread Fredrik Karlsson
Dear list, Please excuse my ignorance, but I'm trying to model some data using the lme package. vot is a numeric response, and condition, location and obs are all categories. This works: anova(vot.lme - lme(vot ~ condition * location * obs,data=mergedCodesL,random= ~1 |patient))

Re: [R] Custom caret metric based on prob-predictions/rankings

2012-02-10 Thread Max Kuhn
I think you need to read the man pages and the four vignettes. A lot of your questions have answers there. If you don't specify the resampling indices, they ones generated for you are saved in the train object: data(iris) TrainData - iris[,1:4] TrainClasses - iris[,5] knnFit1 -

[R] R-question about html writer: hwriter; how to create scroll for matrices?

2012-02-10 Thread Bornhauser Hanspeter
Dear All This is the first time I use this help forum. My apologies in case I did not follow a predefined format. My question: I use the package hwriter. How can I produce a matrix (html) that allows scrolling (up and down, left and right) or, alternatively, prduces a fixed row for the

Re: [R] making multiple lines using qqplot

2012-02-10 Thread ilai
Melissa, par(new=T) works as many times as you use it. You don't provide data, but (assuming it is not NULL) more likely your n=500 qqplot was just obscuring the points of the n=50 plot. Reverse the order (i.e. qqplot 500 first, 50, 5 last) and see if all three are there (as there are more 500

Re: [R] ggplot using scale_x_date gives Error in seq.int(r1$year, to$year, by)

2012-02-10 Thread Aidan Corcoran
Thanks Hadley, of course I should have spotted that. On Fri, Feb 10, 2012 at 12:46 PM, Hadley Wickham had...@rice.edu wrote: Hi Aidan, str is your friend: str(g) 'data.frame':   9 obs. of  3 variables:  $ Date    : chr  2011-12-23 2011-12-30 2012-01-06 2011-12-23 ...  $ variable: Factor

Re: [R] coxme with frailty

2012-02-10 Thread Terry Therneau
A couple of clarifications for you. 1. I write mixed effects Cox models as exp(X beta + Z b), beta = fixed effects coefficients and b = random effects coefficients. I'm using notation that is common in linear mixed effects models (on purpose). About 2/3 of the papers use exp(X beta)* c, i.e.,

[R] Find interval between numbers in list or vector

2012-02-10 Thread alend
hi, I have a vector as follow: myVec = c(1,4,10,30) How can I get a vector that show the interval of the numbers. I need to get this result: distance 3,6,20 -- View this message in context:

[R] Help needed please

2012-02-10 Thread Jaymin Shah
I have coded a time series from simulated data: simtimeseries - arima.sim(n=1024,list(order=c(4,0,0),ar=c(2.7607, -3.8106, 2.6535, -0.9258),sd=sqrt(1))) #show roots are outside unit circle plot.ts(simtimeseries, xlab=, ylab=, main=Time Series of Simulated Data) # Yule

Re: [R] Find interval between numbers in list or vector

2012-02-10 Thread Dimitris Rizopoulos
Have a look at function diff(), e.g., diff(c(1,4,10,30)) I hope it helps. Best, Dimitris On 2/10/2012 1:33 PM, alend wrote: hi, I have a vector as follow: myVec = c(1,4,10,30) How can I get a vector that show the interval of the numbers. I need to get this result: distance

[R] Q - scatterplots

2012-02-10 Thread Jhope
I was able to make a scatterplot but ... 1) what does the 86 mean? The 86 shows up on the graph as well. scatterplot (Shells/TotalEggs ~ Sector, data = data.to.analyze) [1] 86 2) Also how do you change the Y axis title? I don't want it to read Shells/TotalEggs, instead I would like it to read

[R] Split matrix into square submatices

2012-02-10 Thread xiddw
Hi everybody, I'm looking for an optimal way to split a big matrix (e.g. ncol = 8, nrow=8) into small square submatrices (e.g. ncol=2, nrow=2) For example If I have h [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,]19 17 25 33 41 49 57 [2,]2 10 18 26 34

[R] Rpart and splitting criteria

2012-02-10 Thread MYRIAM TABASSO
Dear All, I have questions about the function rpart to construct a regression tree in R code. My problem is how to change the splitting criteria. In the rpart we have : parms=list(split=..) , I ask you if in this command is it possible to use an another splitting criterion to substitute the

[R] how to made .exe of any gui project in R

2012-02-10 Thread sagarnikam123
i made jDialog through JGR package(Java gui 4 R), i want to export it with imported external package e.g.bio3d,RCOR , into .exe or if not possible convert code to executable jar file how should i go, give me package name,example codes (if possible) -- View this message in context:

[R] access results of graph.maxflow and program max-flow algorithm

2012-02-10 Thread Wendy
Hi all, I want to use graph.maxflow function for my work. Given a network, I could get a result, but I could not figure out how the function get the result. Did anyone have the same problem before? How did you resolve it? Does anyone know any other functions/programs for max-flow analysis.

[R] clustering and the region of integration

2012-02-10 Thread Barbara Uszczynska
Dear R users, I'm having trouble with calculating pvalues for my 2d dataset. First I performed clustering and I would like to get some info about the strength of cluster membership for each point. I've calculated (thanks to nice people help) the multivariate normal densities (mnd) using dmvnorm

[R] Trust in a glm.nb model results with an itereation limit reached

2012-02-10 Thread Lucas
Hello to everyone. I'm fitting a glm.nb model to a count data. I'm using about 8 predictive variables. Once a run the script I do get a result but it tells me that the iteration limit has been reached. So, can i trust the results given by the model? Could it be a multicollinearity problem? Thank

[R] Need to aggregate large dataset by week...

2012-02-10 Thread danielrev
Hi all, I have a large dataset with ~8600 observations that I want to compress to weekly means. There are 9 variables (columns), and I have already added a week column with 51 weeks. I have been looking at the functions: aggregate, tapply, apply, etc. and I am just not savvy enough with R to

[R] best option for big 3D arrays?

2012-02-10 Thread Djordje Bajic
Hi all, I am trying to fill a 904x904x904 array, but at some point of the loop R states that the 5.5Gb sized vector is too big to allocate. I have looked at packages such as bigmemory, but I need help to decide which is the best way to store such an object. It would be perfect to store it in this

[R] e1071/svm: never finishes

2012-02-10 Thread Sam Steingold
When I tried to run svm on the same data frame, memory usage as reported by top(1) doubled to 4GB almost right away and the function never returned (has been running for ~15 hours now). ^C does not stop it. This is most unusual, libsvm has always seemed very fast. This is R version 2.13.1

[R] How to combine two matrix or vectors

2012-02-10 Thread summer
such as a=[1,2,3 ],b =[2,4] I want to get a new one [1 2 3 4 5]. Thank you. -- View this message in context: http://r.789695.n4.nabble.com/How-to-combine-two-matrix-or-vectors-tp4376467p4376467.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] How to combine two matrix or vectors

2012-02-10 Thread R. Michael Weylandt
How could you combine a and b as given to get your new one? It doesn't have the same elements... ?union ?intersect ?rbind ?c Michael On Fri, Feb 10, 2012 at 9:55 AM, summer summerwind...@hotmail.com wrote: such as a=[1,2,3 ],b =[2,4] I want to get a new one [1 2 3 4 5]. Thank you. -- View

Re: [R] Split matrix into square submatices

2012-02-10 Thread Petr Savicky
On Fri, Feb 10, 2012 at 12:02:25AM -0800, xiddw wrote: Hi everybody, I'm looking for an optimal way to split a big matrix (e.g. ncol = 8, nrow=8) into small square submatrices (e.g. ncol=2, nrow=2) For example If I have h [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,]

Re: [R] nice report generator?

2012-02-10 Thread Aleksandar Blagotić
Hi guys, AFAICT, this conversation now discusses some domain-specific issues. However, in reply to OP and OQ, I'll shamelessly advertise the package that Gergely Daróczi and I have released recently. It's named rapport, and you can grab it from CRAN or GitHub (https://github.com/aL3xa/rapport/).

Re: [R] Split matrix into square submatices

2012-02-10 Thread Gabor Grothendieck
On Fri, Feb 10, 2012 at 3:02 AM, xiddw xid...@gmail.com wrote: Hi everybody, I'm looking for an optimal way to split  a big matrix  (e.g. ncol = 8, nrow=8)  into small square submatrices  (e.g. ncol=2, nrow=2) For example If I have  h     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,]    

Re: [R] nice report generator?

2012-02-10 Thread Hadley Wickham
To be strictly correct, shouldn't that be: formula- eval(substitute( value*v*LEFT ~ RIGHT, list(LEFT=LEFT, RIGHT=RIGHT))) ? I think it probably doesn't matter.  The difference is that mine gives a pure language object, whereas yours gives a formula object.  The formula object has a

Re: [R] Trust in a glm.nb model results with an itereation limit reached

2012-02-10 Thread David Winsemius
On Feb 10, 2012, at 7:14 AM, Lucas wrote: Hello to everyone. I'm fitting a glm.nb model to a count data. I'm using about 8 predictive variables. Once a run the script I do get a result but it tells me that the iteration limit has been reached. Most regression functions have a control

Re: [R] Q - scatterplots

2012-02-10 Thread John Fox
Dear J., -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Jhope Sent: February-10-12 3:44 AM To: r-help@r-project.org Subject: [R] Q - scatterplots I was able to make a scatterplot but ... 1) what does the 86 mean? The

Re: [R] e1071/svm: never finishes

2012-02-10 Thread Sam Steingold
* Sam Steingold f...@tah.bet [2012-02-10 10:01:54 -0500]: When I tried to run svm on the same data frame, memory usage as reported by top(1) doubled to 4GB almost right away and the function never returned (has been running for ~15 hours now). ^C does not stop it. This is most unusual,

Re: [R] Importing a CSV file

2012-02-10 Thread David L Carlson
First, make sure the file name is correct. Second, try list.files(Users:/sezginozcan/Downloads/) to see if the file is listed and you are looking in the correct folder. Third, you may be able to locate and open the file using A - read.table(file.choose(), sep=\t, row.names=1, header=T) I

[R] Fwd: Importing a CSV file

2012-02-10 Thread Gyanendra Pokharel
-- Forwarded message -- From: Gyanendra Pokharel gyanendra.pokha...@gmail.com Date: Fri, Feb 10, 2012 at 11:13 AM Subject: Re: [R] Importing a CSV file To: sezgin ozcan szgoz...@gmail.com You save your file in your own folder either in desktop or in document where ever you want

Re: [R] How to have columns lined up?

2012-02-10 Thread 538280
A little more on topic is that there are tools for R to nicely format output. The simplest is probably the R2wd package which will transfer objects and text to word, you can send a matrix or data frame to word as a nicely formatted table or wdVerbatim will send output to word but make sure that

[R] problem subsetting data frame with variable instead of constant

2012-02-10 Thread vaneet
Hello, I've encountered a very weird issue with the method subset(), or maybe this is something I don't know about said method that when you're subsetting based on the columns of a data frame you can only use constants (0.1, 2.3, 2.2) instead of variables? Here's a look at my data frame called

Re: [R] problem subsetting data frame with variable instead of constant

2012-02-10 Thread Petr Savicky
On Fri, Feb 10, 2012 at 08:15:39AM -0800, vaneet wrote: Hello, I've encountered a very weird issue with the method subset(), or maybe this is something I don't know about said method that when you're subsetting based on the columns of a data frame you can only use constants (0.1, 2.3, 2.2)

Re: [R] problem subsetting data frame with variable instead of constant

2012-02-10 Thread Sarah Goslee
This is likely a representation issue, as in R FAQ 7.31. ?== suggests that using identical and all.equal is a better strategy: x1 - 0.5 - 0.3 x2 - 0.3 - 0.1 x1 == x2 # FALSE on most machines identical(all.equal(x1, x2), TRUE) # TRUE everywhere Sarah

Re: [R] How to stop a loop for?

2012-02-10 Thread 538280
If you want to pause for the person to look at a plot before going on to the next plot then just do: par(ask=TRUE) This will actually allow your loop to continue with calculations while the user looks at the plot but will pause before drawing the next plot (hitting enter in the command window

Re: [R] problem subsetting data frame with variable instead of constant

2012-02-10 Thread vaneet
Thanks guys, both those solutions work. I really appreciate the help! -- View this message in context: http://r.789695.n4.nabble.com/problem-subsetting-data-frame-with-variable-instead-of-constant-tp4376759p4376826.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] How indices calculated in package boot

2012-02-10 Thread 538280
In your second example the boot function will still generate its random indicies before your internal function calls sample, so the seed will be different when you call sample from what you originally set it to. If you really want to know what the boot function does, look at its code (it does

[R] function arrows.circular not working

2012-02-10 Thread Chosid, David (MISC)
I have started using the circular package but it is not recognizing the function arrows.circular. I attempted to use the example provided in the circular manual. Here is the example code using the circular package: plot(rvonmises(10, circular(0), kappa=1)) arrows.circular(rvonmises(10,

Re: [R] function arrows.circular not working

2012-02-10 Thread Sarah Goslee
Your sessionInfo() would be helpful. Also, just to check: you did do library(circular) right? Sarah On Fri, Feb 10, 2012 at 11:55 AM, Chosid, David (MISC) david.cho...@state.ma.us wrote: I have started using the circular package but it is not recognizing the function arrows.circular.  I

Re: [R] function arrows.circular not working

2012-02-10 Thread Jorge I Velez
Hi David, You need to load the package before running your code: # install.packages('circular') require(circular) plot(rvonmises(10, circular(0), kappa=1)) arrows.circular(rvonmises(10, circular(0), kappa=1)) arrows.circular(rvonmises(10, circular(0), kappa=1), y=runif(10), col=2)

Re: [R] Help needed please

2012-02-10 Thread ilai
Your script is rather inefficient with spurious cbind calls. Any particular reason not to use ?ar directly ? Call: ar.yw.default(x = simtimeseries, order.max = 4) Coefficients: 1234 1.9440 -1.9529 0.8450 -0.2154 Order selected 4 sigma^2 estimated as 15.29

Re: [R] function arrows.circular not working

2012-02-10 Thread Chosid, David (MISC)
Yes, sorry to not be clear. library(circular) was run. From: Jorge I Velez [mailto:jorgeivanve...@gmail.com] Sent: Friday, February 10, 2012 12:03 PM To: Chosid, David (FWE) Cc: r-help@r-project.org Subject: Re: [R] function arrows.circular not working Hi David,

Re: [R] Outlier removal techniques

2012-02-10 Thread S Ellison
-Original Message- I wonder why it is still standard practice in some circles to search for outliers as opposed to using robust/resistent methods. At the risk of extending an old debate and driving us off list topic, here are three possible reasons: i) Identifying outliers is

Re: [R] Split dataframe into new dataframes

2012-02-10 Thread 538280
I think one of your problems (the others have been addressed by others) is that you want the expression x$y to represent a column of x whose name is stored in y (not the name y itself). The problem here is that the $ notation is a magical shortcut and like any other magic if used incorrectly is

Re: [R] function arrows.circular not working

2012-02-10 Thread Sarah Goslee
Hi, On Fri, Feb 10, 2012 at 12:15 PM, Chosid, David (MISC) david.cho...@state.ma.us wrote: Yes, sorry for not being more clear.  Here is the sessionInfo(): sessionInfo() R version 2.9.1 (2009-06-26) i386-pc-mingw32 That is definitely the place to start. Your version of R is 2.5 years old,

[R] debug in a loop

2012-02-10 Thread ikuzar
Hi, I'd like to debug in a loop (using debug() and browser() etc but not print() ). I'am looking for the first occurence of NA. For instance: tab = c(1:300) tab[250] = NA len = length(tab) for (i in 1:len){ if(i != len){ tab[i] = tab[i]+tab[i+1] } } I do not want to do Browse[2] n

[R] Formatting Y axis.

2012-02-10 Thread sock.o
I've looked around and I just can't find anything that will work for my needs. This is a bit of a 2 part question but pertaining to the same topic so bare with me. The first is with my qq plot. On the Y axis of my qq plot it'll have my sample quantities but because my data is log-normal it'll

[R] Find exit status inside on.exit

2012-02-10 Thread McGehee, Robert
Hello, Does anyone know if it is possible to find out whether a calling function exited with an error or not inside of an on.exit() call? I'd like to use the same error cleanup function inside of several functions, and for aesthetic reasons would prefer not to surround the body of all of these

Re: [R] Split matrix into square submatices

2012-02-10 Thread xiddw
Thanks to Peter and Gabriel for their comments, The first way which Peter commented was my first approach, however as I use it for a 'large' matrix (in my case nrow = ncol = 512) and I want to split it into very small matrices (e.g. nrow = ncol = {4, 8, 16}) both nested loops I think are a quite

Re: [R] debug in a loop

2012-02-10 Thread Justin Haynes
You can add if(is.na(tab[i])) browser() or if(is.na(tab[i])) break see inline On Fri, Feb 10, 2012 at 7:22 AM, ikuzar raz...@hotmail.fr wrote: Hi, I'd like to debug in a loop (using debug() and browser() etc but not print() ). I'am looking for the first occurence of NA. For instance:

Re: [R] function arrows.circular not working

2012-02-10 Thread Sarah Goslee
It's a good idea to acknowledge that you've found a solution on the R-help list, rather than just to me. That way the answer appears in the list archives, and other people will know you no longer need help with this problem. Sarah On Fri, Feb 10, 2012 at 12:57 PM, Chosid, David (MISC)

[R] a) t-tests on loess splines; b) linear models, type II SS for unbalanced ANOVA

2012-02-10 Thread Peter Davenport
Dear all, I have some questions regarding the validity an implementation of statistical tests based on linear models and loess. I've searched the R-help arhives and found several informative threads that related to my questions, but there are still a few issues I'm not clear about. I'd be

[R] Schwefel Function Optimization

2012-02-10 Thread Vartanian, Ara
All, I am looking for an optimization library that does well on something as chaotic as the Schwefel function: schwefel - function(x) sum(-x * sin(sqrt(abs(x With these guys, not much luck: optim(c(1,1), schwefel)$value [1] -7.890603 optim(c(1,1), schwefel, method=SANN,

[R] range and anisotropy with RandomFields

2012-02-10 Thread jusin
Hello, I am presently trying to get a feel for the various packages out there that allow me to both analyze and simulate random fields. The package RandomFields is nice, but there are still a few aspects of its implementation that are confusing to me and I was hoping someone could help clarify

[R] Discrete Event Simulation problem

2012-02-10 Thread jism7690
Hi All, I am attempting to simulation an inventory model on R and I am having some problems. I believe the problem is when I define my demand rate is stays constant throughout so when I do need to reorder the model does not recognise it as I have the initial supply arrival time set to infinity at

Re: [R] Importing a CSV file

2012-02-10 Thread MacQueen, Don
I think you must have given the path to the file wrong. Assuming you are using R.app, try infile - file.choose() And then give infile to the read.csv() function. Then print the value of infile to find out what the path really is. Probably, you wanted

Re: [R] Custom caret metric based on prob-predictions/rankings

2012-02-10 Thread Yang Zhang
Sorry for not being more clear - I'm interested in accessing these indices from within the trainControl summaryFunction, not afterward (from the train object). As for the weights, I'm referring to the weights argument passed into train. On Fri, Feb 10, 2012 at 5:50 AM, Max Kuhn mxk...@gmail.com

Re: [R] Custom caret metric based on prob-predictions/rankings

2012-02-10 Thread Yang Zhang
(I couldn't find answers to this question in the documentation) On Fri, Feb 10, 2012 at 11:59 AM, Yang Zhang yanghates...@gmail.com wrote: Sorry for not being more clear - I'm interested in accessing these indices from within the trainControl summaryFunction, not afterward (from the train

Re: [R] passing an extra argument to an S3 generic

2012-02-10 Thread Michael Friendly
On 2/9/2012 6:24 PM, ilai wrote: You do not provide mlm.influence() so your code can't be reproduced. Or did you mean to put lm.influence() in the formals to your hatvalues.mlm ? If yes, then 1) you have a typo 2) lm.influence doesn't allow you to pass on arguments, maybe try influence.lm

Re: [R] Formatting Y axis.

2012-02-10 Thread ilai
yaxt='n' in ?par and ?axis are your friends. # A plot on log scale labeled with original: plot(x,log(y),yaxt='n') axis(2,at=pretty(log(y)),labels=round(exp(pretty(log(y) Works for qqnorm and boxplots, as well as other top level fun. By the way this is a FAQ. On Fri, Feb 10, 2012 at 9:43

Re: [R] passing an extra argument to an S3 generic

2012-02-10 Thread Henrik Bengtsson
For these type of setups, I typically turn to default values, e.g. hatvalues.mlm - function(model, m=1, infl=NULL, ...) { if (is.null(infl)) { infl - mlm.influence(model, m=m, do.coef=FALSE); } hat - infl$H m - infl$m names(hat) - if(m==1) infl$subsets else

[R] apply pairs function to multiple columns in a data frame

2012-02-10 Thread jarvisma
I am very new to R and programming and thank you in advance for your patience and help with a complete novice! I am working with a large multivariate data set that has 10 explanatory environmental variables (e.g. temp, depth) and over 60 response variables (each is a separate species). My data

Re: [R] passing an extra argument to an S3 generic

2012-02-10 Thread Michael Friendly
On 2/10/2012 4:09 PM, Henrik Bengtsson wrote: So people may prefer to do the following: hatvalues.mlm- function(model, m=1, infl, ...) { if (missing(infl)) { infl- mlm.influence(model, m=m, do.coef=FALSE); } hat- infl$H m- infl$m names(hat)- if(m==1) infl$subsets else

Re: [R] apply pairs function to multiple columns in a data frame

2012-02-10 Thread Phil Spector
A good way to solve problems like this is to write a function that will work with one variable, and then use one of the apply family of functions (in this case sapply) to do it for each of your variables. In this case, such a function would be something like this: make1plot = function(var){

Re: [R] Table rearranging

2012-02-10 Thread Jeffrey Joh
Hi David, Totally forgot line 3!  So 513 red should be ok but 420 red and 917 yellow aren't. Jeffrey CC: r-help@r-project.org From: dwinsem...@comcast.net To: johjeff...@hotmail.com Subject: Re: [R] Table rearranging Date: Tue, 7 Feb 2012 21:51:55

[R] stepwise variable selection with multiple dependent variables

2012-02-10 Thread Fugate, Michael L
Good Day, I fit a multivariate linear regression model with 3 dependent variables and several predictors using the lm function. I would like to use stepwise variable selection to produce a set of candidate models. However, when I pass the fitted lm object to step() I get the following error:

Re: [R] Table rearranging

2012-02-10 Thread David Winsemius
On Feb 10, 2012, at 4:47 PM, Jeffrey Joh wrote: Hi David, Totally forgot line 3! So 513 red should be ok but 420 red and 917 yellow aren't. I don't have a plyr solution but this is a base solution: dat[ as.logical( ave(dat$door, dat$date, FUN=function(x) {open %in% x

Re: [R] Choosing glmnet lambda values via caret

2012-02-10 Thread Yang Zhang
Yes, I know how to statically specify lambda choices. I was asking about whether there's a way to let glmnet guide that, instead of specifying it in advance. Again, sorry if I could've been more clear. On Thu, Feb 9, 2012 at 7:15 PM, Max Kuhn mxk...@gmail.com wrote: You can adjust the

Re: [R] stepwise variable selection with multiple dependent variables

2012-02-10 Thread Mitchell Maltenfort
Anova.mlm would be one way to do model selection. On Fri, Feb 10, 2012 at 4:29 PM, Fugate, Michael L fug...@lanl.gov wrote: Good Day, I fit a multivariate linear regression model with 3 dependent variables and several predictors using the lm function.  I would like to use stepwise

[R] Scriptable Integration

2012-02-10 Thread Hasan Diwan
My data: dput(mydata) structure(list(V1 = c(1328565067, 1328565067.05, 1328565067.1, 1328565067.15, 1328565067.2, 1328565067.25), V2 = c(0.0963890795246276, 0.227296347215609, 0.240972698811569, 0.221208948983498, 0.230898231782485, 0.203282153087549), V3 = c(0.0245045248243853,

Re: [R] Apply pmax to dataframe with different args based on dataframe factor

2012-02-10 Thread Idris Raja
damn, that's pretty clever. +1 thanks On Thu, Feb 9, 2012 at 8:11 PM, ilai ke...@math.montana.edu wrote: Your attempt was just overly complicated. All you needed was threshold - c( .2 , .4 , .5 )[ df$track ] df$value - pmax(threshold, df$value) df # desired outcome Cheers On Thu, Feb

[R] multiple histograms from a dataframe

2012-02-10 Thread Adel ESSAFI
Hi list I need some help for drawing some histograms I have a dataframe , say, X Y Z T I want to draw a histogram Z-T for each value of the couple (X-Y). When I use thus syntax library(lattice) histogram(law[,3] ~ law[,66] | law[,1] ) it draws multiple histograms but by selecting distinct

Re: [R] multiple histograms from a dataframe

2012-02-10 Thread David Winsemius
On Feb 10, 2012, at 7:05 PM, Adel ESSAFI wrote: Hi list I need some help for drawing some histograms I have a dataframe , say, X Y Z T I want to draw a histogram Z-T for each value of the couple (X-Y). When I use thus syntax library(lattice) histogram(law[,3] ~ law[,66] | law[,1] )

[R] garchSim with starting error and variance given?

2012-02-10 Thread jfca283
Hello i need to simulate data for and arch and garch process, n=1000. I've been generating arch and garch data but i can't find the way to set an starting error, epsilon(t=0) and sigma(t=0) to run the command garchSim(). I generated the process on Excel and i know that for the Arch process has a

Re: [R] Scriptable Integration

2012-02-10 Thread R. Michael Weylandt
I'm not quite sure what you mean, but perhaps this will help: library(splines) mydata - structure(list(V1 = c(1328565067, 1328565067.05, 1328565067.1, 1328565067.15, 1328565067.2, 1328565067.25), V2 = c(0.0963890795246276, 0.227296347215609, 0.240972698811569, 0.221208948983498,

[R] issues with read.spss

2012-02-10 Thread Jeroen Ooms
Someone supplied me with an SPSS datafile that caused a buffer overflow and then a crash when reading it in R. Unfortunately I can't supply the dataset at hand and I have a hard time reproducing it with a toy example. But I found at least 2 issues that might be related. I would like to know which

Re: [R] Scriptable Integration

2012-02-10 Thread Hasan Diwan
Michael, On 10 February 2012 18:11, R. Michael Weylandt michael.weyla...@gmail.com wrote: I'm not quite sure what you mean, but perhaps this will help: spf - splinefun(mydata$V2) splInt - function(low, up) integrate(spf, low, up)$value Sort of, I'm looking to get the nth order integral, where

Re: [R] apply pairs function to multiple columns in a data frame

2012-02-10 Thread 538280
You might find the pairs2 function in the TeachingDemos package useful. On Fri, Feb 10, 2012 at 1:13 PM, jarvisma marleyjar...@gmail.com wrote: I am very new to R and programming and thank you in advance for your patience and help with a complete novice! I am working with a large multivariate