Re: [R] get mean from cdf

2011-09-09 Thread peter dalgaard
On Sep 9, 2011, at 03:51 , Jeff Newmiller wrote: The diff function would be helpful. ...or not: sum(ppois(0:1000, lambda=2.345, lower=F)) [1] 2.345 (if this was homework: the hard bit is to figure out _why_ this works.) annie Zhang annie.zhang2...@gmail.com wrote: Hi All, How can I

Re: [R] Factors? I think?

2011-09-09 Thread Petr PIKAL
Hi Isn't it something for merge is designed? merge(Doctors, DeptCodes, by.x=DocDepts, by.y=Depts) DocDeptsDocs DeptNames 1 Christian\nChristianson Heart 2 Bob Smith Brain 3 Greg Jones Anesthesia 4

Re: [R] problems with function read.table

2011-09-09 Thread Petr PIKAL
Hi Hi, If you read carefully the help pages for read.table you get this: na.stringsa character vector of strings which are to be interpreted as NA../../utils/help/NA values. Blank fields are also considered to be missing values in logical, integer, numeric and complex fields.

Re: [R] rpart or tree function issue

2011-09-09 Thread Achim Zeileis
On Thu, 8 Sep 2011, Carlos Ortega wrote: Hi, Use packages rpart.plot or maptree to enhance the tree drawing. Or another alternative, use party package that offers much more graphing possibilities. There is also the partykit package on R-Forge which offers party-style graphics for rpart

Re: [R] function censReg in panel data setting

2011-09-09 Thread Igors
Dear Arne, Does censReg support unbalanced panel data? /Igors -- View this message in context: http://r.789695.n4.nabble.com/function-censReg-in-panel-data-setting-tp3792227p3801030.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] The elegant way to test if a number is a whole number

2011-09-09 Thread Martin Maechler
Marc Schwartz marc_schwa...@me.com on Thu, 8 Sep 2011 15:41:26 -0500 writes: On Sep 8, 2011, at 3:09 PM, David Winsemius wrote: On Sep 8, 2011, at 3:54 PM, Marc Schwartz wrote: On Sep 8, 2011, at 2:42 PM, David Winsemius wrote: On Sep 8,

[R] prcomp: results with reversed sign in output?

2011-09-09 Thread René Mayer
Dear All, when I'm running a PCA with prcomp(USArrests, scale = TRUE) I get the right principal components, but with the wrong sign infront Rotation: PC1 PC2 PC3 PC4 Murder 0.5358995 -0.4181809 0.3412327 0.64922780 Assault 0.5831836 -0.1879856 0.2681484 -0.74340748 UrbanPop 0.2781909

Re: [R] prcomp: results with reversed sign in output?

2011-09-09 Thread Paul Hiemstra
Hi, If all the signs are switched the PC's are still the same. The principal vectors are along the same axis, only in a different direction. So there is no problem :). hope this helps, Paul On 09/09/2011 09:01 AM, René Mayer wrote: Dear All, when I'm running a PCA with prcomp(USArrests,

Re: [R] General help - online statistics courses?

2011-09-09 Thread Paul Hiemstra
Hi, You could also consider following a statistics course at a university near you, if you can convince your boss to give you the time. Maybe an Introductory Statistics course is all you need. cheers, Paul On 09/08/2011 04:49 PM, kensuguro wrote: I understand this isn't a r specific question.

Re: [R] General help - online statistics courses?

2011-09-09 Thread Paul Hiemstra
And do take a look at Open Courseware: http://ocw.mit.edu/index.htm cheers, Paul On 09/09/2011 09:30 AM, Paul Hiemstra wrote: Hi, You could also consider following a statistics course at a university near you, if you can convince your boss to give you the time. Maybe an Introductory

Re: [R] prcomp: results with reversed sign in output?

2011-09-09 Thread René Mayer
thanks for pointing out Paul, but the thing which is annoying me in the first place IS this direction reversal. this makes no sense for me why could this be? Zitat von Paul Hiemstra paul.hiems...@knmi.nl: Hi, If all the signs are switched the PC's are still the same. The principal vectors

Re: [R] prcomp: results with reversed sign in output?

2011-09-09 Thread Duncan Murdoch
On 11-09-09 5:42 AM, René Mayer wrote: thanks for pointing out Paul, but the thing which is annoying me in the first place IS this direction reversal. this makes no sense for me why could this be? I think you need to read more about principal components. The signs within a PC vector are

[R] get and save

2011-09-09 Thread Göran Broström
I have a data frame 'tmp' and a vector 'name' containing 'd2'. I want to save 'tmp' under the name hidden in 'name', and the file must have the same name, plus the extension '.rda'. So I try tmp x y 1 1 3 2 2 4 name [1] d2 assign(name, tmp) summary(get(name)) x y Min.

Re: [R] Factors? I think?

2011-09-09 Thread peter dalgaard
On Sep 9, 2011, at 09:13 , Petr PIKAL wrote: Hi Isn't it something for merge is designed? Sort of. (You'd need to think carefully about what happens with non-matched codes.) Wouldn't this do the trick as well? in - as.character(DeptCodes$DeptCodes) out - as.character(DeptCodes$DeptNames)

Re: [R] get and save

2011-09-09 Thread Ivan Calandra
Hi! Why don't you just save tmp? save(tmp, file = paste(name, rda, sep = .)) I don't think it makes much difference, at least not with your example. Or does it? Ivan Le 9/9/2011 11:55, Göran Broström a écrit : I have a data frame 'tmp' and a vector 'name' containing 'd2'. I want to save

Re: [R] prcomp: results with reversed sign in output?

2011-09-09 Thread Ted Harding
The point is that a principal component vector is a solution, say V, of a matrix equation A%*%V = L*V where A is the matrix and L is a scalar.. Since this equation can be written A%*%(-V) = L*(-V), the result is indeterminate with respect to its sign. If V is a solution, so is (-V), and vice

Re: [R] get and save

2011-09-09 Thread Duncan Murdoch
On 11-09-09 5:55 AM, Göran Broström wrote: I have a data frame 'tmp' and a vector 'name' containing 'd2'. I want to save 'tmp' under the name hidden in 'name', and the file must have the same name, plus the extension '.rda'. So I try tmp x y 1 1 3 2 2 4 name [1] d2 assign(name, tmp)

Re: [R] get and save

2011-09-09 Thread Duncan Murdoch
On 11-09-09 6:01 AM, Ivan Calandra wrote: Hi! Why don't you just save tmp? save(tmp, file = paste(name, rda, sep = .)) I don't think it makes much difference, at least not with your example. Or does it? That saves it with the name tmp, not d2 as Göran wanted. Duncan Murdoch Ivan Le

[R] rgl: axis/viewport/box problems in persp3d()

2011-09-09 Thread Marius Hofert
Dear expeRts, I am a new user of rgl, below is my first trial to plot a simple function in 3d. I managed to put the axes in the right locations, but: (1) The xlab, ylab, and zlab arguments are ignored; how can I put in axes labels? (2) Since I removed the axes in persp3d() the viewport is too

[R] NMDS plot and Adonis (PerMANOVA) of community composition with presence absence and relative intensity

2011-09-09 Thread Markus Lindh
Hi! Thanks for providing great help in R-related statistics. Now, however I'm stuck. I'm not a statistics person but I was recommended to use R to perform a nmds plot and PerMANOVA of my dataset. Sample(treatment) in the columns and species (OTU) in the rows. I have 4 treatments (Ambient

Re: [R] General help - online statistics courses?

2011-09-09 Thread Michael Griffiths
Hi Kensuguro, I would try the Royal Statistical Society, based in London. They have a range of courses from relatively basic through to graduate level, all of which are based on distance learning. However, what they also have now are modularised programmes, which might be ideal for you, as you

Re: [R] rgl: axis/viewport/box problems in persp3d()

2011-09-09 Thread Duncan Murdoch
On 11-09-09 6:18 AM, Marius Hofert wrote: Dear expeRts, I am a new user of rgl, below is my first trial to plot a simple function in 3d. I managed to put the axes in the right locations, but: (1) The xlab, ylab, and zlab arguments are ignored; how can I put in axes labels? Those are

Re: [R] prcomp: results with reversed sign in output?

2011-09-09 Thread René Mayer
thanks for explaining Duncan and Ted, Indeed, I did compare my results from a textbook and noticed that I consitenly get flipped signs and biplots. regards René Zitat von ted.hard...@wlandres.net: The point is that a principal component vector is a solution, say V, of a matrix equation A%*%V

Re: [R] get and save

2011-09-09 Thread Göran Broström
On Fri, Sep 9, 2011 at 12:09 PM, Duncan Murdoch murdoch.dun...@gmail.comwrote: On 11-09-09 6:01 AM, Ivan Calandra wrote: Hi! Why don't you just save tmp? save(tmp, file = paste(name, rda, sep = .)) I don't think it makes much difference, at least not with your example. Or does it?

Re: [R] Spider (Radar) Plot

2011-09-09 Thread Jim Lemon
On 09/09/2011 06:31 AM, XINLI LI wrote: Dear R Group: Based on the following data, how to do a great Spider (Radar) Plot? Any advice is greatly appreciated. HospID Rate Age Charlson NIHSS 1 0.2 49 3.5 0 2 0.1 48 1.8 12 3 0.4 56 2.1 5 4 0.3 77 0 7 5 0.2 67 6.5 3 6 0.1 62 4.8 4.6 7 0.1

Re: [R] NMDS plot and Adonis (PerMANOVA) of community composition with presence absence and relative intensity

2011-09-09 Thread Jari Oksanen
Markus Lindh markusvlindh at gmail.com writes: Hi! Thanks for providing great help in R-related statistics. Now, however I'm stuck. I'm not a statistics person but I was recommended to use R to perform a nmds plot and PerMANOVA of my dataset. Sample(treatment) in the columns and

Re: [R] pie chart

2011-09-09 Thread Jim Lemon
On 09/09/2011 03:35 AM, Mohan L wrote: Hi All, I have txt file like : $ cat data.txt US 10 UK 12 Ind 4 Germany 14 France 8 rawdata- read.table(file='data.txt',sep='\t' , header=FALSE) rawdata V1 V2 1 US 10 2 UK 12 3 Ind 4 4 Germany 14 5 France 8 I

Re: [R] envfit vector labels with ordiplot3d

2011-09-09 Thread Jari Oksanen
Briony brionynorton at gmail.com writes: Hi R experts, I'm looking for some help with plotting vectors from envfit in vegan, onto a 3d plot using ordiplot3d. So far I have data.mds - metaMDS(data, k=3,trace = FALSE) vect_data-envfit(data.mds,vegdata[,3:21],choices=1:3,permu=)

Re: [R] rgl: axis/viewport/box problems in persp3d()

2011-09-09 Thread Marius Hofert
Dear Duncan, thanks for your quick response. Below is my second trial. I had to use mtext3d to place the label for the z-axis at the new axis where the ticks are drawn (if there's a simpler solution, please let me know). Was the usage of rgl.viewpoint meant this way? It is nice to adjust the

[R] reshape data from long to wide format

2011-09-09 Thread maxbre
This is my reproducible example: example-structure(list(SENSOR = structure(1:6, .Label = c(A, B, C, D, E, F), class = factor), VALUE = c(270, 292.5, 0, 45, 247.5, 315), DATE = structure(1:6, .Label = c( 01/01/2010 1, 01/01/2010 2, 01/01/2010 3, 01/01/2010 4, 01/01/2010 5, 01/01/2010 6),

[R] Subset function

2011-09-09 Thread stat.kk
Hi, can anyone help me how to use 'subset' function on my data frame? I have created data frame 'data' with a few variables and with row names. Now I would like to subset rows with concrete row names. Using data[] I know how to do it. But I dont know how to formulate the subset condition:

[R] Survival Analysis for soccer scoring process

2011-09-09 Thread ryusuke
6.4.1 Estimation of fixed effects Heterogeneous team ability is a possible explanation for the result in Section 6.3. That result simply indicates that the more goals a team scores, the higher the probability that it will score more. However, teams that can score more goals also indicate teams

[R] How to translate the 2D-density matrix (the output of bkde2D function) into matrix of datapoints' amounts?

2011-09-09 Thread Юрий Посохов
It is known that function bkde2D (package KernSmooth) returns a matrix of density estimates over the mesh induced by x1 and x2. In Details it is written that ... heights of the kernel, scaled by the bandwidths, at each datapoint are summed. This sum, after a normalization, is the corresponding

Re: [R] problems with function read.table

2011-09-09 Thread Petr PIKAL
Hi Hello, in the meanwhile i found the problem for the #. The problem was, that # and “none” are comments by default, so I turned comments of with comment.char=”” as stated in the help. Hm. You are not telling the whole story. I made a sample excel sheet with blank values and #DIV/0!

Re: [R] rgl: axis/viewport/box problems in persp3d()

2011-09-09 Thread Duncan Murdoch
On 09/09/2011 8:02 AM, Marius Hofert wrote: Dear Duncan, thanks for your quick response. Below is my second trial. I had to use mtext3d to place the label for the z-axis at the new axis where the ticks are drawn (if there's a simpler solution, please let me know). Was the usage of rgl.viewpoint

[R] How to translate the 2D-density matrix (the output of bkde2D function) into matrix of datapoints' amounts?

2011-09-09 Thread omega1x
It is known that function bkde2D (package KernSmooth) returns a matrix of density estimates over the mesh induced by x1 and x2. In Details it is written that ... heights of the kernel, scaled by the bandwidths, at each datapoint are summed. This sum, after a normalization, is the corresponding

Re: [R] function censReg in panel data setting

2011-09-09 Thread Arne Henningsen
On 8 September 2011 09:56, Igors igors.lahanc...@gmail.com wrote: Does censReg expect from panel data to be balanced? No. censReg() can estimate models with unbalanced panel data. The estimation in the code that you sent me indeed does not work but if I remove the user-specified starting values

Re: [R] Subset function

2011-09-09 Thread Rainer Schuermann
Does that help: x xin xout 1 1 14 2 85 3 16 884 4 1 14 5 85 6 16 884 subset( x, x$xin 7, select = xout )

Re: [R] Subset function

2011-09-09 Thread Jean V Adams
Rainer provided an example of subsetting by the value of a variable in the data frame. Below is an example of subsetting by the value of the row name of the data frame. df - data.frame(var1=1:10, var2=letters[1:10], var3=sample(10), row.names=month.abb[1:10]) subset(df, subset =

Re: [R] reshape data from long to wide format

2011-09-09 Thread Jean V Adams
maxbre wrote on 09/09/2011 06:28:15 AM: This is my reproducible example: example-structure(list(SENSOR = structure(1:6, .Label = c(A, B, C, D, E, F), class = factor), VALUE = c(270, 292.5, 0, 45, 247.5, 315), DATE = structure(1:6, .Label = c( 01/01/2010 1, 01/01/2010 2, 01/01/2010

Re: [R] rgl: axis/viewport/box problems in persp3d()

2011-09-09 Thread Marius Hofert
Dear Duncan, thanks a lot. Is it possible to rotate the label drawn by mtext3d, say, by 90 degrees? [a rot=90 did not help] Cheers, Marius On 2011-09-09, at 14:32 , Duncan Murdoch wrote: On 09/09/2011 8:02 AM, Marius Hofert wrote: Dear Duncan, thanks for your quick response. Below is

Re: [R] Subset function

2011-09-09 Thread stat.kk
No :( I dont have a condition on variable but on row name. My data frame looks like (from your example): x xin xout Peter1 14 Tom 8 5 Jane 16 884 Paul 114 Cathy 8 5

[R] conditional Latin hypercube sampling

2011-09-09 Thread Eric Tiger
Hello, I got one question on the Latin hypercube sampling. suppose there are three variables a, b, c, all of them follow the normal distribution. the mean value and standard deviation for each are  a(32, 2), b(35,5), c(37,3). I would like to use Latin hypercube sampling to random generate

Re: [R] Subset function

2011-09-09 Thread stat.kk
Thank you very much :) stat.kk -- View this message in context: http://r.789695.n4.nabble.com/Subset-function-tp3801397p3801626.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] analyse fMRI statistical maps in a mixed procedure (within-subject and between-subject error term)

2011-09-09 Thread Diederick Stoffers
Hi all, I have a set of 3D statistical parametric maps derived from an fMRI experiment in which we have two levels of dependency. - All subjects were scanned twice. - All subject are dizygotic (non-identical) twins. For every single scan (and thus statical map) we have a behavioural measure,

Re: [R] How to translate the 2D-density matrix (the output of bkde2D function) into matrix of datapoints' amounts?

2011-09-09 Thread David Winsemius
On Sep 9, 2011, at 8:12 AM, omega1x wrote: It is known that function bkde2D (package KernSmooth) returns a matrix of density estimates over the mesh induced by x1 and x2. In Details it is written that ... heights of the kernel, scaled by the bandwidths, at each datapoint are summed. This

[R] Read a list of files into named R data.frames

2011-09-09 Thread Michael Friendly
I have a collection of .csv files in a directory, and want to read them into R data.frames whose names are the same as the file names, without the .csv extension e.g., from (files - list.files(pattern=*.csv)) [1] Allstar.csv AllstarFull.csv [3] Appearances.csv

Re: [R] Subset function

2011-09-09 Thread William Dunlap
I thought that the main advantage of subset() over [() is that you only mention the name of the data.frame once, in the first argument, not in the second: x - data.frame(xin=c(1, 8, 16, 1, 8, 16), xout=c(14, 5, 884, 14, 5, 884)) subset(x, xin 7, select = xout) # not x$xin 7 xout 2

Re: [R] Read a list of files into named R data.frames

2011-09-09 Thread David Winsemius
On Sep 9, 2011, at 10:39 AM, Michael Friendly wrote: I have a collection of .csv files in a directory, and want to read them into R data.frames whose names are the same as the file names, without the .csv extension e.g., from (files - list.files(pattern=*.csv)) [1] Allstar.csv

Re: [R] Read a list of files into named R data.frames

2011-09-09 Thread Jean V Adams
Michael Friendly wrote on 09/09/2011 09:39:27 AM: I have a collection of .csv files in a directory, and want to read them into R data.frames whose names are the same as the file names, without the .csv extension e.g., from (files - list.files(pattern=*.csv)) [1] Allstar.csv

[R] Very simple question about list components

2011-09-09 Thread Clemontina Alexander
I have a list 'ans' from the following code: tt - rnorm(50) rr - rnorm(50) ans - lm(rr~tt) ans[1] is $coefficients, ans[2] is $residuals, ans[3] is $effects, ... and so on up to ans[12]. Is there an easy way to display just these names and not the data they contain? I thought I saw my advisor

Re: [R] Very simple question about list components

2011-09-09 Thread R. Michael Weylandt
Try names(ans) Hope this helps, Michael Weylandt On Fri, Sep 9, 2011 at 10:01 AM, Clemontina Alexander ckale...@ncsu.eduwrote: I have a list 'ans' from the following code: tt - rnorm(50) rr - rnorm(50) ans - lm(rr~tt) ans[1] is $coefficients, ans[2] is $residuals, ans[3] is $effects,

Re: [R] Very simple question about list components

2011-09-09 Thread Jorge I Velez
Try names(ans) [1] coefficients residuals effects rank [5] fitted.values assignqrdf.residual [9] xlevels call terms model HTH, Jorge * * On Fri, Sep 9, 2011 at 11:01 AM, Clemontina Alexander wrote: I have a list 'ans' from the

Re: [R] Very simple question about list components

2011-09-09 Thread Sarah Goslee
names(ans) [1] coefficients residuals effects rank [5] fitted.values assignqrdf.residual [9] xlevels call terms model And thank you for providing a simple reproducible example. Sarah On Fri, Sep 9, 2011 at 11:01 AM, Clemontina Alexander

Re: [R] Very simple question about list components

2011-09-09 Thread Steve Lianoglou
Hi Clemontina, On Fri, Sep 9, 2011 at 11:01 AM, Clemontina Alexander ckale...@ncsu.edu wrote: I have a list 'ans' from the following code: tt - rnorm(50) rr - rnorm(50) ans - lm(rr~tt) ans[1] is $coefficients, ans[2] is $residuals, ans[3] is $effects, ... and so on up to ans[12]. Is there

Re: [R] The elegant way to test if a number is a whole number

2011-09-09 Thread William Dunlap
Which of these functions is best really depends on why you are interested in knowing whether a number is integral or not. Why are people interested in this? I can think of a few 1) I have a C routine with the prototype void func(int *n) and to call it with .C() I need to make sure

Re: [R] Very simple question about list components

2011-09-09 Thread Clemontina Alexander
Thank you all. And thanks for pointing out I have an lm object, not a list. @ Steve, I knew I wasn't crazy when I saw him type ans$ in the prompt. I didn't see him hit tab though. So a special thanks to you for helping me validate my sanity! :-) Tina On Fri, Sep 9, 2011 at 11:08 AM, Steve

[R] Exception in NeweyWest - Pre-Whitening necessary?

2011-09-09 Thread Simon Zehnder
Hi guyz, I have run my algorithm in R (see http://pastebin.com/q84Tujfg) and got the following error: Error in ar.ols(x, aic = aic, order.max = order.max, na.action = na.action, : 'order.max' must be 'n.used' I am pretty sure, that the error comes from the NeweyWest function in line 45,

Re: [R] Rgl and plotmath symbols (via sprites): a trial

2011-09-09 Thread Duncan Murdoch
On 09/09/2011 11:10 AM, Marius Hofert wrote: Dear all, Below is some code where I try to get plotmath symbols in an rgl plot. Duncan Murdoch kindly suggested to use a sprite for this. As you can see, on can get it to work, but my knowledge about grid and rgl is too limited to perfectly solve

[R] split variable / create categories

2011-09-09 Thread Martin Batholdy
Hi, is there a function or an easy way to convert a variable with continuous values into a categorial variable (with x levels)? here is what I mean: I want to transform x: x - c(3.2, 1.5, 6.8, 6.9, 8.5, 9.6, 1.1, 0.6) into a 'categorial'-variable with four levels so that I get: [1]

Re: [R] split variable / create categories

2011-09-09 Thread Ben Tupper
Hi, On Sep 9, 2011, at 11:34 AM, Martin Batholdy wrote: Hi, is there a function or an easy way to convert a variable with continuous values into a categorial variable (with x levels)? here is what I mean: I want to transform x: x - c(3.2, 1.5, 6.8, 6.9, 8.5, 9.6, 1.1,

Re: [R] split variable / create categories

2011-09-09 Thread Jean-Christophe BOUËTTÉ
Hi there, library(lattice) equal.count(x,number=4,overlap=0) JC 2011/9/9 Martin Batholdy batho...@googlemail.com: Hi, is there a function or an easy way to convert a variable with continuous values into a categorial variable (with x levels)? here is what I mean: I want to transform x:

[R] Problems using quantile regression (rq) to model GLD random variables in R

2011-09-09 Thread James Shaw
Everyone: I am working on a simulation of the efficiencies of regression estimators when applied to model a specific form of highly skewed data. The outcome variable (y) is being simulated from a generalized lambda distribution (GLD) to reflect the characteristics (mean, variance, skewness,

Re: [R] Exception in NeweyWest - Pre-Whitening necessary?

2011-09-09 Thread Achim Zeileis
On Fri, 9 Sep 2011, Simon Zehnder wrote: Hi guyz, I have run my algorithm in R (see http://pastebin.com/q84Tujfg) and got the following error: This is not reproducible. There is only the script but no information about how it is called. Also, within your script you call

Re: [R] get mean from cdf

2011-09-09 Thread annie Zhang
Thanks all for your replies. Your responses are very helpful. But it is indeed not my homework! I didn't know these functions, and wanted to avoid the loop. Annie On Fri, Sep 9, 2011 at 1:38 AM, peter dalgaard pda...@gmail.com wrote: On Sep 9, 2011, at 03:51 , Jeff Newmiller wrote: The

Re: [R] split variable / create categories

2011-09-09 Thread Martin Batholdy
Thanks for the suggestions! However all these functions don't produce exactly what I want (at least with my actual data). I need a split-algorithm that converts the values of my vectors into four factors. And the crucial part is, that I need exactly the same number of elements in each

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

2011-09-09 Thread Karl Brand
Thanks a lot for sharing your experience and suggestions. I see now the logic of making use of my user library which doesn't require root privs. Apparently linux is actually set up to work well - something i'm not used to from the other OS i've used till now. And for the rare times i do need

[R] Comments inside a line? Not possible?

2011-09-09 Thread Dimitri Liakhovitski
Hello! In the guidelines I've read: Comment your code. Entire commented lines should begin with # and one space. Short comments can be placed after code preceded by two spaces, #, and then one space. Just wondering if there is no way to comment something out in the middle of a line? Example:

Re: [R] Rgl and plotmath symbols (via sprites): a trial

2011-09-09 Thread Marius Hofert
Dear Duncan, attached my next trial. It seems to work :-) Unfortunately, not the printing to pdf. Not getting a high-quality pdf is certainly one of the major drawbacks. If anybody knows how to fix that, please let me know. Even when generating the labels by hand (with grid), the code is less

Re: [R] split variable / create categories

2011-09-09 Thread Jean-Christophe BOUËTTÉ
so what about : library(ggplot2) z - breaks(x,equal=NULL,nbins=4) a - cut(x,z,include.lowest = TRUE) it works for me ! JC 2011/9/9 Martin Batholdy batho...@googlemail.com: Thanks for the suggestions! However all these functions don't produce exactly what I want (at least with my actual data).

Re: [R] Comments inside a line? Not possible?

2011-09-09 Thread David Winsemius
On Sep 9, 2011, at 12:21 PM, Dimitri Liakhovitski wrote: Hello! In the guidelines I've read: Comment your code. Entire commented lines should begin with # and one space. Short comments can be placed after code preceded by two spaces, #, and then one space. Just wondering if there is no

Re: [R] Comments inside a line? Not possible?

2011-09-09 Thread Dimitri Liakhovitski
Thank you, David. The only reason why I would prefer the in-line commenting is that it would save space. Having to start a new line stretches the code downwards. Dimitri On Fri, Sep 9, 2011 at 12:36 PM, David Winsemius dwinsem...@comcast.net wrote: On Sep 9, 2011, at 12:21 PM, Dimitri

Re: [R] Global optimisation with inequality constraints

2011-09-09 Thread Ravi Varadhan
Hi, Take a look at the multiStart() function in the BB package. This allows you to specify random multiple starting values, which need not satisfy constraints. Then you need to specify the constraints using the `projectLinear' argument. Ravi.

Re: [R] split variable / create categories

2011-09-09 Thread David Winsemius
On Sep 9, 2011, at 12:10 PM, Martin Batholdy wrote: Thanks for the suggestions! However all these functions don't produce exactly what I want (at least with my actual data). I need a split-algorithm that converts the values of my vectors into four factors. And the crucial part is, that I

Re: [R] split variable / create categories

2011-09-09 Thread David L Carlson
This will work as long as the number of values is evenly divisible by four and no two observations are identical. But if either of those assumptions is false, you cannot be certain to get the even split you are looking for x - c(3.2, 1.5, 6.8, 6.9, 8.5, 9.6, 1.1, 0.6)

Re: [R] conditional Latin hypercube sampling

2011-09-09 Thread Ben Bolker
Eric Tiger footballinlsu at yahoo.com writes: Hello, I got one question on the Latin hypercube sampling. suppose there are three variables a, b, c, all of them follow the normal distribution. the mean value and standard deviation for each are  a(32, 2), b(35,5), c(37,3). I would

Re: [R] reshape data from long to wide format

2011-09-09 Thread Dennis Murphy
Hi: There are two ways to go about this, depending on what you want. # 1: Jean's output format: # I'm using the reshape package here with cast(), # but it should work similarly with dcast() in reshape2: cast(example, DATE ~ SENSOR, value = 'VALUE') DATE A B C D E F 1

Re: [R] suggestion for proportions

2011-09-09 Thread array chip
Thanks all again for the suggestions. I agree with Wolfgang that mcnemar.test() is what I am looking for. The accuracy is the proportion of correct diagnosis compared to a gold standard, and I am interested in which diagnosis test is better, not particular interested in assessing the agreement

[R] Manhattan Plot

2011-09-09 Thread Weinfeld, Jillian
To whom it may concern: My name is Jillian Weinfeld. I am currently and undergraduate student at New York University and working at Mount Sinai School of Medicine doing research with epilepsy patients. At the moment I am creating a manhattan plot with my data set. After reading many forums

[R] simple t test for multiple colimns

2011-09-09 Thread Mihovil Pletikos
hi i am new to r and i would like to how could i do something like this in spss: T-TEST GROUPS=who('1' '2') /MISSING=ANALYSIS /VARIABLES= X3881686 X2672712 X2842570 X3526544 X2902531 X2402942 X3382216 X3771800 X2427469 X2392945 X2453006 X2562821 X3416651 X3552083 X3721851 X2477438 X2926969

Re: [R] Manhattan Plot

2011-09-09 Thread R. Michael Weylandt
You need to supply some information about how you actually are plotting your data so we can figure out what you've tried. Example code (with some toy data) would be greatly appreciated. Michael Weylandt On Fri, Sep 9, 2011 at 11:40 AM, Weinfeld, Jillian jillian.weinf...@mssm.edu wrote: To

Re: [R] Comments inside a line? Not possible?

2011-09-09 Thread Duncan Murdoch
On 09/09/2011 12:21 PM, Dimitri Liakhovitski wrote: Hello! In the guidelines I've read: Comment your code. Entire commented lines should begin with # and one space. Short comments can be placed after code preceded by two spaces, #, and then one space. Which guidelines are those? They seem

Re: [R] simple t test for multiple colimns

2011-09-09 Thread Jean-Christophe BOUËTTÉ
The examples in ?t.test and ?formula will help you. Don't forget An Introduction to R too to import your data in a data frame first... 2011/9/9 Mihovil Pletikos mihovil.pleti...@gmail.com: hi i am new to r and i would like to how could i do something like this in spss: T-TEST GROUPS=who('1'

Re: [R] Manhattan Plot

2011-09-09 Thread Jorge I Velez
Hi Jillian, Take a look at http://www.oga-lab.net/RGM2/func.php?rd_id=gap:mhtplot. Best, Jorge * * On Fri, Sep 9, 2011 at 12:40 PM, Weinfeld, Jillian wrote: To whom it may concern: My name is Jillian Weinfeld. I am currently and undergraduate student at New York University and working at

Re: [R] Rgl and plotmath symbols (via sprites): a trial

2011-09-09 Thread Duncan Murdoch
On 09/09/2011 12:19 PM, Marius Hofert wrote: Dear Duncan, attached my next trial. It seems to work :-) Unfortunately, not the printing to pdf. Not getting a high-quality pdf is certainly one of the major drawbacks. If anybody knows how to fix that, please let me know. Even when generating the

Re: [R] Read a list of files into named R data.frames

2011-09-09 Thread Dennis Murphy
Hi: Hmm, these files look familiar...Lahman database? :) I have the 2010 set, so here's how I got this to work on my system: files - list.files(pattern = '*.csv') files [1] Allstar.csv AllstarFull.csv [3] Appearances.csv AwardsManagers.csv [5] AwardsPlayers.csv

[R] Reliability metric

2011-09-09 Thread Halabi, Anan
Hi, Below is the code I write, I am trying to create a metric of h and t while the values is out of function R. First I have message warning Second, the metric is not created h - seq(0.1, 0.9, by=0.1) t - seq(0,11000, by=100) z - cbind(t) eta=1 beta=2 R - array (1:1100, dim=

Re: [R] Reliability metric

2011-09-09 Thread R. Michael Weylandt
Your code works fine -- the warning message is just a heads up that the object z/eta (which has length 111) does not quite match up with 1-h which has length 10: usually this is a sign that the user defined something improperly so R gives you a nice warning, but it doesn't halt the calculation.

Re: [R] Read a list of files into named R data.frames

2011-09-09 Thread Michael Friendly
Thanks, David Jean assign(), as you suggested works to create the named objects in the global environment. In my application, I also want to : (a) save each object to a similarly-named .RData file with that object (b) create a corresponding .Rd documentation file. (b) works fine in my loop

Re: [R] Reliability metric

2011-09-09 Thread R. Michael Weylandt
Well, I would point out to you that you only have 9 values of h which certainly is a problem in calculating 10 colmans(?) -- more generally, I'd suggest you learn more about the difference between vectorized operations and operations on vectors: things like `%*%` and outer() will help you greatly.

Re: [R] Reliability metric

2011-09-09 Thread David Winsemius
On Sep 9, 2011, at 3:14 PM, Halabi, Anan wrote: Hi, Below is the code I write, I am trying to create a metric of h and t while the values is out of function R. First I have message warning It is only a warning. Second, the metric is not created What not created means has already been

Re: [R] Reliability metric

2011-09-09 Thread William Dunlap
I may be wrong, but I thought the original poster was trying to make a matrix ('metric' sp.) of values, R, so that R[i,j] == f(t[i], h[i]) for all i and j where f - function(t, h)exp(-(t/eta*(1-h))^(beta*(1-h)) outer() would do that: R - outer(t, h, function(t,

Re: [R] function censReg in panel data setting

2011-09-09 Thread Igors
Dear Arne, Thank you for your answer. However it doesn't solve my problem fully. The problem is that I have much bigger data set than I sent to you (it was only a small part : 874 obs.). My full data set is 546718 obs. If I try to use censReg on full data set, then it still gives me the same

[R] Looping through multiple datasets already in memory

2011-09-09 Thread MatAra
Gents, I have the following loop: for (i in (seq(along=Draw.1[,1]))) {print(i)} # from 1 - 5 (counter) for (i in (seq(along=Draw.1[,1]))) {print(Draw[i,4])} # from the 1 - column (passes parameter per column) Now: I have multiple Draws [Draw.1 - Draw.100] in memory with different orders

[R] Question about plot.mona {cluster}

2011-09-09 Thread trekvana
Hello all, I what to print the banner plot that is output from the mona method in the cluster package but the problem is I dont want to print all that red ink. Here is an example: data(animals) ma - mona(animals) ma ## Plot similar to Figure 10 in Struyf et al (1996) plot(ma) I can change the

[R] GLM Question

2011-09-09 Thread Jim Silverton
The minimum achievable level of significance is defined asthe minimum of Prob(Y=y) over all y's. If I have GLM with a treatment and replicate and I would like to find out how to compute the minimum achievable level of significance for that GLM in R For example, how do I do this for the following

Re: [R] Looping through multiple datasets already in memory

2011-09-09 Thread Greg Snow
The best approach is to put all those datasets into a list, then you can loop through the elements of the list, or use lapply or sapply on the list. If you insist on keeping them outside of a list, or need a loop to put them into the list, then look at the 'get' function. -Original

[R] Different results with arima in R 2.12.2 and R 2.11.1

2011-09-09 Thread Luis Felipe Parra
Hello , I have estimated the following model, a sarima: p=9 d=1 q=2 P=0 D=1 Q=1 S=12 In R 2.12.2 Call: arima(x = xdata, order = c(p, d, q), seasonal = list(order = c(P, D, Q), period = S), optim.control = list(reltol = tol)) Coefficients: ar1 ar2 ar3 ar4 ar5

[R] Using SVG in R

2011-09-09 Thread Fong Chun Chan
Hi, I've been trying to use SVG in R using the function svg, but all my my graphics end up with the text being very small to be point you can't even see them. I've attached a screenshot of what the output for a histogram looks like. Here is my code: CairoSVG('file/location') hist()

Re: [R] Using SVG in R

2011-09-09 Thread R. Michael Weylandt
Perhaps the problem could be solved by playing with the pointsize argument to CairoSVG or the various plotting parameters of hist(). More generally, this code: R library(CairoSVG) R CairoSVG() R hist(rpois(500,3)) R dev.off() produced an entirely acceptable SVG image on my computer so I can't

  1   2   >