[R] d.f. in F test of nested glm models

2010-11-26 Thread Jonathan Flowers
to my analysis. Any help would be much appreciated. Jonathan counts - c(rpois(100,5),rpois(100,20)) sites - rep(100,200) fac1 - factor(c(rep(A,100),rep(B,100))) fac2 - factor(c(rep(C,50),rep(D,100),rep(C,50))) model1 - glm(counts ~ fac1 * fac2,family=quasipoisson, offset=log(sites)) model2 - glm

Re: [R] d.f. in F test of nested glm models

2010-11-26 Thread Jonathan Flowers
Hi David, Thanks very much, that clears it up for me. I plan to report the result as a typical F-test with numerator and denominator d.f., the value of F and the significance. If you have other thoughts, I would appreciate it. Thanks again. Jonathan On Fri, Nov 26, 2010 at 7:57 PM, David

Re: [R] Population abundance, change point

2010-11-24 Thread Jonathan P Daily
. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue it. - Jubal Early, Firefly

Re: [R] Population abundance, change point

2010-11-24 Thread Jonathan P Daily
akin to tree outputs than piecewise regression outputs. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose

Re: [R] Check for is.object

2010-11-22 Thread Jonathan P Daily
I think you want the function ?exists if(!exists(NewObject)) -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have

Re: [R] question about constraint minimization

2010-11-19 Thread Jonathan P Daily
Does ?constrOptim look as though it will handle your needs? -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have

Re: [R] predict() an rpart() model: how to ignore missing levels in a factor

2010-11-18 Thread Jonathan P Daily
): test.set - test.set[test.set$crop %in% original.set$crop,] -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose

Re: [R] Population abundance, change point

2010-11-17 Thread Jonathan P Daily
, count) lines(year, fitted(fit)) -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's

Re: [R] Population abundance, change point

2010-11-17 Thread Jonathan P Daily
. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue it. - Jubal

Re: [R] help on IDE

2010-11-17 Thread Jonathan P Daily
cases, a custom Run command. Linux systems also often ship language specific IDEs with dependency checks on R, but not always. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room

Re: [R] Anyone can help with this question

2010-11-16 Thread Jonathan P Daily
assuming your data takes the form of locationlatitudelongitude string num num string2 num num try: sub - dat[sample.int(length(dat$location), 1000),] -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road

Re: [R] Null values in R

2010-11-15 Thread Jonathan P Daily
Would ?is.null be what you are looking for? -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we

[R] repository of earlier Windows versions of R packages

2010-11-15 Thread Jonathan Williams
Dear Helpers, I was trying to find a repository of earlier Windows versions of R packages. However, while I can find the Archives for Linux versions (in the Old Sources section of each package's Downloads) , I cannot find one for Windows versions. Does such a repository exist? If so, where can

Re: [R] external R scripts

2010-11-10 Thread Jonathan P Daily
It would be possible to call other R scripts using calls to ?system or ?system2 and ?Rscript, provided you formatted what you passed as [args] and how your scripts handled [args]. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road

Re: [R] maptools package

2010-11-10 Thread Jonathan P Daily
. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue it. - Jubal Early

Re: [R] Random Sample

2010-11-08 Thread Jonathan P Daily
Use set.seed() -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue

[R] saddle points in optim

2010-11-07 Thread Jonathan Phillips
Hi, I've been trying to use optim to minimise least squares for a function, and then get a guess at the error using the hessian matrix (calculated from numDeriv::hessian, which I read in some other r-help post was meant to be more accurate than the hessian given in optim). To get the standard

[R] saddle points in optim

2010-11-06 Thread Jonathan Phillips
Hi, I've been trying to use optim to minimise least squares for a function, and then get a guess at the error using the hessian matrix (calculated from numDeriv::hessian, which I read in some other r-help post was meant to be more accurate than the hessian given in optim). To get the standard

Re: [R] improve R memory under linux

2010-11-05 Thread Jonathan P Daily
it can't allocate an object of size .02. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's

Re: [R] subsets, %in%

2010-11-05 Thread Jonathan P Daily
Any logical value can be negatively compared using ! does: subset(dat, !(dat$ID %in% someID)) provide what you need? -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room

Re: [R] cross-validation for choosing regression trees

2010-11-04 Thread Jonathan P Daily
be more informative. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue

Re: [R] memory allocation problem

2010-11-03 Thread Jonathan P Daily
of steps needed. Good luck! -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word

Re: [R] optim works on command-line but not inside a function

2010-11-03 Thread Jonathan P Daily
. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue it. - Jubal Early, Firefly From: Damokun dmroi

Re: [R] programming questions

2010-11-03 Thread Jonathan P Daily
For data frames you can also use with() in your example: with(d, exists(z)) -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room

Re: [R] R script on linux?

2010-11-02 Thread Jonathan P Daily
What is the error message? -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word

Re: [R] R script on linux?

2010-11-02 Thread Jonathan P Daily
was not created executable, in which case the terminal command chmod +x myscript.R will do it. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room

[R] Possible memory leak in loop.

2010-11-01 Thread Jonathan P Daily
- memory.size() memA returns as 9.3, and memB returns 11.3. I'm not familiar with fluctuation patterns in RAM usage (if there are any). Does anyone with more experience know if this is indicative of a memory leak? Thanks, Jon -- Jonathan P. Daily

Re: [R] Possible memory leak in loop.

2010-11-01 Thread Jonathan P Daily
Thank you, I will give that a try. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's

Re: [R] Zoom in in a plot

2010-10-27 Thread Jonathan P Daily
In that case you may wish to look into the rggobi package, which provides an R interface to the ggobi tools. I haven't used it much, but it has a lot of interactive options. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road

Re: [R] Best IDE for R

2010-10-27 Thread Jonathan P Daily
I noticed that nabble link presented Notepad++ as having to copy/paste into the editor. There is a companion to NP++, though, that allows line/file passing directly to an R console, auto-completion, and a bunch of other goodies called NppToR. -- Jonathan P

Re: [R] Best IDE for R

2010-10-27 Thread Jonathan P Daily
on a USB stick with ease. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue

Re: [R] Reading in a tab delimitated file

2010-10-26 Thread Jonathan P Daily
A call to read.table(..., sep = , ...) reads in any length of whitespace as the delimiter. On your sample text it read in a 2 column dataframe. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724

Re: [R] Reading in a tab delimitated file

2010-10-26 Thread Jonathan P Daily
Right, I forgot to mention to use header = T. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we

Re: [R] Zoom in in a plot

2010-10-26 Thread Jonathan P Daily
I think that this would be possible if you save the graph to a scalable format. Try looking into: ?postscript ?xfig ?pdf -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still

Re: [R] anomalies with the loess() function

2010-10-26 Thread Jonathan P Daily
?loess use this instead: fit - loess(b~a) lines(a, predict(fit)) -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room when its empty? Does the room, the thing itself

Re: [R] lowess() won't handle NAs

2010-10-25 Thread Jonathan P Daily
Try using the loess() function instead - it has an na.action parameter that should be able to handle your problem. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 Is the room still a room

[R] A subject related question

2010-10-16 Thread Jonathan Beokhokhei
Dear friends, please allow me a naive subject oriented question at this moment. I was wondering whether VCV matrix for some multivariate normal distribution can be PSD (which I always thought must be PD). I came across that point as I was working on some sample distribution of some statistic

Re: [R] creating 'all' sum contrasts

2010-10-15 Thread Jonathan Christensen
- matrix(0,nrow=n,ncol=n*(n-1)/2) comb - combn(n,2) M[cbind(comb[1,],1:(n*(n-1)/2))] - 1 M[cbind(comb[2,],1:(n*(n-1)/2))] - -1 M is then a matrix containing all pairwise contrasts for n levels of a factor. Hope that helps, Jonathan On Fri, Oct 15, 2010 at 10:30 AM, Michael Hopkins hopk

Re: [R] extract rows of a matrix

2010-10-12 Thread Jonathan Christensen
Hannah, a - matrix(rnorm(1),nrow=500) new.matrix - a[seq(0,dim(a)[1],by=20),] Jonathan On Tue, Oct 12, 2010 at 1:59 PM, li li hannah@gmail.com wrote: Hi all,  I want to extract every 20th row of a big matrix, say 1 by 1000. What is the simper way to do this?   Thank you very

Re: [R] MANCOVA

2010-10-08 Thread Jonathan DuBois
variables in a multiple regression. Is there a more appropriate formula? Thanks again! Jon On Fri, Oct 8, 2010 at 2:29 AM, Peter Dalgaard pda...@gmail.com wrote: On 10/08/2010 06:55 AM, Jonathan DuBois wrote: Hi, I have been using R to do multiple analyses of variance with two covariates

[R] MANCOVA

2010-10-07 Thread Jonathan DuBois
Hi, I have been using R to do multiple analyses of variance with two covariates, but recently found that the results in SPSS were very different. I have check several books and web resources and I think that both methods are correct, but I am less familiar with R, so I was hoping someone could

Re: [R] Combinations

2010-10-05 Thread Jonathan Christensen
An Introduction to R: http://cran.r-project.org/doc/manuals/R-intro.pdf Jonathan 2010/10/4 Trying To learn again tryingtolearnag...@gmail.com Hi all, I´ve been ill and I have lost a lot of time without seen the pc. I want you to help if you can if you want. Only I need an initial guide. I

Re: [R] Suppressing printing in the function

2010-10-01 Thread Jonathan Christensen
Dimitri, Maybe ?invisible will help? Jonathan On Fri, Oct 1, 2010 at 4:27 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Hello! I wrote a function that returns a data frame. Nowhere in the function do I say print(my.data.frame), but when I run the function - the data

Re: [R] graph margins

2010-09-29 Thread Jonathan Flowers
Use par(oma=c(1,1,1,1)) # oma = outer margin area Is this what your looking for? On Wed, Sep 29, 2010 at 5:03 PM, Mohsen Jafarikia jafari...@gmail.comwrote: Hello All, I am drawing a graph having 18 small graphs inside using par(mfrow = c(6,3)) command. My problem is how to specify the

Re: [R] how to to if a calculation is out range?

2010-09-29 Thread Jonathan Christensen
Perhaps use lgamma? lgamma(220) [1] 964.8206 Jonathan On Wed, Sep 29, 2010 at 3:22 PM, song song rprojecth...@gmail.com wrote: for example, when I am calculating a posterior density, I need to calculate gamma(75*3+5)=gamma(220) which is out of the bound of gamma function. what shall I do

Re: [R] need help with ramdomly sampling some data

2010-09-28 Thread Jonathan Christensen
Mike, It works for me: data - 1:8 sample(data,replace=TRUE) [1] 6 4 5 2 5 8 7 2 Please provide a reproducible example, if possible, and the output of sessionInfo(). Jonathan On Tue, Sep 28, 2010 at 7:22 PM, Michael Larkin mlar...@rsmas.miami.eduwrote: I am trying to get R to randomly

Re: [R] next step in randomly sampling

2010-09-28 Thread Jonathan Christensen
Mike, Try growth[sample(1:length(growth)),] to permute the rows. Jonathan On Tue, Sep 28, 2010 at 8:38 PM, Michael Larkin mlar...@rsmas.miami.eduwrote: Thanks to the people on this list I was able to fix my code for randomly sampling. Thanks. Now, I am moving on to the next step

Re: [R] margin control in lattice package

2010-09-27 Thread Jonathan Flowers
Hi Peter, Thank you for your thoughtful reply. I am tweaking the setting print settings you suggested. It looks like this is going to solve my problem. Thanks very much for help. Jonathan On Sat, Sep 25, 2010 at 6:00 PM, Peter Ehlers ehl...@ucalgary.ca wrote: On 2010-09-25 8:59, Jonathan

[R] margin control in lattice package

2010-09-25 Thread Jonathan Flowers
(1,2,2,2),more=T) print(p4,split=c(2,2,2,2)) Thanks in advance, Jonathan [[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-project.org

[R] layout of lattice graphics

2010-09-24 Thread Jonathan Flowers
),more=T) print(p3,split=c(1,2,2,2),more=T) print(p4,split=c(2,2,2,2)) Best Jonathan [[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

Re: [R] Plotting multiple animal tracks against Date/Time

2010-09-23 Thread Jonathan Christensen
Include individual as a factor in your dataset, and use ggplot2: library(ggplot2) ggplot(aes(x=Date, y=Distance, color=Individual), data=data) + geom_line() ought to do it. Jonathan On Thu, Sep 23, 2010 at 9:31 AM, Struve, Juliane j.str...@imperial.ac.ukwrote: Sorry for posting

[R] Passing a function as a parameter...

2010-09-22 Thread Jonathan Greenberg
R-helpers: If I want to pass a character name of a function TO a function, and then have that function executed, how would I do this? I want an arbitrary version of the following, where any function can be used (e.g. I don't want the if-then statement here): apply_some_function -

[R] support for caron (hacek) symbol

2010-09-20 Thread Jonathan Callahan
. Any information about whether these characters are supported or any possible workarounds would be greatly appreciated. Thanks in advance. Jon -- Jonathan Callahan, Ph D Mazama Science 206-708-5028 mazamascience.com [[alternative HTML version deleted

Re: [R] support for caron (hacek) symbol

2010-09-20 Thread Jonathan Callahan
out .vaj.iarsko, Štatisticky becomes .tatisticky, *etc*.: [image: Exports_BP_2010_oil_bbl_CH_MZM_NONE_auto_M.png] Thanks in advance for any help. Jon 2010/9/20 Vojtěch Zeisek vojtech.zei...@opensuse.org Hello Dne Po 20. září 2010 10:28:54 Jonathan Callahan napsal(a): I am creating

Re: [R] support for caron (hacek) symbol

2010-09-20 Thread Jonathan Callahan
Awesome! Can you tell me what version of R you are using and what operating system? R does use system fonts, doesn't it? Perhaps I just don't have the correct fonts installed -- I'm on CentOS. Jon 2010/9/20 Thomas Lumley tlum...@u.washington.edu On Mon, 20 Sep 2010, Jonathan Callahan wrote

Re: [R] support for caron (hacek) symbol

2010-09-20 Thread Jonathan Callahan
, Jonathan Callahan wrote: Awesome! Can you tell me what version of R you are using and what operating system? R does use system fonts, doesn't it? Perhaps I just don't have the correct fonts installed -- I'm on CentOS. Yes, R uses the system fonts. I'm using Mac OS and R 2.11.1. R is using

Re: [R] Setting scales for ggplot2 with facets

2010-09-11 Thread Jonathan Christensen
Swen, facet_grid forces the scale for plots along an axis to be shared. Try facet_wrap instead. Jonathan On Sat, Sep 11, 2010 at 2:21 PM, Sven Laur s...@math.ut.ee wrote: Faceting in ggplot2 seems to permit different scales for different facets, but I fail to see how one could control ylim

Re: [R] Newbie cross tabulation issue

2010-09-09 Thread Jonathan Finlay
2010/9/8 David Winsemius dwinsem...@comcast.net I hope you mean only two factors and an n x m table. Yes David I like say factor, but am new here. -- Jonathan. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Newbie cross tabulation issue

2010-09-09 Thread Jonathan Finlay
Ok friends, I tried but I not know! I'm a Linux SysAdmin and Stadistical and i working to migrate all the software in my workplace to free or open software. The OS was easy, ofimatic suite too, multimedia and graphics you know, everything was relatively easy. But i work with SPSS and I produce

[R] Newbie cross tabulation issue

2010-09-08 Thread Jonathan Finlay
...| |+---+ Like a pivot table! thanks a lot. -- Jonathan. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Newbie cross tabulation issue

2010-09-08 Thread Jonathan Finlay
Thanks David, gmodels::Crosstable partially work because can show only 1 x 1 tablen CrossTable(x,y,...) I need something how can process at less 1 variable in X an 10 in Y. Thanks for your help. -- Jonathan. [[alternative HTML version deleted

Re: [R] How to run R on Emacs+ESS

2010-09-06 Thread Jonathan Christensen
Hi Stephen, Just to check: when you say you type M-x R, are you typing the letter M? M-x in Emacs-speech means Meta-x, i.e., Alt-x. Jonathan On Mon, Sep 6, 2010 at 7:01 PM, Stephen Liu sati...@yahoo.com wrote: Hi Dirk, Thanks for your advice. Emacs and ESS already installed. $ apt

Re: [R] ggplot2 multiple group barchart

2010-09-01 Thread Jonathan Christensen
not easy to make them fit the dodged bars. Jonathan On Wed, Sep 1, 2010 at 9:15 AM, Waller Gregor (wall) w...@zhaw.ch wrote: hi there.. i got a problem with ggplot2. here my example: library (ggplot2) v1 - c(1,2,3,3,4) v2 - c(4,3,1,1,9) v3 - c(3,5,7,2,9) gender - c(m,f,m,f,f

Re: [R] Removing inter-bar spaces in barchart

2010-08-26 Thread Jonathan Greenberg
Oops, small typo, should be: barchart_test_heights=sin(c(1:100)) barchart_test_bins=c(c(1:50),c(1:50)) groups=c(rep(1,50),rep(2,50)) # Wish below didn't have spaces! barchart(barchart_test_bins~barchart_test_heights,groups=groups) On Wed, Aug 25, 2010 at 4:46 PM, Jonathan Greenberg greenb

Re: [R] Removing inter-bar spaces in barchart

2010-08-26 Thread Jonathan Greenberg
another function if that makes this easier. On Wed, Aug 25, 2010 at 1:55 PM, David Winsemius dwinsem...@comcast.net wrote: On Aug 24, 2010, at 10:20 PM, Jonathan Greenberg wrote: Rhelpers: I'm trying to make a barchart of a 2-group dataset (barchart(x~y,data=data,groups=z,horizontal=FALSE

[R] Removing inter-bar spaces in barchart

2010-08-25 Thread Jonathan Greenberg
the bars. Thanks! --j -- Jonathan A. Greenberg, PhD Assistant Project Scientist Center for Spatial Technologies and Remote Sensing (CSTARS) Department of Land, Air and Water Resources University of California, Davis One Shields Avenue Davis, CA 95616 Phone: 415-763-5476 AIM: jgrn307, MSN: jgrn

Re: [R] Cran-packages-ProfessoR- how to Automatically email a file to an address using the perl program.

2010-08-25 Thread Jonathan Lees-2
do not run the autoemail directly because of this. -- Jonathan M. Lees Professor THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL UNC-CH Geological Sciences Mitchell Hall 104 South Road CB 3315 Chapel Hill, NC 27599-3315 TEL: (919) 962-1562 FAX: (919) 966-4519 jonathan.l...@unc.edu http

[R] Quick q. on lists

2010-08-19 Thread Jonathan
Hi All, Anyone know how to quickly query some summary information on the components of a list? For example, I have a list that contains dataframes (originally generated by using split() on one large data frame). I simply want to know the number of rows in the longest dataframe from the

Re: [R] Dealing with data

2010-08-14 Thread Jonathan Christensen
with as.numeric induces a completely invalid model, as others have tried to point out. Jonathan On Fri, Aug 13, 2010 at 1:55 PM, TGS cran.questi...@gmail.com wrote: # I wasn't trying to do ANOVA. I was simply trying to figure out how regress count on sprays (this is after I saw another poster asking

Re: [R] Mailing list for download

2010-07-29 Thread Jonathan Baron
of the mailing list / mail archives for download (preferably in XML format)? Thanks Sigbert -- Jonathan Baron, Professor of Psychology, University of Pennsylvania Home page: http://www.sas.upenn.edu/~baron __ R-help@r-project.org mailing list https

Re: [R] How to run this video link

2010-07-29 Thread Jonathan Christensen
R is a program for doing statistics, not for playing videos. I recommend you try something else. Jonathan On Thu, Jul 29, 2010 at 10:43 AM, Velappan Periasamy veepsi...@gmail.comwrote: Pls tell me how to run this video in R http://nptel.iitm.ac.in/video.php?courseId=1083p=4

Re: [R] error: arguments imply differing number

2010-07-28 Thread Jonathan Christensen
of the two. The error disappears if you split the dataset only by runNumber, as then each group has both start.loc and end.loc. If you want to apply my.summary() to each of these four groups, you're going to have to fix the earlier code that assigns the start and end variables. Jonathan On Wed, Jul 28

Re: [R] how to code it??

2010-07-28 Thread Jonathan Christensen
On Wed, Jul 28, 2010 at 2:18 PM, Henrique Dallazuanna www...@gmail.comwrote: You've tried: diff(c(0, x)) ? This is clever, but not quite what he's asking for--it converts a sequence of 1's into a 1 followed by zeroes. Jonathan On Wed, Jul 28, 2010 at 3:10 PM, Raghu r.raghura

[R] Copula-GARCH estimation

2010-07-27 Thread Jonathan B Samorajski (jsamo...@princeton.edu)
from the copula -Applied the quantile function to the random sample At this point, I need to un-GARCH this sample so that I can obtain a simulated profile for the next time-period of the model. How can I do this in R? Thank you, Jonathan Samorajski

Re: [R] using sample() for a vector of length 1

2010-07-22 Thread Jonathan
.  Any thoughts? Regards, Jonathan __ 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, minimal, self-contained

Re: [R] Hydrology plots in R

2010-07-22 Thread Jonathan Christensen
. There's even a mailing list (on Google Groups) from ggplot2 with lots of friendly people to help. Best of luck, Jonathan On Thu, Jul 22, 2010 at 8:56 AM, Sam Albers tonightstheni...@gmail.comwrote: Hello, I am trying to create a plot often seen in hydrodynamic work than includes a contour

Re: [R] Historical Libor Rates

2010-07-19 Thread Jonathan Christensen
You might try asking on the R-SIG-Finance group, if nobody here can answer your question (https://stat.ethz.ch/mailman/listinfo/r-sig-finance). Jonathan On Mon, Jul 19, 2010 at 1:21 PM, Aaditya Nanduri aaditya.nand...@gmail.comwrote: Hello All, Does anyone know how to download historical

Re: [R] Scatterplot_row match

2010-07-15 Thread Jonathan Flowers
Hi, What if you create two data frames, then merge them by gene id. If your data is in a data frame called dframe... df1 - subset(dframe,select=c(id2c,2c)) df2 - subset(dframe,select=c(id1c,1c)) merged - merge(df1,df2,by.x=id2c,by.y=id1c,all=TRUE) plot(merged$1c,merged$2c) Cheers, Jonathan

Re: [R] write.csv() : attempt to set 'append' ignored... Why?

2010-07-15 Thread Jonathan Christensen
Out of curiosity, is this a change in 2.11? I'm still runnning 2.10.1, ?write.csv mentions the other options being ignored, but not append. This might also explain why John Kane believes he has successfully used append with write.csv in that past. Jonathan On Thu, Jul 15, 2010 at 9:36 AM, Marc

Re: [R] write.csv() : attempt to set 'append' ignored... Why?

2010-07-15 Thread Jonathan Christensen
Never mind, I found the answer to my own question. From the 2.11.0 change log: owrite.csv[2] no longer allow 'append' to be changed: as ever, direct calls to write.table() give more flexibility as well as more room for error. Jonathan On Thu, Jul 15, 2010 at 2:01 PM, Jonathan

Re: [R] Storing processed results back into original objects

2010-07-15 Thread Jonathan Christensen
(July 2009) You might want to ask yourself whether this is really the best way to achieve what you want to do. Jonathan On Thu, Jul 15, 2010 at 7:18 PM, Steven Kang stochastick...@gmail.comwrote: Hi all, There are matrices with same column names but arranged in different orders and I desire

Re: [R] Need help on index for time series object

2010-07-13 Thread Jonathan Christensen
Megh, I don't know whether this is the best way, but it works: seq(1,length(dat1))[!is.na(dat1)] [1] 1 2 4 5 6 9 10 Jonathan On Tue, Jul 13, 2010 at 1:58 PM, Megh Dal megh700...@yahoo.com wrote: Dear all, Please forgive me if there is a duplicate post; my previous mail perhaps

Re: [R] [R-pkgs] New package list for analyzing listsurveyexperiments

2010-07-13 Thread Jonathan Baron
', or 'lavaan' do? Why the aversion to informative names along the lines of 'Freq_dist_and_histogram', 'RandomTimeVariables', and 'Latent_Variable_Analysis', respectively? R.Raubertas -- Jonathan Baron, Professor of Psychology, University of Pennsylvania Home page: http://www.sas.upenn.edu

[R] select columns from vector of column names

2010-07-09 Thread Jonathan Flowers
Hi I want to extract columns from a data frame using a vector with the desired column names. This short example uses the select argument in the subset function to accomplish what I am trying to do. Is there a better solution? #names of desired columns colnames - c(col1,col3) #my data data -

[R] select columns from dataframe

2010-07-09 Thread Jonathan Flowers
Hi, I would like to extract columns from a dataframe using a vector of desired column names. The following working example uses the select argument in the subset function to accomplish what I am trying to do. Is there a better solution? Thanks. #my data data -

Re: [R] left end or right end

2010-07-01 Thread Jonathan Christensen
are trying to test, it's very hard for us to help you. Jonathan On Thu, Jul 1, 2010 at 7:45 AM, ravikumar sukumar ravikumarsuku...@gmail.com wrote: Sorry for posting to the R list. P Q 12, 28 10, 42 2, 5 1, 55 32, 50 22, 63 . there are 1

[R] Evaluating a string

2010-07-01 Thread Jonathan Greenberg
Rhelpers: How do I get R to evaluate a string, as if it was an R statement, e.g.: a=3 b=2 operator=- statement_string=paste(a,operator,b,sep=) --j __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] ggplot qplot bar removing bars when truncating scale

2010-06-30 Thread Jonathan Christensen
may be intentionally (whether by omission or commission) broken. Of course, there are ways around it--you could make your own bar chart using geom_rect, for example. Jonathan On Wed, Jun 30, 2010 at 9:12 AM, ml692787 matthew.lester@gmail.comwrote: I'm having problems with this example

Re: [R] Why the variation when creating .pdf file output for my plots?

2010-06-30 Thread Jonathan Christensen
Karl, dev2bitmap runs its output through Ghostscript, and I assume that the difference is somehow due to that. I can't say whether Ghostscript is decreasing the file quality or just doing something clever, though. Jonathan On Wed, Jun 30, 2010 at 10:30 AM, Karl Brand k.br...@erasmusmc.nl wrote

Re: [R] Embed function strips out date index

2010-06-30 Thread Jonathan Christensen
to line up, I can't really help you anymore from here. Jonathan On Wed, Jun 30, 2010 at 2:32 PM, Manussawee Sukunta msuku...@illinoisalumni.org wrote: Hi, I'm having especially hard time today and couldn't find any clue/answer through the internet. I hope you can help. I'm in a process

[R] using zoo() to coerce time series to a different reference frame

2010-06-29 Thread Jonathan Greenberg
Folks: I have two sets of dates, and one set of data: *** require(chron) require(zoo) reference_dates=seq.dates(01/01/92, 12/31/92, by = months) data_dates=seq.dates(01/15/91, 12/15/93, by = months) data=1:length(data_dates) reference_zoo=zoo(order.by=reference_dates)

[R] seq.dates in reverse?

2010-06-29 Thread Jonathan Greenberg
Pardon the barrage of time series related questions, but another issue I'm trying to solve is how to determine a sequence of dates a la seq.dates() except going BACKWARDS in time, e.g. if seq.dates() allowed for the to variables to be set alone, rather than the from=. Ultimately, I'd like to have

Re: [R] exists() and functions

2010-06-25 Thread Jonathan Greenberg
, Jonathan Greenberg greenb...@ucdavis.edu wrote: I'm a bit confused about how exists() work within a function -- I want to test for unassigned variables, but I'm doing tests in the main environment to figure out the function, so the variables DO exist in the parent environment of a function call

[R] exists() and functions

2010-06-25 Thread Jonathan Greenberg
I'm a bit confused about how exists() work within a function -- I want to test for unassigned variables, but I'm doing tests in the main environment to figure out the function, so the variables DO exist in the parent environment of a function call. Why does: myfunction -

[R] RSQLite and fetching rows from multiple tables

2010-06-21 Thread Jonathan Greenberg
I'm trying to use RSQLite statement to cycle through a large database in chunks via the fetch(...,n=2). As far as I can tell, however, it keeps re-fetching the same beginning set of rows -- any ideas what might be wrong with the following code? The select statement is pulling from multiple

[R] Fastest way to merge matrix columns into a comma delimited string?

2010-06-15 Thread Jonathan Greenberg
Folks: Say I have a matrix: test=matrix(c(1,2,3),nrow=10,ncol=3) I would like to have an output character vector where each line is row's values delimited by commas, e.g.: 1,2,3 2,3,1 3,1,2 ... 1,2,3 What is the fastest way of doing this? I can paste() row-by-row but this seems an

Re: [R] Matrix to database -- best practices/efficiency?

2010-06-08 Thread Jonathan Greenberg
= as.vector(my_matrix) ) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jonathan Greenberg Sent: Tuesday, 8 June 2010 12:34 PM To: r-help Subject: [R] Matrix to database -- best practices/efficiency? I have a matrix

[R] Matrix to database -- best practices/efficiency?

2010-06-07 Thread Jonathan Greenberg
I have a matrix of, say, M and N dimensions: my_matrix=matrix(c(1:60),nrow=6,ncol=10) I have two id vectors corresponding to the rows and columns, e.g.: id_m=seq(10,60,by=10) id_n=seq(100,1000,by=100) I would like to create a proper database (let's say a data.frame for this example -- i'm

Re: [R] create new variable: percentile value of variable in data frame

2010-05-30 Thread Jonathan Beard
are consistent. Any thoughts? Again, thanks so much, -Jon On Fri, May 28, 2010 at 4:06 PM, Stephan Kolassa stephan.kola...@gmx.de wrote: Hi Jon, does the empirical cumulative distribution function do what you want? dat$q.score - ecdf(dat$score)(dat$score) ?ecdf HTH Stephan Jonathan Beard

[R] create new variable: percentile value of variable in data frame

2010-05-28 Thread Jonathan Beard
Hello all, Thanks in advance for you attention. I would like to generate a third value that represents the quantile value of a variable in a data frame. # generating data x - as.matrix(seq(1:30)) y - as.matrix(rnorm(30, 20, 7)) tmp1 - cbind(x,y) dat - as.data.frame(tmp1) colnames(dat) - c(id,

<    1   2   3   4   5   6   >