Re: [R] subsetting tables

2011-09-07 Thread Petr PIKAL
Hi Hi Eik, greetings to Hamburg! :-) Thanks for the fast and helpful answer Eik Vettorazzi-2 wrote: #compare str(red[,2]) str(red[2,]) I understand that the first is a real vector of nums in R and the second is a ?? matrix/list/data.frame ?? of single ? entries? Can I

Re: [R] Alternatives to integrate?

2011-09-07 Thread Berend Hasselman
. wrote: Hi, continuing the improvements... I've prepared a new code: ddae - function(individuals, frac, sad, samp=pois, trunc=0, ...) { dots - list(...) Compound - function(individuals, frac, n.species, sad, samp, dots) { print(c(Size:, length(individuals), Compound

[R] suggestion for proportions

2011-09-07 Thread array chip
Hi, I am wondering if anyone can suggest how to test the equality of 2 proportions. The caveat here is that the 2 proportions were calculated from the same number of samples using 2 different tests. So essentially we are comparing 2 accuracy rates from same, say 100, samples. I think this is

Re: [R] check availability of a file in R

2011-09-07 Thread Samuel Le
Does file.exists answer to your question? file.exists(.RData) If you are not sure of the exact name of the file but know it contains .RData, you can try: List.files(directory,.RData) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf

[R] Error: in routine alloca() there is a stack overflow: thread 0, max 535822282KB, used 0KB, request 24B

2011-09-07 Thread D Brown
Dear Colleagues: Through your help an R related installation issue was resolved, but I now have the following usage issue. On any get.var.ncdf usage I am seeing: Error: in routine alloca() there is a stack overflow: thread 0, max 535822282KB, used 0KB, request 24B The same error is

[R] greyPalette() in legend plot

2011-09-07 Thread Rosario Garcia Gil
Hello I have a barplot where I get a grey gradient colors for each bar, I want to append a legend with the names of each bar and next to each name I need a box with the corresponding grey color. I managed to get the legend without boxes, but never got the wanted grey gradient in the legend:

[R] Signify level of significance

2011-09-07 Thread goong001
Im doing test on my sample using 1-sample Kolmogorov-smirnov test(poisson distribution) to specify my sample obtain avalanche effect. before i can compare my D value with the critical value(Dn, alpha), i have to specify which level of significance to use (eg. alpha = 0.01, 0.05, etc) and i don't

[R] Werid things when write.table

2011-09-07 Thread Damian Abalo
Hello, I am having some issues with the order write.table. The fact is that I need to use , as the decimal character and not . as default, and when I use: write.table(Sales,file=Sales.xls,quote=FALSE, sep = \t, dec = ,, row.names = FALSE, col.names = TRUE) It does it perfectly, but then, in a

Re: [R] function censReg in panel data setting

2011-09-07 Thread Igors
Dear Arne, Thank you for fixing the package. However I am still struggling to obtain model estmates. The same code: UpC - censReg(Power ~ Windspeed, left = -Inf, right = 2000,data=PData_In,method=BHHH,nGHQ = 4,start=c(-691.18,186.79,3.9,3.9)) Error in maxNRCompute(fn = logLikAttr, fnOrig =

[R] How does one start R within Emacs/ESS with root privileges?

2011-09-07 Thread Karl Brand
Esteemed UseRs and DevelopeRs, Apologies if this question belongs else where, but it does concern R's package installation/maintenance. How does one start R within Emacs/ESS with root privileges? I tried without success: M-x sudo R Why i'm motivated to do so: It seems logical to me, as

Re: [R] How does one start R within Emacs/ESS with root privileges?

2011-09-07 Thread Paul Hiemstra
On 09/07/2011 08:54 AM, Karl Brand wrote: Esteemed UseRs and DevelopeRs, Apologies if this question belongs else where, but it does concern R's package installation/maintenance. How does one start R within Emacs/ESS with root privileges? I tried without success: M-x sudo R Why i'm

Re: [R] Weight in Function RM

2011-09-07 Thread Thomas Lumley
On Wed, Sep 7, 2011 at 4:28 PM, Suphajak Ngamlak supha...@phatrasecurities.com wrote: Dear all, I am trying to do weighted regression using lm function in R. However, I have a question why the results from 1)      lm(formula = Y~aX, weight = w) 2)      lm(formula = wY~waX) are

Re: [R] mclust: modelName=E vs modelName=V

2011-09-07 Thread Nico902
What's wrong with that? (The values you submit as scale in prior are not fixed variances, but parameters of the prior distribtion - your problem may be that you believe that they are meant to be variances fixed by you!?) Yes I did, so I think it is not possible to fix the variance. Anyway,

[R] diversity map in r

2011-09-07 Thread azam jaafari
Hi   I want to make a grid map using diversity indices. I have a soil grid map with 7 class in r. how can I make a diversity map based on soil map in r?  I found something for calculation diversity in a table (.csv).   Thanks [[alternative HTML version deleted]]

Re: [R] Werid things when write.table

2011-09-07 Thread jim holtman
If your matrix is being converted to characters, then the conversion (and the use of '.' for decimal) is happening before the the write.table call. Do the cbinding without putting titles (characters) in the first line and then once the table is build, use 'colnames' to add the titles. It sounds

[R] linear regression, log-transformation and plotting

2011-09-07 Thread Johannes Radinger
Hello, I've some questions concerning log-transformations and plotting of the regression lines. So far as I know is it a problem to log-transform values smaller than 1 (0-1). In my statistics lecture I was told to do a log(x+1) transformation in such cases. So I provide here a small example to

Re: [R] function censReg in panel data setting

2011-09-07 Thread Arne Henningsen
Dear Igors On 7 September 2011 10:39, Igors igors.lahanc...@gmail.com wrote: However I am still struggling to obtain model estmates. The same code: UpC - censReg(Power ~ Windspeed, left = -Inf, right = 2000,data=PData_In,method=BHHH,nGHQ = 4,start=c(-691.18,186.79,3.9,3.9)) Error in

Re: [R] diversity map in r

2011-09-07 Thread Paul Hiemstra
On 09/07/2011 09:54 AM, azam jaafari wrote: Hi I want to make a grid map using diversity indices. I have a soil grid map with 7 class in r. how can I make a diversity map based on soil map in r? I found something for calculation diversity in a table (.csv). Thanks

Re: [R] suggestion for proportions

2011-09-07 Thread John Sorkin
From you description, you should not used a paired Student's t-test. One uses a paired test when pairs of observations come from the same experimental unit (and thus are correlated). You describe a study where each experimental unit is tested once and where there are two independent groups of

Re: [R] How does one start R within Emacs/ESS with root privileges?

2011-09-07 Thread Karl Brand
Cheers Paul. Its a very good point. Although i am curious how badly i can damage my R install by running as root. I always ran R in windows with admin. privileges without problems (touch wood). Probably best to never find out by sticking with user privileges. However, even for taking care

[R] show equal entries in data.frame

2011-09-07 Thread Martin Batholdy
Hi, I have the following data-frame: x - data.frame(first = c('a','c','k','b'), second = c('b','k','a','j'), third = c('f','a','h','b')) first second third 1 a b f 2 c k a 3 k a h 4 b j b Now I would like to see wether there are entries

Re: [R] Signify level of significance

2011-09-07 Thread David Winsemius
On Sep 7, 2011, at 3:02 AM, goong001 wrote: Im doing test on my sample using 1-sample Kolmogorov-smirnov test(poisson distribution) to specify my sample obtain avalanche effect. before i can compare my D value with the critical value(Dn, alpha), i have to specify which level of

Re: [R] show equal entries in data.frame

2011-09-07 Thread David Winsemius
On Sep 7, 2011, at 8:15 AM, Martin Batholdy wrote: Hi, I have the following data-frame: x - data.frame(first = c('a','c','k','b'), second = c('b','k','a','j'), third = c('f','a','h','b')) first second third 1 a b f 2 c k a 3 k a h 4 b j

Re: [R] linear regression, log-transformation and plotting

2011-09-07 Thread John C Frain
I think that you have not understood your lecturer. You can log transform any positive number. You can not log transform a negative number. Adding a constant to a negative number to make it constant before log transformation is sometimes suggested by those who do not understand what they are

Re: [R] suggestion for proportions

2011-09-07 Thread Bert Gunter
Please! ... ?prop.test not t tests. -- Bert -- On Wed, Sep 7, 2011 at 4:21 AM, John Sorkin jsor...@grecc.umaryland.edu wrote: From you description, you should not used a paired Student's t-test. One uses a paired test when pairs of observations come from the same experimental unit (and

Re: [R] suggestion for proportions

2011-09-07 Thread Viechtbauer Wolfgang (STAT)
Acutally, ?mcnemar.test since it is paired data. Best, Wolfgang -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Bert Gunter Sent: Wednesday, September 07, 2011 15:34 To: John Sorkin Cc: r-help@r-project.org Subject: Re:

[R] Poly-phase Filters in R

2011-09-07 Thread Eran Eidinger
Hello List, I am trying to do the following: 1. Use a BandPassFilter h[n] on a series x[n] 2. Then Decimate the series by a factor D such that y[k]=x[k*D] The decimation factor is considerable (10,000) so that filtering before the decimation, using convolve(), seems foolish. Can you think of an

[R] reshaping data

2011-09-07 Thread B77S
I have the following data (see RawData using dput below) How do I get it in the following 3 column format (CO2 measurements are the elements of the original data frame). I'm sure the package reshape is where I should look, but I haven't figured out how. Thanks ahead of time Month Year CO2

Re: [R] suggestion for proportions

2011-09-07 Thread Bert Gunter
Wolfgang: On Wed, Sep 7, 2011 at 7:28 AM, Viechtbauer Wolfgang (STAT) wolfgang.viechtba...@maastrichtuniversity.nl wrote: Acutally, ?mcnemar.test since it is paired data. Actually, it is unclear to me from the OP's message whether this is the case. In one sentence the OP says that the

Re: [R] suggestion for proportions

2011-09-07 Thread Bert Gunter
Oh ... I should have added that either option could be handled by glm(), of course (provided that you're willing to accept the approximate tests). But this is getting OT. -- Bert On Wed, Sep 7, 2011 at 7:28 AM, Viechtbauer Wolfgang (STAT) wolfgang.viechtba...@maastrichtuniversity.nl wrote:

Re: [R] greyPalette() in legend plot

2011-09-07 Thread Jack Siegrist
Hi, Using legend as an argument within the call to barplot will automatically add the color key to the legend. I don't know how to add the colors using legend separately. Try this revised code: y -

Re: [R] r-help volcano plot

2011-09-07 Thread KnifeBoot
Using R version 2.13.1 Windows 7 Ultimate 64-bit At 2011-09-06 14:51:09,Hasan Diwan hasan.di...@gmail.com wrote: On 6 September 2011 08:01, KnifeBoot knifeb...@163.com wrote:  Can't installe packag maDB or limma. Which R version, and what platform are you using? -- Sent from my mobile device

[R] Save Workspace Image? problem at start up

2011-09-07 Thread Chandrasekhar Rudrappa
Dear Sir, I am using R 2.13.1. Since yesterday when I start the Rgui the message Save Workspace Image? shows up immediately on opening. Even if I cancel, it does not get cancelled. If I select either no or yes, it quits. I do not know all of a sudden what happened? Right from yesterday I am

[R] Handling ever growing data in svm predictions

2011-09-07 Thread Divyam
Hi, I am new to R and here is what I am doing in it now. I am using machine learning technique (svm) to do predictions. The data that I am using is one that is bound to grow perpetually. what I want to know is, say, I fed in a data set with 5000 data points to svm initially. The algorithm derives

[R] predictive modeling and extremely large data

2011-09-07 Thread Divyam
Hi, I am new to R and here is what I am doing in it now. I am using machine learning technique (svm) to do predictive modeling. The data that I am using is one that is bound to grow perpetually. what I want to know is, say, I fed in a data set with 5000 data points to svm initially. The algorithm

Re: [R] Werid things when write.table

2011-09-07 Thread Damian Abalo
It works now. It is much more appropiate to add the titles than to add a column with strings, and, in fact, it were rownames, not column names (thats why colnames was set to true). Anyway using rownames instead of adding an aditional column and setting row.names to true in the write.trable works

[R] (no subject)

2011-09-07 Thread Varsha Agrawal
The code looks like this: L1=list(a=1,b=2,c=3) f1=as.factor(c) L1[[f1]] returns 1 What happens if we give a factor as an index at a list? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Help on the multivariate interpolation with R

2011-09-07 Thread Rachida El Mehdi
Hello, I work on the Stochastic Frontier Analysis (SFA) and I am looking for a function in a R package which done the multivariate interpolation. My problem is: For all i=1, ..., n, I have values of (xi1, xi2, ..., xi7)in IR^7 and f(xi1, xi2, ..., xi7)in IR and I have also values of (x'i1,

Re: [R] function censReg in panel data setting

2011-09-07 Thread Igors
Dear Arne, I have sent you an e-mail to your e-mail at gmail.com. There I have attached my data set and the code for this particular problem. I hope to hear from you soon. Many thanks in advance! Igors -- View this message in context:

[R] Overall SSR in plm package

2011-09-07 Thread Igors
Dear all, I estimate Fixed-effects model. Since it use within transformation, it also reports within SSR in summary report. The problem is that I need overall SSR. How can I quickly compute it? Thanks in advance! Best wishes, Igors -- View this message in context:

Re: [R] r-help volcano plot

2011-09-07 Thread Duny
Ben - I'm sorry, you're right! The following website shows how to make a volcano plot using ggplot2. http://bioinformatics.knowledgeblog.org/2011/06/21/volcano-plots-of-microarray-data/ Enjoy! Anna -- View this message in context:

Re: [R] Problem with by statement for spaghetti plots

2011-09-07 Thread dadrivr
Bump, please help! -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-by-statement-for-spaghetti-plots-tp3788536p3796131.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] Change properties of line summary in interaction.plot

2011-09-07 Thread dadrivr
Can anybody help me with this? -- View this message in context: http://r.789695.n4.nabble.com/Change-properties-of-line-summary-in-interaction-plot-tp3788614p3796133.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org

[R] process id of an R script

2011-09-07 Thread Mikkel Grum
I have a script that runs as a cron job every minute (on Ubuntu 10.10 and R 2.11.1), querying a database for new data. Most of the time it takes a few seconds to run, but once in while it takes more than a minute and the next run starts (on the same data) before the previous one has finished.

[R] Reshaping data from wide to tall format for multilevel modeling

2011-09-07 Thread dadrivr
Hi, I'm trying to reshape my data set from wide to tall format for multilevel modeling. Unfortunately, the function I typically use (make.univ from the multilevel package) does not appear to work with unbalanced data frames, which is what I'm dealing with. Below is an example of the columns of

Re: [R] reshaping data

2011-09-07 Thread Justin Haynes
look at the melt function in reshape, specifically ?melt.data.frame require(reshape) Raw.melt-melt(RawData,id.vars='Year',variable_name='Month') there is an additional feature in the melt function for handling na values. names(Raw.melt)[3]-'CO2' head(Raw.melt) Year MonthCO2 1 1958 J

Re: [R] (no subject)

2011-09-07 Thread R. Michael Weylandt
Is this meant to be a follow up to something? In short, the answer to your question is how factors are encoded as integers in R. If you run something similar to this code (except that actually runs) you'll note that as.numeric(f1) = 1. Michael On Wed, Sep 7, 2011 at 5:04 AM, Varsha Agrawal

Re: [R] Generalizing call to function

2011-09-07 Thread Jean V Adams
Try this: funa - function(n, y, a, rate, samp) { lambda - a * n dexp(n, rate) * do.call(paste(d, samp, sep=), y, lambda) } funb - function(y, a, rate, samp) { integrate(f1, 0, Inf, y, a, rate) } funb(1, 0.1, 0.1, pois) Jean Hello guys, I

Re: [R] suggestion for proportions

2011-09-07 Thread Viechtbauer Wolfgang (STAT)
Indeed, the original post leaves some room for interpretation. In any case, I hope the OP has enough information now to figure out what approach is best for his data. Best, Wolfgang -Original Message- From: Bert Gunter [mailto:gunter.ber...@gene.com] Sent: Wednesday, September 07,

Re: [R] (no subject)

2011-09-07 Thread David Winsemius
On Sep 7, 2011, at 6:04 AM, Varsha Agrawal wrote: The code looks like this: L1=list(a=1,b=2,c=3) f1=as.factor(c) L1[[f1]] returns 1 What happens if we give a factor as an index at a list? In a virgin session of R there would be no 'c' for the second line to work with. And since 'c' is a

Re: [R] predictive modeling and extremely large data

2011-09-07 Thread Steve Lianoglou
Hi, On Wed, Sep 7, 2011 at 5:25 AM, Divyam divyamural...@gmail.com wrote: Hi, I am new to R and here is what I am doing in it now. I am using machine learning technique (svm) to do predictive modeling. The data that I am using is one that is bound to grow perpetually. what I want to know is,

Re: [R] What happens if we give a factor as an index at a list?

2011-09-07 Thread Jean V Adams
Varsha Agrawal wrote on 09/07/2011 05:18:10 AM: The code looks like this: L1=list(a=1,b=2,c=3) f1=as.factor(c) L1[[f1]] returns 1 What happens if we give a factor as an index at a list? L1=list(a=1,b=2,c=3) f1=as.factor(L1$c) L1[[f1]] When you use a factor (e.g., f1, corrected

Re: [R] Change properties of line summary in interaction.plot

2011-09-07 Thread David Winsemius
On Sep 7, 2011, at 9:46 AM, dadrivr wrote: Can anybody help me with this? Your chances of a meaningful reply would increase considerably if you first read the Posting Guide and also followed the other guidance seen at the bottom of every rhelp posting. -- View this message in

Re: [R] reshaping data

2011-09-07 Thread B77S
The terminology (melt, cast, recast) just isn't intuitive to me; but I understand how to use melt now. Thanks! Justin Haynes wrote: look at the melt function in reshape, specifically ?melt.data.frame require(reshape) Raw.melt-melt(RawData,id.vars='Year',variable_name='Month') there

Re: [R] Problem with by statement for spaghetti plots

2011-09-07 Thread David Winsemius
On Sep 7, 2011, at 9:45 AM, dadrivr wrote: Bump, please help! When I encounter one of these Nabble bump messages doing my moderation duties I simply discard it. This is not a website. This is a mailing list. If you didn't get an answer it suggests that your example was not

Re: [R] process id of an R script

2011-09-07 Thread Charles Berry
Mikkel Grum mi2kelgrum at yahoo.com writes: I have a script that runs as a cron job every minute (on Ubuntu 10.10 and R 2.11.1), querying a database for new data. Most of the time it takes a few seconds to run, but once in while it takes more than a minute and the next run starts (on the

Re: [R] How does one start R within Emacs/ESS with root privileges?

2011-09-07 Thread Spencer Graves
Under Vista and Windows 7, I install R in a local directory pgms so I never have to worry about permissions. Under Linux, I use su not sudo. Then I call R and install.packages. Then I quit R and su and continue with what I want. hope this helps. Spencer On 9/7/2011 5:11 AM, Karl Brand

Re: [R] Generalizing call to function

2011-09-07 Thread Berend Hasselman
. wrote: Hello guys, I would like to ask for help to understand what is going on in func2. My plan is to generalize func1, so that are expected same results in func2 as in func1. Executing func1 returns... 0.25 with absolute error 8.4e-05 But for func2 I get... Error in dpois(1,

Re: [R] error building package: packaging into .tar.gz failed

2011-09-07 Thread Juliet Hannah
To follow up (because I received a few emails off-list), things work now. I'm not sure what I did differently. In case it is helpful: I reinstalled R tools, and edited by path so that C:\Rtools\bin;C:\Rtools\perl\bin;C:\Rtools\MinGW\bin;C:\Program files\R\R-2.13.1\bin;C:\Program Files\HTML Help

[R] 3-Way Crosstab using survey package

2011-09-07 Thread Rachel Licata
Hello, I am wondering if it is possible, or what the correct way to code a three-way crosstab in R using the survey package? I have been using the following code to complete two way crosstabs, but have not seen any three-way code. Two-Way: svyby(~factor(a), ~factor(b), data, svymean) Thanks!

[R] Hessian matrix issue

2011-09-07 Thread Ravi Varadhan
Yes, numDeriv::hessian is very accurate. So, I normally take the output from the optimizer, *if it is a local optimum*, and then apply numDeriv::hessian to it. I, then, compute the standard errors from it. However, it is important to know that you have obtained a local optimum. In fact, you

Re: [R] Hessian matrix issue

2011-09-07 Thread Ravi Varadhan
However, it is not known whether the standard errors obtained from this Hessian are asymptotically valid. Let me rephrase this. I think that as a measure of dispersion, the standard error obtained using the augmented Lagrangian algorithm is correct. However, what is *not known* is the

[R] reporting ANOVA for nested models

2011-09-07 Thread zugi young
I have the following results for an ANOVA comparing two nested models. I wasn't sure how I am supposed to report this result in the area of psychology. Specifically, am I supposed to report the DF's or just the F ratio? I could manually calculate the degrees of freedoms, but there must be a reason

Re: [R] Possible to access a USB volume by name in windows

2011-09-07 Thread Joshua Wiley
Well that is really on the windows end, not the R end (which may not make it any less surprising). I would not be surprised if there was an easier way using .net or vbs which I get the sense is partly where some things are going (e.g., with the so-called PowerShell), but I am not terribly

[R] rpart/tree issue

2011-09-07 Thread Brian Jensvold
I am trying to create a classification tree using either tree or rpart but when it comes to plotting the results the formatting I get is different than what I see in all the tutorials. What I would like to see is the XX/XX format but all I get is a weird decimal value. I was also wondering how

[R] Subsetting does not remove unwanted data in table

2011-09-07 Thread Scott Bearer
Dear all, This relatively routine analysis has left me frustrated and in a rut. I have a dataset (data1), which I subset in order to remove rows where HabitatDensity=Med. This dataset looks correct when I call it up, however, when I create a table out of the new subset (data2), my table

Re: [R] Problem with by statement for spaghetti plots

2011-09-07 Thread dadrivr
Sorry, I thought the link would work for people because it is a public link and it works for me when I run it in R. Anyways, here is an example set of data that I am having trouble with: /id - c(230017,230017,230017,230018,230018,230018,230019,230019,230019,230020,230020,

Re: [R] Possible to access a USB volume by name in windows

2011-09-07 Thread Gene Leynes
Thank you. This is a nice trick, and it works fine for my needs. It's surprising that there isn't a simple way to get to the drive name. On Tue, Sep 6, 2011 at 10:41 PM, Joshua Wiley jwiley.ps...@gmail.comwrote: Hi, This comes with absolutely no guarantees (and a good recommendation to be

[R] access objects

2011-09-07 Thread Berry Boessenkool
hi, say I have consecutively numbered objects obj1, obj2, ... in my R workspace. I want to acces one of them inside a function, with the number given as an argument. Where can I find help on how to do that? Somebody must have been trying to do this before... Some keywords to start a search

[R] Testing non-exhaustive Null and Alternative Hypothesis

2011-09-07 Thread Michael Grant
I wish to test the hypothesis of mu equal to or less than 5 against the specific alternative mu equal to or greater than 7. I am unable to find how to persuade R to do this with any function (e.g. t.test). Suggestions? Michael Grant [[alternative HTML version deleted]]

[R] randomForest memory footprint

2011-09-07 Thread John Foreman
Hello, I am attempting to train a random forest model using the randomForest package on 500,000 rows and 8 columns (7 predictors, 1 response). The data set is the first block of data from the UCI Machine Learning Repo dataset Record Linkage Comparison Patterns with the slight modification that I

Re: [R] Change properties of line summary in interaction.plot

2011-09-07 Thread dadrivr
Here's an example: /id - c(17,17,17,18,18,18,19,19,19,20,20,20,21,21,21,22,22,22,23,23,23,24, 24,24,25,25,25,26,26,26) age - rep(c(30,36,42),10) outcome - c(12,17,10,5,5,2,NA,NA,NA,8,6,5,11,13,10,15,11,15,13,NA,9,0,0,0,20, 14,16,1,2,2) mydata -

[R] Imposing Feller condition using project constraint in spg

2011-09-07 Thread Kristian Lind
Dear R-users, I'm running a maximization problem in which I want to impose a condition on the relationship between 2 parameters. The condition is that w[4] = (1+eps)/(2*w[1]), or equivalently w[4]*w[1] = (1+eps)/2 , where eps is some small positive constant. I've been trying to formulate a

Re: [R] Subsetting does not remove unwanted data in table

2011-09-07 Thread Ben Bolker
Scott Bearer sbearer at TNC.ORG writes: Dear all, This relatively routine analysis has left me frustrated and in a rut. I have a dataset (data1), which I subset in order to remove rows where HabitatDensity=Med. This dataset looks correct when I call it up, however, when I create a

Re: [R] access objects

2011-09-07 Thread R. Michael Weylandt
The get() function should get you where you need. Michael Weylandt On Wed, Sep 7, 2011 at 12:53 PM, Berry Boessenkool berryboessenk...@hotmail.com wrote: hi, say I have consecutively numbered objects obj1, obj2, ... in my R workspace. I want to acces one of them inside a function, with

Re: [R] Change properties of line summary in interaction.plot

2011-09-07 Thread David Winsemius
On Sep 7, 2011, at 3:46 PM, dadrivr wrote: Here's an example: /id - c(17,17,17,18,18,18,19,19,19,20,20,20,21,21,21,22,22,22,23,23,23,24, 24,24,25,25,25,26,26,26) age - rep(c(30,36,42),10) outcome - c(12,17,10,5,5,2,NA,NA,NA,8,6,5,11,13,10,15,11,15,13,NA,9,0,0,0,20,

Re: [R] Testing non-exhaustive Null and Alternative Hypothesis

2011-09-07 Thread Duncan Murdoch
On 07/09/2011 3:46 PM, Michael Grant wrote: I wish to test the hypothesis of mu equal to or less than 5 against the specific alternative mu equal to or greater than 7. I am unable to find how to persuade R to do this with any function (e.g. t.test). Suggestions? According to the standard

Re: [R] Problem with by statement for spaghetti plots

2011-09-07 Thread Dennis Murphy
Hi: Your code doesn't work, but if you want to do spaghetti plots, they're rather easy to do in ggplot2 or lattice. The first problem you have is that one group in your test data has all NA responses, so by() or any other groupwise summarization function is going to choke unless you give it a

Re: [R] reporting ANOVA for nested models

2011-09-07 Thread Daniel Malter
fit1, the unrestricted model, includes 1 more regressor than fit2, the restricted model. Testing the models against each other means that fit2 is equal to fit1, assuming that the coefficient on the additional regressor that is included in fit1 is restricted to zero. Your F-test is thus whether

[R] Using substitute on a function parameter

2011-09-07 Thread Saptarshi Guha
Hello, I would like to write a function where substitute operates on the parameter, but ... Expression = function(o,l) substitute(o, l) Expression({x=.(FOO)}, list(FOO=2)) o How do i get substitute to work on the contents of o. Regards Saptarshi

Re: [R] Using substitute on a function parameter

2011-09-07 Thread William Dunlap
I have used do.call(substitute, ...) to work around the fact that substitute does not evaluate its first argument: R z - quote(func(arg)) R do.call(substitute, list(z, list(func=quote(myFunction), arg=as.name(myArgument myFunction(myArgument) S+'s substitute (following S version 4)

Re: [R] Problem with by statement for spaghetti plots

2011-09-07 Thread Dennis Murphy
Hi: Having just seen your follow-up question, here's how it could be done in ggplot2 or lattice: # ggplot2 version: ggplot(w, aes(x = age, y = outcome)) + geom_line(aes(group = .id)) + stat_summary(fun.y = 'mean', geom = 'line', color = 'blue', size = 2) # lattice version: xyplot(outcome ~

Re: [R] Using substitute on a function parameter

2011-09-07 Thread David Winsemius
On Sep 7, 2011, at 5:20 PM, Saptarshi Guha wrote: Hello, I would like to write a function where substitute operates on the parameter, but ... Expression = function(o,l) substitute(o, l) Expression({x=.(FOO)}, list(FOO=2)) o How do i get substitute to work on the contents of o. I

Re: [R] reporting ANOVA for nested models

2011-09-07 Thread peter dalgaard
On Sep 7, 2011, at 20:57 , zugi young wrote: I have the following results for an ANOVA comparing two nested models. I wasn't sure how I am supposed to report this result in the area of psychology. Specifically, am I supposed to report the DF's or just the F ratio? I could manually calculate

Re: [R] suggestion for proportions

2011-09-07 Thread array chip
Hi all, thanks very much for sharing your thoughts. and sorry for my describing the problem not clearly, my fault. My data is paired, that is 2 different diagnostic tests were performed on the same individuals. Each individual will have a test results from each of the 2 tests. Then in the end,

[R] Fwd: FSelector and RWeka problem

2011-09-07 Thread Yanwei Song
Hi all, Although I sent the mail to Piotr, the author of FSelector, it should be better to ask here to let others know. Yanwei Begin forwarded message: From: Yanwei Song yanwei.s...@gmail.com Date: September 7, 2011 4:41:58 PM EDT To: p.roman...@stud.elka.pw.edu.pl Subject: FSelector and

Re: [R] Application of results from smooth.spline outside R

2011-09-07 Thread Jesper
Hi Jean, Thanks for the reply.. Using your suggestion, I end up in in the source code (Fortran 77 i believe). At first look, it seems a bit more tedious to implement than I expected. -- View this message in context:

[R] finding events in a time duration.

2011-09-07 Thread Vineet Shukla
Hi, Premises: I have a database which contain the list of events and their time stamps (This is a Unix time stamps) What I want to do : I want know how much is the maximum occurrence of this in any a time period of 7 days or does a event occur es more than N (say 5) times in a period of 7 days.

Re: [R] access objects

2011-09-07 Thread Berry Boessenkool
Thanks! That's exactly it. get gets it ;-) Berry From: michael.weyla...@gmail.com Date: Wed, 7 Sep 2011 14:54:48 -0500 Subject: Re: [R] access objects To: berryboessenk...@hotmail.com CC: r-help@r-project.org The get() function should get you where you need. Michael Weylandt On Wed, Sep

[R] Editing the variables attributes section in the netCDF header of netCDF files created using the package ncdf.

2011-09-07 Thread Ross Maidment
Hi, I am using the package ncdf to create netCDF files and I want to mimic the the header of an exiting netCDF file created outside of R. Below is what the existing header looks like (part of it that is different): netcdf ccd1984_05_08 { dimensions: lat = 1974 ; lon = 1894 ;

Re: [R] Change properties of line summary in interaction.plot

2011-09-07 Thread dadrivr
David Winsemius wrote: What mean summary line? I count 8 lines and that matches the number if id's with complete data. Yea, I don't know why there is no mean summary line showing up. I requested it in the interaction.plot statement (fun = mean), and I don't get any errors. Any ideas? --

[R] ggplot2-Issue placing error bars behind data points

2011-09-07 Thread Nathan Miller
Hi all, This seems like a basic problem, but no amount of playing with the code has solved it. I have a time-series data set like that shown below (only longer) and am seeking to plot the data with filled, circular points and error bars. I would like the error bars to be behind the points

Re: [R] finding events in a time duration.

2011-09-07 Thread Jeff Newmiller
You could phrase this in most dialects of SQL, but you don't say what kind of database you are using and this is not a SQL help list. You could also look at the rollapply function in the zoo package. --- Jeff Newmiller The

Re: [R] Change properties of line summary in interaction.plot

2011-09-07 Thread David Winsemius
On Sep 7, 2011, at 4:49 PM, dadrivr wrote: David Winsemius wrote: What mean summary line? I count 8 lines and that matches the number if id's with complete data. Yea, I don't know why there is no mean summary line showing up. I requested it in the interaction.plot statement (fun =

Re: [R] ggplot2-Issue placing error bars behind data points

2011-09-07 Thread Jeff Newmiller
Add geom_errorbar() before adding geom_point() ? --- Jeff Newmiller The . . Go Live... DCN:jdnew...@dcn.davis.ca.us Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries

Re: [R] finding events in a time duration.

2011-09-07 Thread R. Michael Weylandt michael.weyla...@gmail.com
I think (no promises) roll.apply() from the zoo package with sum can count occurrences in whatever time period. Then use a logical test to identify sufficiently active periods. Hope this helps, Michael Weylandt On Sep 7, 2011, at 4:07 PM, Vineet Shukla shuklvin...@gmail.com wrote: Hi,

Re: [R] Editing the variables attributes section in the netCDF header of netCDF files created using the package ncdf.

2011-09-07 Thread David William Pierce
On Wed, Sep 7, 2011 at 2:25 PM, Ross Maidment r.i.maidm...@pgr.reading.ac.uk wrote: Hi, I am using the package ncdf to create netCDF files and I want to mimic the the header of an exiting netCDF file created outside of R. Below is what the existing header looks like (part of it that is

Re: [R] finding events in a time duration.

2011-09-07 Thread Vineet Shukla
Hi Jeff, My question is not related with SQL. I have all the data available in a csv file. I am looking for R algorithm where can specify a time period and then R essentially uses this time period as a sliding window for all the event-time stamps and gives a significant distribution of

Re: [R] Application of results from smooth.spline outside R

2011-09-07 Thread Spencer Graves
Hi, Jesper: Where Outside R do you want to use it? There are R interfaces to many other software packages, and many that cannot easily link to R can link to Fortran. You could use library(sos) to search for R packages to connect to whatever. Hope this helps.

[R] rgl 'how-to's

2011-09-07 Thread Dale Coons
Doing a visual graphic and trying to make it pretty Here's simple chart to play with: library(rgl) dotframe-data.frame(x=c(0,7,0,0,-7,0),y=c(0,0,7,0,0,-7),z=c(7,0,0,-7,0,0)) dotframe plot3d(dotframe$x,dotframe$y,dotframe$z, radius=3,

  1   2   >