Re: [R] zero line

2013-03-18 Thread PIKAL Petr
Hi -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of bgnumis Sent: Sunday, March 17, 2013 4:12 PM To: r-help@r-project.org Subject: [R] zero line Hi all, I´m plotting cf (with two axis) and addind a shaded color up and

[R] how to plot u-v wind by R?

2013-03-18 Thread Jie Tang
hi R users: I have a dataset including u wind in x-axis and v wind in y-axis. How can I plot the u,v wind data in vector or barb figure? which command ? thank you . -- TANG Jie [[alternative HTML version deleted]] __

Re: [R] how to plot u-v wind by R?

2013-03-18 Thread Jim Lemon
On 03/18/2013 08:50 PM, Jie Tang wrote: hi R users: I have a dataset including u wind in x-axis and v wind in y-axis. How can I plot the u,v wind data in vector or barb figure? which command ? thank you . Hi Jie, Maybe the vectorField function (plotrix)? Jim

Re: [R] plotting CIE chromaticity diagram?

2013-03-18 Thread Bryan Hanson
As it turns out, I am working on this right now, and it's a bit of a challenge to get the color gradient correct. I don't think this is really the right kind of question for this list, so let's see if anyone has attempted it or has ideas, and then take the conversation private. I can send you

Re: [R] plotting CIE chromaticity diagram?

2013-03-18 Thread Ken Knoblauch
ishi soichi soichi777 at gmail.com writes: Has anyone plotted or is it possible to plot CIE *xy* chromaticity diagram http://en.wikipedia.org/wiki/File:CIE1931xy_blank.svg I need this plot in color. ishida I think that plotting the spectral locus and the line of purples is trivial,

Re: [R] plotting CIE chromaticity diagram?

2013-03-18 Thread Ken Knoblauch
ishi soichi soichi777 at gmail.com writes: Has anyone plotted or is it possible to plot CIE *xy* chromaticity diagram http://en.wikipedia.org/wiki/File:CIE1931xy_blank.svg I need this plot in color. ishida sermon And following up on my previous mail (diatribe), after having

Re: [R] plotting CIE chromaticity diagram?

2013-03-18 Thread Bryan Hanson
I am, unfortunately, well-aware of the limitations that Ken points out (and I do appreciate him making these points). One can readily demonstrate the gamut limitations by printing the diagram Ishida links to on different devices. My hope is to get something close and include a disclaimer.

Re: [R] plotting CIE chromaticity diagram?

2013-03-18 Thread Ken Knoblauch
Unfortunately, a bad idea that looks good never dies. That said, I still think that it is an interesting challenge to create this graph by programming. I can imagine that if you specified the coordinates at a certain number of points in the interior and along the spectrum locus, you could use

Re: [R] Q-Q plot for chi-quadrat w/o knowing the contingency table

2013-03-18 Thread Michael Dewey
At 14:56 17/03/2013, Wim Kreinen wrote: Hello, I have chi2-values from 2x2 contingency tables, each degree of freedom =1. But I dont know the values of the contingency table. All I have in addtion: The allelic odds ratio. Now I would like to do a Q-Q-plot. Is that possible? If I understand

[R] How many samples ACTUALLY used in regression?

2013-03-18 Thread Federico Calboli
Dear All, is there a simple way that covers all regression models to extract the number of samples from a data frame/matrix actually used in a regression model? For instance I might have a data of 100 rows and 4 colums (1 response + 3 explanatory variables). If 3 samples have one or more NAs

Re: [R] Counting confidence intervals

2013-03-18 Thread Jim Silverton
Hi, I have a 2 x 1 matrix of confidence intervals. The first column is the lower and the next column is the upper. I want to cont how many times a number say 12 lies in the interval. Can anyone assist? -- Thanks, Jim. [[alternative HTML version deleted]]

Re: [R] !0 + !0 == !0 - !0

2013-03-18 Thread Ben Bolker
Bert Gunter gunter.berton at gene.com writes: But this has nothing to do with 7.31 and everything to do with operator precedence and automatic casting from integers to logical and vice-versa. I also think it fair to say that all (??) languages have these sorts of malapropisms due to

Re: [R] How many samples ACTUALLY used in regression?

2013-03-18 Thread Ben Bolker
Federico Calboli f.calboli at imperial.ac.uk writes: is there a simple way that covers all regression models to extract the number of samples from a data frame/matrix actually used in a regression model? For instance I might have a data of 100 rows and 4 colums (1 response + 3

Re: [R] Counting confidence intervals

2013-03-18 Thread Jorge I Velez
Hi Jim, Try either of the following (untested): sum( x[1, ] 12 x[2, ] 12) sum(apply(x, 2, function(x) x[1] 12 x[2] 12)) where x is your 2x1000 matrix. HTH, Jorge.- On Tue, Mar 19, 2013 at 12:03 AM, Jim Silverton wrote: Hi, I have a 2 x 1 matrix of confidence intervals. The

Re: [R] Counting confidence intervals

2013-03-18 Thread Jeff Newmiller
sum(M[1]12 12=M[2]) untested, no data --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go...

[R] header intact

2013-03-18 Thread Kamal Kishore
-- Thanks Regards, Kamal Kishore Research Scholar Department of Biostatistics National Institute of Mental Health and Neuro Sciences (NIMHANS) Banglore-560029 Mob-+91-9591349768 Email:kamalkishorest...@gmail.com [[alternative HTML version deleted]]

[R] try/tryCatch

2013-03-18 Thread lisa
Hi All, I have tried every fix on my try or tryCatch that I have found on the internet, but so far have not been able to get my R code to continue with the for loop after the lmer model results in an error. Here is two attemps of my code, the input is a 3D array file, but really any function

[R] biclustering error in drawHeatmap

2013-03-18 Thread Bart Cuypers
Hi Everyone, I have a problem that keeps occurring using the biclust function (info below). Does anyone have an idea what is going wrong? Best Wishes and thank you, Bart library(biclust) data-read.table(file.choose(), header = T, sep = \t) data2-as.matrix(data[,-1])

[R] Problem with generated parameter estimates

2013-03-18 Thread Kamal Kishore
Dear All, I would be very grateful for your help concerning the following question: Below mentioned programme is available on net to generate longitudinal data. Usually we get almost same parameter estimates as used to generate the data. The problem here is I am not able to get it for data used

Re: [R] date time manipulation- R 2.15.1 windows 7

2013-03-18 Thread yash kajaria
Hi Arun, Thank u so much for your help. It helped me solve the problem THANK YOU -Yashvardhan Kajaria On Thu, Mar 14, 2013 at 11:28 PM, arun smartpink...@yahoo.com wrote: HI, 1. date1-c(5 jan 2013, 1 jan 2013) date1-as.Date(date1,format=%d %b %Y) date1[1]-date1[2] #Time difference of 4

[R] save scores from sem

2013-03-18 Thread marKo
I'm not aware of any routine that those the job, although I think that it could be relatively easily done by multiplication the manifest variable vector with the estimates for the specific effect. To make an example: v1; v2; v3; v4 are manifest variables that loads on one y latent variablein

[R] Assign Observations to Tree Nodes

2013-03-18 Thread Jeff Coughlin
Hi, is there a way to assign observations from a dataset to nodes of a tree?   For example, if I have a data frame like the following: ID Var1 Var2 Var3 … VarX 1           .           .           .           n           And then run a classification tree with

Re: [R] Counting confidence intervals

2013-03-18 Thread arun
Hi, Try this: set.seed(25) mat1- matrix(cbind(sample(1:15,20,replace=TRUE),sample(16:30,20,replace=TRUE)),ncol=2)  nrow(mat1[sapply(seq_len(nrow(mat1)),function(i) any(seq(mat1[i,1],mat1[i,2])==12)),]) #[1] 17 set.seed(25) mat2-

[R] Problem with write.table

2013-03-18 Thread Sahana Srinivasan
Hi everyone, I'm trying to create unique filenames and then write a data frame into these files. This is the code I am using. str1-fname str2-.ext.txt; FILENAME-paste0(str1,str2); write.table(df, file=FILENAME,col.names=FALSE,row.names=FALSE,quote=FALSE,sep=\t); Ideally, a file called

Re: [R] Counting confidence intervals

2013-03-18 Thread Jim Silverton
Thanks. Jeff On Mon, Mar 18, 2013 at 9:30 AM, Jeff Newmiller jdnew...@dcn.davis.ca.uswrote: sum(M[1]12 12=M[2]) untested, no data --- Jeff NewmillerThe . . Go Live...

Re: [R] Counting confidence intervals

2013-03-18 Thread Jorge I Velez
Thats cumbersome, Arun. sum(mat1[,1] 12 mat1[,2] 12) [1] 17 will do the job and even faster: system.time(replicate(1, sum(mat1[,1] 12 mat1[,2] 12))) # user system elapsed # 0.067 0.001 0.078 HTH, Jorge.- On Tue, Mar 19, 2013 at 1:06 AM, arun wrote: Hi, Try this:

Re: [R] Counting confidence intervals

2013-03-18 Thread arun
Hi, Jorge's method will be faster. #system.time(res1-sum(apply(mat2,1,function(x) x[1]12 x[2]12))) #instead of 2, it should be 1  #  user  system elapsed  # 0.440   0.000   0.445  system.time(res1-sum(apply(mat2,1,function(x) x[1]=12 x[2]12))) #  #  user  system elapsed  # 0.500   0.000  

Re: [R] Counting confidence intervals

2013-03-18 Thread Jorge I Velez
If you don't use apply() it would be even faster: system.time(sum(mat2[,1] 12 mat2[,2] 12)) user system elapsed 0.004 0.000 0.003 Regards, Jorge.- On Tue, Mar 19, 2013 at 1:21 AM, arun wrote: Hi, Jorge's method will be faster. #system.time(res1-sum(apply(mat2,1,function(x)

Re: [R] How many samples ACTUALLY used in regression?

2013-03-18 Thread Marc Schwartz
On Mar 18, 2013, at 7:36 AM, Federico Calboli f.calb...@imperial.ac.uk wrote: Dear All, is there a simple way that covers all regression models to extract the number of samples from a data frame/matrix actually used in a regression model? For instance I might have a data of 100 rows and

Re: [R] save scores from sem

2013-03-18 Thread John Fox
Dear Marko, I can't quite tell whether this is an original question (as suggested by no Re: in the subject field and no text from an earlier message) or an answer to a question already posed (as suggested by the phrasing of the message); if the latter, I apologize for missing the original

Re: [R] Problem with write.table

2013-03-18 Thread PIKAL Petr
Hi -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Sahana Srinivasan Sent: Monday, March 18, 2013 3:04 PM To: r-help@r-project.org Subject: [R] Problem with write.table Hi everyone, I'm trying to create unique filenames

Re: [R] How many samples ACTUALLY used in regression?

2013-03-18 Thread Cade, Brian
Perhaps a crude but reliable way is to check the number of residuals, e.g., length(my.model$resid). Brian Brian S. Cade, PhD U. S. Geological Survey Fort Collins Science Center 2150 Centre Ave., Bldg. C Fort Collins, CO 80526-8818 email: ca...@usgs.gov brian_c...@usgs.gov tel: 970 226-9326

[R] Confirmatory factor analysis using the sem package. TLI CFI and RMSEA absent from model summary.

2013-03-18 Thread Kevin Cheung
Hi R-help, I am using the sem package to run confirmatory factor analysis (cfa) on some questionnaire data collected from 307 participants. I have been running R-2.15.3 in Windows in conjunction with R studio. The model I am using was developed from exploratory factor analysis of a separate

Re: [R] How many samples ACTUALLY used in regression?

2013-03-18 Thread Prof Brian Ripley
On 18/03/2013 14:51, Cade, Brian wrote: Perhaps a crude but reliable way is to check the number of residuals, e.g., length(my.model$resid). Not very reliable (what about zero weights, for example?), and the component is usually 'residuals'. No one has so far mentioned nobs(), which seems to

Re: [R] How many samples ACTUALLY used in regression?

2013-03-18 Thread Federico Calboli
On 18 Mar 2013, at 15:07, Prof Brian Ripley rip...@stats.ox.ac.uk wrote: On 18/03/2013 14:51, Cade, Brian wrote: Perhaps a crude but reliable way is to check the number of residuals, e.g., length(my.model$resid). Not very reliable (what about zero weights, for example?), and the component

Re: [R] try/tryCatch

2013-03-18 Thread jim holtman
It would help if you told us what type of error you are getting and to also provide sample data so that we could run it to see what happens. I use 'try' a lot to catch errors and have not had any problems with it. On Mon, Mar 18, 2013 at 6:11 AM, lisa wang.li...@gmail.com wrote: Hi All, I

Re: [R] Confirmatory factor analysis using the sem package. TLI CFI and RMSEA absent from model summary.

2013-03-18 Thread John Fox
Dear Kevin, See ?summary.objectiveML, and in particular the description of the fit.indices argument. By default, the summary() method doesn't print many fit indices, but many are available optionally. I hope this helps, John John Fox Sen.

Re: [R] Counting confidence intervals

2013-03-18 Thread S Ellison
I want to cont how many times a number say 12 lies in the interval. Can anyone assist? Has anyone else ever wished there was a moderately general 'inside' or 'within' function in R for this problem? For example, something that behaves more or less like within - function(x, interval=NULL,

Re: [R] !0 + !0 == !0 - !0

2013-03-18 Thread Charles Berry
Ben Bolker bbolker at gmail.com writes: Maybe FAQ 7.31 was referred to not for its direct relevance but as a measure of the old-hand-ness of the people who will get the joke. !1i|!0 Chuck __ R-help@r-project.org mailing list

Re: [R] Confirmatory factor analysis using the sem package. TLI CFI and RMSEA absent from model summary.

2013-03-18 Thread Kevin Cheung
Dear John, Thank you for taking the time to help me with this, I have been able to obtain fit indices using the information that you provided. Note to users searching archived R-help posts about this issue: The instructional video I looked at (http://vimeo.com/38941937) gave fit indices using

Re: [R] !0 + !0 == !0 - !0

2013-03-18 Thread Sam Steingold
* Bert Gunter thagre.ore...@trar.pbz [2013-03-17 20:30:56 -0700]: I also think it fair to say that all (??) languages have these sorts of malapropisms due to operator precedence. Except for those languages which do _not_ have operator precedence. Like, e.g., Lisp. -- Sam Steingold

Re: [R] !0 + !0 == !0 - !0

2013-03-18 Thread Bert Gunter
Sam: Yes. Good point. (which is why my ?? was necessary). -- Bert On Mon, Mar 18, 2013 at 10:05 AM, Sam Steingold s...@gnu.org wrote: * Bert Gunter thagre.ore...@trar.pbz [2013-03-17 20:30:56 -0700]: I also think it fair to say that all (??) languages have these sorts of malapropisms

Re: [R] Writing a hyperlink to a csv file

2013-03-18 Thread MacQueen, Don
Besides what others have suggested, there are at some packages for writing Excel files directly, and either of those might have a way to write something that Excel will recognize as a hyperlink. xlsx, XLConnect are both Java-based; I would start with these. -Don -- Don MacQueen Lawrence

[R] melt with complications

2013-03-18 Thread Richard M. Heiberger
## Can someone suggest a simpler expression than either of these, with the goal ## of taking a long matrix into a wide one with exactly one of the factors converted to ## columns and all the rest retained as factors. I want something that generalizes beyond ## the three factors illustrated here.

Re: [R] try/tryCatch

2013-03-18 Thread lisa
here is the error: aa-metatrialstry(beta_5_50) Error in asMethod(object) : matrix is not symmetric [1,2] metatrials, the function that i am attempting to convert with try/tryCatch, gives me back a matrix with as many rows are there are simulations (z) in the aray with dim(x,y,z). with the

[R] Fit a mixture of lognormal and normal distributions

2013-03-18 Thread To . .
Hello I am trying to find an automated way of fitting a mixture of normal and log-normal distributions to data which is clearly bimodal. Here's a simulated example: x.1-rnorm(6000, 2.4, 0.6)x.2-rlnorm(1, 1.3,0.1)X-c(x.1, x.2) hist(X,100,freq=FALSE, ylim=c(0,1.5))lines(density(x.1), lty=2,

[R] data.frame with NA

2013-03-18 Thread Pete
I have this little data.frame http://dl.dropbox.com/u/102669/nanotna.rdata Two column contains NA, so the best thing to do is use na.locf function (with fromLast = T) But locf function doesn't work because NA in my data.frame are not recognized as real NA. Is there a way to substitute fake NA

Re: [R] Confirmatory factor analysis using the sem package. TLI CFI and RMSEA absent from model summary.

2013-03-18 Thread Hervé Guyon
Hi Kevin, With sem package use : summary(X,fit.indices=c(RMSEA,...)) to get RMSEA or anothers fit indices. See the section ML.methods in sem.pdf Hervé Hervé Le 18/03/2013 16:00, Kevin Cheung a écrit : Hi R-help, I am using the sem package to run confirmatory factor analysis (cfa) on some

[R] Why stacking rasters return NAs?

2013-03-18 Thread Jonsson
I have several rasters that I want to do some calculations ,basically calculating the moving average. dir2 - list.files(D:\\2010+2011, *.bin, full.names = TRUE) saf=stack(dir2) movi - overlay(stack(saf),fun=function(x) movingFun(x, fun=mean, n=3, na.rm=TRUE))

[R] Loop or some other way to parse by data generated values when it is not linear

2013-03-18 Thread plessthanpointohfive
I'm sorry for the really vague subject line but I am not sure how to succinctly describe what I am doing and what the problem is. But, here goes: 1. I have data with two-way data with frequencies. Below is an example, though in reality I am looking at about 10 different variables that I am

Re: [R] data.frame with NA

2013-03-18 Thread Berend Hasselman
On 18-03-2013, at 16:49, Pete freeri...@gmail.com wrote: I have this little data.frame http://dl.dropbox.com/u/102669/nanotna.rdata Two column contains NA, so the best thing to do is use na.locf function (with fromLast = T) But locf function doesn't work because NA in my data.frame

Re: [R] Loop or some other way to parse by data generated values when it is not linear

2013-03-18 Thread arun
Hi, library(reshape2)  dcast(tmp.n,X1~X2,value.var=Y)  # X1   0  2  4 #1  0  83 12 14 #2  1 107 25 27 #3  2  47 14 28 #4  3  27  4 13 #5  4  38  9 18 #6 99   1  0  0 A.K. - Original Message - From: plessthanpointohf...@gmail.com plessthanpointohf...@gmail.com To: r-help@r-project.org

Re: [R] Loop or some other way to parse by data generated values when it is not linear

2013-03-18 Thread Marc Schwartz
On Mar 18, 2013, at 12:44 PM, plessthanpointohf...@gmail.com wrote: I'm sorry for the really vague subject line but I am not sure how to succinctly describe what I am doing and what the problem is. But, here goes: 1. I have data with two-way data with frequencies. Below is an example,

Re: [R] Confirmatory factor analysis using the sem package. TLI CFI and RMSEA absent from model summary.

2013-03-18 Thread John Fox
Dear Kevin, In earlier versions of the sem package, the summary() method for model objects produced many (and from version to version, an increasing number of) fit indices by default. For various reasons, I decided to provide only the LR chisquare test for the model, the BIC, and the AIC by

[R] Lattice strip with custom shingle.interval

2013-03-18 Thread Alex van der Spek
Trying to make a strip in lattice xyplots to display shingle intervals with a sensible number of digits: First I make a 2x2 matrix with rounded values of the shingle itnervals: lec - round(matrix(unlist(levels(equal.count(sd$Frother))), ncol = 2, byrow = TRUE), 3) Next I make a custom strip

Re: [R] Loop or some other way to parse by data generated values when it is not linear

2013-03-18 Thread plessthanpointohfive
That works great! I didn't even know there was a reshape2 package. Thanks! Jen On 03/18/2013 01:49 PM, arun wrote: Hi, library(reshape2) dcast(tmp.n,X1~X2,value.var=Y) # X1 0 2 4 #1 0 83 12 14 #2 1 107 25 27 #3 2 47 14 28 #4 3 27 4 13 #5 4 38 9 18 #6 99 1 0 0 A.K.

[R] OrgMassSpecR peak area issue

2013-03-18 Thread Christopher Beaver
Hello! I am having an issue with the OrgMassSpecR package. I run my HPLC using a DAD detector. My raw data is exported form chemstation as a csv file. I then upload the csv into Rstudio no problem. Using the DrawChromatogram function, I get a nice chromatogram, and my retention time, peak

Re: [R] Loop or some other way to parse by data generated values when it is not linear

2013-03-18 Thread plessthanpointohfive
This works really great, too. Thanks for this option. I am glad I have two ways to accomplish this. I KNEW it was going to be that simple. I was convinced I was making more out of it than I needed to and I'm glad to see I was right. Best, Jen (It's fun to be new at something when I'm this

[R] How to stop set.seed() besides exiting out of R?

2013-03-18 Thread C W
Hi list, I am curious how to stop the set.seed(), I don't want the same repeated random number. I know I can set it to a different seed, but I don't want to go through the trouble of setting different seed every time. Thanks, Mike [[alternative HTML version deleted]]

Re: [R] new question

2013-03-18 Thread arun
 z.boxplot- function(lst){  new.list-  lapply(lst,function(x) x[x$FDR0.01,]) print(new.list)   par(mfrow=c(2,2)) b1-lapply(names(new.list),function(x) lapply(new.list[x],function(y) boxplot(FDR~z,data=y,xlab=Charge,ylab=FDR,main=x))) }  z.boxplot(ListFacGroup) #prints new.list If you want to

Re: [R] How to stop set.seed() besides exiting out of R?

2013-03-18 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of C W Sent: Monday, March 18, 2013 11:27 AM To: r-help Subject: [R] How to stop set.seed() besides exiting out of R? Hi list, I am curious how to stop the set.seed(), I don't

Re: [R] How to stop set.seed() besides exiting out of R?

2013-03-18 Thread C W
set.seed(100) for (i in 1:100){ a - rnorm(1000, mean=0, sd=1) hist(a) } #Now say, I want to simulate without being confined to set.seed(100), I just want to get a simulation like how R normally does it. Mike On Mon, Mar 18, 2013 at 2:40 PM, Nordlund, Dan (DSHS/RDA) nord...@dshs.wa.gov

Re: [R] OrgMassSpecR peak area issue

2013-03-18 Thread Bryan Hanson
If you type DrawChromatogram you can see the method used to calculate the peak area. Looks to me like you could easily hack it if you wanted. The relevant part about peak areas is this: for (j in 1:n) { k - (j%%n) + 1 x[j] - peakTime[j] * peakIntensity[k] -

Re: [R] OrgMassSpecR peak area issue

2013-03-18 Thread Claudia Beleites
Hi Chris, I am having an issue with the OrgMassSpecR package. I run my HPLC using a DAD detector. You are on a statistics IDE related mailing list. Have mercy with people from other fields and tell them that you are using a diode array to measure UV/VIS absorption. (And possibly let them know

Re: [R] How to stop set.seed() besides exiting out of R?

2013-03-18 Thread Nordlund, Dan (DSHS/RDA)
As I understand it, how R “‘normally” does it is to use the system clock to set the seed once per session, unless you use set.seed() to set a new seed. You chose to set the seed to a different value. But from that point on, the pseudo random number generation continues in the same way

Re: [R] data.frame with NA

2013-03-18 Thread Berend Hasselman
On 18-03-2013, at 19:57, Pietro freeri...@gmail.com wrote: Yes, it's true Berend! What i do is simply use read.xlsx function db - read.xlsx2(c:/mydb.xlsx,1,as.data.frame=T) This is excel file i use: http://dl.dropbox.com/u/102669/mydb.xlsx I don't have the required packages

[R] ksvm

2013-03-18 Thread Li, Yan
Hi All, I'm developing a ksvm application. I need to use the results obtained from ksvm in R to construct or restore the ksvm formula and further use this formula to predict new data. The ksvm class contains xmatrix, ymatrix, coefficients, alpha, b and fitted value. Taking linear svm as an

Re: [R] How to stop set.seed() besides exiting out of R?

2013-03-18 Thread C W
Yes, I agree with you. I guess what I was really looking for is a function like UNset.seed()? By having set.seed(), I can have reproducible code. But what if I want to check my work against what's produced from set.seed(100)? I really want to escape from the shadow of set.seed(), can I unset

Re: [R] OrgMassSpecR peak area issue

2013-03-18 Thread Claudia Beleites
Hi Bryan, Division by 2 is correct, comes from trapezoid calculation. The modulo line is a funny way of producing c (2 : n, 1) Best, Claudia Am Mon, 18 Mar 2013 15:00:06 -0400 schrieb Bryan Hanson han...@depauw.edu: If you type DrawChromatogram you can see the method used to calculate the

Re: [R] data.frame with NA

2013-03-18 Thread Pietro
Yes, it's true Berend! What i do is simply use read.xlsx function db - read.xlsx2(c:/mydb.xlsx,1,as.data.frame=T) This is excel file i use: http://dl.dropbox.com/u/102669/mydb.xlsx I can't find a way to import as numeric. My objective is to be able to work (in R) with my NA's At 18.46

Re: [R] How to stop set.seed() besides exiting out of R?

2013-03-18 Thread Nordlund, Dan (DSHS/RDA)
No, you cannot unset the seed. You can set it to a different value, but a the random number generators always need a starting seed. If you don’t set one, R will set one for you , you just won’t know what it is. And as a practical matter, given a sequence of random numbers you can’t

[R] Creating SubScale Scores

2013-03-18 Thread Amanda Charles
Hello all, I have just completed a principal components analysis and now which to create sub scales out of my factors. Does anyone know how to do this in R? Thanks!! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Counting confidence intervals

2013-03-18 Thread Rui Barradas
Hello, There _is_ a function ?within. Maybe your function can be named 'between' Rui Barradas Em 18-03-2013 16:16, S Ellison escreveu: I want to cont how many times a number say 12 lies in the interval. Can anyone assist? Has anyone else ever wished there was a moderately general 'inside'

Re: [R] How to stop set.seed() besides exiting out of R?

2013-03-18 Thread William Dunlap
I am not sure of this, but I think you can unset the seed by removing the dataset .Random.seed from the global environment. E.g., set.seed(1) runif(5) [1] 0.2655087 0.3721239 0.5728534 0.9082078 0.2016819 rm(list=.Random.seed, envir=globalenv()) runif(5) [1] 0.5952379 0.3355091 0.8820192

Re: [R] How to stop set.seed() besides exiting out of R?

2013-03-18 Thread Jeff Newmiller
Your request is meaningless. The seed itself is effectively overwritten each time a random number is requested. It is only the repeatability of the sequence of random numbers following the set.seed call that is reproducible. You can set the seed to something else, but there is always a seed

Re: [R] How to stop set.seed() besides exiting out of R?

2013-03-18 Thread C W
Thanks, William. You read my mind. Cheers, Mike On Mon, Mar 18, 2013 at 4:00 PM, Jeff Newmiller jdnew...@dcn.davis.ca.uswrote: Your request is meaningless. The seed itself is effectively overwritten each time a random number is requested. It is only the repeatability of the sequence of

Re: [R] data.frame with NA

2013-03-18 Thread David L Carlson
Try this Open the spreadsheet in Excel. Select all of the data click Copy. Don't close Excel. Open R and type the following command: Foglio1 - read.table(clipboard-128, header=TRUE, sep=\t) Now take a look at the structure of the data.frame str(Foglio1) 'data.frame': 1489 obs. of 15

Re: [R] How to stop set.seed() besides exiting out of R?

2013-03-18 Thread Prof Brian Ripley
On 18/03/2013 19:59, William Dunlap wrote: I am not sure of this, but I think you can unset the seed by removing the dataset .Random.seed from the global environment. E.g., set.seed(1) runif(5) [1] 0.2655087 0.3721239 0.5728534 0.9082078 0.2016819 rm(list=.Random.seed, envir=globalenv())

Re: [R] how to plot u-v wind by R?

2013-03-18 Thread Greg Snow
The my.symbols and ms.arrows functions in the TeachingDemos package may help. On Mon, Mar 18, 2013 at 3:50 AM, Jie Tang totang...@gmail.com wrote: hi R users: I have a dataset including u wind in x-axis and v wind in y-axis. How can I plot the u,v wind data in vector or barb figure?

[R] Superscript followed by number then superscript in text

2013-03-18 Thread Benjamin Gillespie
Hi all, I'm having problems finding the correct format for a command. I would like to write some text on a plot. I'm using the following command: text(x,y,text here, srt=90) I would like the text to read: capacity 10^3 m^3 (with ^ denoting superscript (i.e. each '3' as superscript). I've

Re: [R] data.frame with NA

2013-03-18 Thread David L Carlson
It appears that you MUST use the colClasses= argument with read.xlsx2: Foglio1 - read.xlsx2(mydb.xlsx, 1, colClasses=c(Date, rep(numeric, 14))) However, e and n are converted to NaN not NA so you would need to convert those columns (at least, I didn't check for missing values in the other

Re: [R] How to stop set.seed() besides exiting out of R?

2013-03-18 Thread William Dunlap
-Original Message- From: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] Sent: Monday, March 18, 2013 1:22 PM To: William Dunlap Cc: r-help Subject: Re: [R] How to stop set.seed() besides exiting out of R? On 18/03/2013 19:59, William Dunlap wrote: I am not sure of this, but I

Re: [R] Superscript followed by number then superscript in text

2013-03-18 Thread Thomas Lumley
On Tue, Mar 19, 2013 at 9:29 AM, Benjamin Gillespie gy...@leeds.ac.ukwrote: Hi all, I'm having problems finding the correct format for a command. I would like to write some text on a plot. I'm using the following command: text(x,y,text here, srt=90) I would like the text to read:

Re: [R] Superscript followed by number then superscript in text

2013-03-18 Thread Rui Barradas
Hello, Something like this? plot(1, type = n) text(1,1, expression(capacity ~ 10^3 ~ m^3)) Hope this helps, Rui Barradas Em 18-03-2013 20:29, Benjamin Gillespie escreveu: Hi all, I'm having problems finding the correct format for a command. I would like to write some text on a plot. I'm

Re: [R] melt with complications

2013-03-18 Thread arun
HI, Not sure whether this is what you wanted. library(reshape2) result.dcast-dcast(meltTest,A+D~H,value.var=M) attr(result.reshape,reshapeWide)-NULL  row.names(result.reshape)-1:nrow(result.reshape)  identical(result.reshape,result.dcast) #[1] TRUE result.dcast #  A D  I  J  K  L #1 B E  1  2  3 

Re: [R] melt with complications

2013-03-18 Thread Charles Berry
Richard M. Heiberger rmh at temple.edu writes: ## Can someone suggest a simpler expression than either of these, with the goal ## of taking a long matrix into a wide one with exactly one of the factors converted to ## columns and all the rest retained as factors. I want something that

[R] Fit a mixture of lognormal and normal distributions

2013-03-18 Thread To . .
Hello I am trying to find an automated way of fitting a mixture of normal and log-normal distributions to data which is clearly bimodal. Here's a simulated example: x.1-rnorm(6000, 2.4, 0.6) x.2-rlnorm(1, 1.3,0.1) X-c(x.1, x.2) hist(X,100,freq=FALSE, ylim=c(0,1.5))lines(density(x.1), lty=2,

Re: [R] Fit a mixture of lognormal and normal distributions

2013-03-18 Thread Bert Gunter
You posted this earlier. Do not repost, please. It was seen. -- Bert On Mon, Mar 18, 2013 at 3:28 PM, To . . kid...@hotmail.com wrote: Hello I am trying to find an automated way of fitting a mixture of normal and log-normal distributions to data which is clearly bimodal. Here's a

[R] R web application development

2013-03-18 Thread John linux-user
Dear all, I am wondering if what would be the simple way to develop a simple web application that runs R. That is, the web application allows any user upload a dataframe as a variable to my web server, a linux-based apache, and then run a R package (my package) on the variable that should

Re: [R] R web application development

2013-03-18 Thread Stephen Sefick
I can't offer any advice, but I feel like you could probably get a good start on this by looking through the archives. On Mon 18 Mar 2013 06:55:33 PM CDT, John linux-user wrote: Dear all, I am wondering if what would be the simple way to develop a simple web application that runs R. That

[R] How to automate this model selection algorithm?

2013-03-18 Thread Andrew Crane-Droesch
I've got a complicated semi-parametric model that I'm fitting with mgcv. I start with a model based on theory. Its got lots of interaction terms. I want to winnow it down: removing each interaction term or un-interacted main effect one by one, checking the AIC, and retaining the model that

Re: [R] R web application development

2013-03-18 Thread John linux-user
Thanks for reply, but which archives?  Thanks again.  John From: Stephen Sefick ssef...@gmail.com Cc: r-help@r-project.org r-help@r-project.org Sent: Monday, March 18, 2013 8:02 PM Subject: Re: [R] R web application development I can't offer any advice, but

Re: [R] melt with complications

2013-03-18 Thread Richard M. Heiberger
thank you all. the dcast formulation is what I am looking for. That version of the formula A+D ~ H also works with the original cast function. result.cast - cast(A+D ~ H, value=M, data=meltTest) It generalizes to a four-factor example, as requested. This ftable solution didn't do what I

Re: [R] How to automate this model selection algorithm?

2013-03-18 Thread Andrew Crane-Droesch
Just to add, I've been playing around with select=TRUE in mgcv, and it does seem that it could work if I were to specify all of the nested two-way interactions in my three-way interactions (see the toy example below). But the problem is that I don't have enough degrees of freedom to feed such

Re: [R] R web application development

2013-03-18 Thread David Winsemius
I generally use the Markmail search engine but others use the Newcastle resource. Some of other ones can be found with perusal of the Posting Guide and Mailing list info page. http://markmail.org/search/?q=list%3Aorg.r-project.r-help On Mar 18, 2013, at 5:11 PM, John linux-user wrote:

[R] RGL 3D plots are flat. Please Help

2013-03-18 Thread Noah Silverman
Hello, I have a matrix of simulated data that I want to plot as a 3D surface using RGL. Have followed the documentation carefully, but my plot only contains a weird single slice of the data. The actual RGL library and dependance seem fine as all of the demo code plots beautifully. The

Re: [R] RGL 3D plots are flat. Please Help

2013-03-18 Thread Pascal Oettli
Hi, Your example is not reproducible. What is d in your command? Regards, Pascal On 19/03/13 10:21, Noah Silverman wrote: Hello, I have a matrix of simulated data that I want to plot as a 3D surface using RGL. Have followed the documentation carefully, but my plot only contains a weird

Re: [R] RGL 3D plots are flat. Please Help

2013-03-18 Thread Noah Silverman
Oops, that was a type. d is just y. If you want to reproduce, I put the entire matrix, as a csv here: http://pastebin.com/gniyD4Rc Thanks, -- Noah Silverman, M.S. UCLA Department of Statistics 8117 Math Sciences Building Los Angeles, CA 90095 On Mar 18, 2013, at 6:58 PM, Pascal Oettli

[R] Convert to date and time of the year

2013-03-18 Thread Janesh Devkota
Dear R Users, I have data for more than 3 years. For each year I want to find the day corresponding to Jaunary 1 of that year. For example: x - c('5/5/2007','12/31/2007','1/2/2008') #Convert to day of year (julian date) - strptime(x,%m/%d/%Y)$yday+1 [1] 125 365 2 I want to know how to

Re: [R] Convert to date and time of the year

2013-03-18 Thread Ben Tupper
Hi Janesh, On Mar 18, 2013, at 10:49 PM, Janesh Devkota wrote: Dear R Users, I have data for more than 3 years. For each year I want to find the day corresponding to Jaunary 1 of that year. For example: x - c('5/5/2007','12/31/2007','1/2/2008') #Convert to day of year (julian date) -

  1   2   >