Re: [R] how to transform a data file

2011-11-29 Thread Petr PIKAL
Hi option 3 library(reshape) melt(d, id.vars=id) Regards Petr Hi PJ, Try # some data id - 1:20 m - matrix(sample(0:1, 200, TRUE), ncol = 10) colnames(m) - paste('V', 1:10, sep = ) d - data.frame(id, m) d # option 1 cbind(rep(d$id, each = ncol(d)-1), matrix(unlist(t(d[,-1])),

Re: [R] Transforming a string into a command

2011-11-29 Thread Petr PIKAL
On Nov 29, 2011, at 2:00 AM, Xu Wang wrote: Why don't the following two commands work? eval(parse(text=s)) eval(as.expression(s)) Hm, try to set an object s before calling. Regards Petr __ R-help@r-project.org mailing list

Re: [R] cumsum in 3d arrays

2011-11-29 Thread zloncaric
Yes exactly what I want! Thank you very much for your help. -- View this message in context: http://r.789695.n4.nabble.com/cumsum-in-3d-arrays-tp4110470p4118432.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org

[R] Inlcudung classes in de contigency table + dataoverflow

2011-11-29 Thread set
Hello Everybody, I'm making a contigency table with a dataset which looks like: ClassSizeMember1 Members2 Members3 etc. 1 2 A B 0 2 3 C D A 3

Re: [R] Sum matrix by rows, conditional on value

2011-11-29 Thread Katrina Bennett
Yes, that worked for me. Thank you. On Mon, Nov 28, 2011 at 10:16 PM, David Winsemius dwinsem...@comcast.netwrote: On Nov 29, 2011, at 1:08 AM, Katrina Bennett wrote: I'd like to sum a matrix only where the matrix meets a specific condition. The matrix has 365 rows and about 50,000

Re: [R] Transforming a string into a command

2011-11-29 Thread Xu Wang
David, Did my reply get orphaned or are you trying to help me realize that asking why something does not work is not a straightforward question? I'll try to cover both bases. I'll focus just on the first case that I don't understand. Suppose we have s- ln(a+b) a-1 b-2 eval(parse(text=s)) Error

Re: [R] window manager interface commands for linux

2011-11-29 Thread Patrick Connolly
On Mon, 28-Nov-2011 at 12:07PM +0100, Ana wrote: | How can i replicate this in Linux: | source(file.choose()) | As the Mac people used to say ungrammatically: Think Different. There are many ways of using Linux that can't be done in Windows and we know nothing of your setup, so it's not

[R] md.pattern ('mice') failure with more than 31 variables

2011-11-29 Thread saschaview
Hello How come that the function md.pattern() from package 'mice' delivers a warning when run over data sets with more than 31 variables? library( 'mice' ) x - as.data.frame( matrix( sample( c(1:3, 1:3, 1:3, NA), 7000, repl=TRUE ), ncol=35, dimnames=list(NULL, paste('V',

Re: [R] window manager interface commands for linux

2011-11-29 Thread Milan Bouchet-Valat
Le lundi 28 novembre 2011 à 12:07 +0100, Ana a écrit : How can i replicate this in Linux: source(file.choose()) I've tried source(tkgetOpenFile()) but with no luck Try this instead (it works here): source(tclvalue(tkgetOpenFile())) Cheers __

Re: [R] Transforming a string into a command

2011-11-29 Thread Petr PIKAL
Hi Did my reply get orphaned or are you trying to help me realize that asking why something does not work is not a straightforward question? I'll try to cover both bases. I'll focus just on the first case that I don't understand. Suppose we have s- ln(a+b) a-1 b-2

[R] Combining histograms and distribution curve

2011-11-29 Thread Gwanmesia
Dear Sir, I am reviewing a group of patients who had a surgical procedure. The histogram of the age frequency has a bimodal distribution. I am trying to emphasise this by adding a distribution curve on the histogram. Let's say the ages are 8, 9, 7, 6, 7, 8, 5, 4, 16, 12, 11, 10, 8, 7, 9

Re: [R] Transforming a string into a command

2011-11-29 Thread Jim Lemon
On 11/29/2011 06:30 PM, Xu Wang wrote: David, Did my reply get orphaned or are you trying to help me realize that asking why something does not work is not a straightforward question? I'll try to cover both bases. I'll focus just on the first case that I don't understand. Suppose we have s-

Re: [R] md.pattern ('mice') failure with more than 31 variables

2011-11-29 Thread Joshua Wiley
On Tue, Nov 29, 2011 at 1:58 AM, saschav...@gmail.com wrote: Hello How come that the function md.pattern() from package 'mice' delivers a warning when run over data sets with more than 31 variables? Because 2^31 is too large of a value to be represented as an integer. The 15th line of

Re: [R] Combining histograms and distribution curve

2011-11-29 Thread Mohamed Lajnef
Hi, Try lines function to get a distribution cruve: X-c(8, 9, 7, 6, 7, 8, 5, 4, 16, 12, 11, 10, 8, 7, 9 ) hist(X, prob=TRUE) lines(density(X)) Regrads ML Le 29/11/11 11:04, gwanme...@aol.com a écrit : Dear Sir, I am reviewing a group of patients who had a surgical procedure. The

[R] quick ANOVA question

2011-11-29 Thread syrvn
Hello, imagine the following experimental design: Group - Value control - 5 control - 6 control - 5 treated1 - 8 treated1 - 9 treated1 - 9 treated2 - 15 treated2 - 16 treated2 - 15 treated3 - 25 treated3 - 30 treated3 - 28 What I like to know is if I apply an ANOVA to this data and choose

Re: [R] window manager interface commands for linux

2011-11-29 Thread Jim Lemon
Ana wrote: How can i replicate this in Linux: source(file.choose()) Hi Ana, There is probably some way to do this with a shell script, but I am unaware of it. If you have the marvelous Tcl-Tk scripting language on your Linux box, you could write something like this: #!/usr/bin/wish #

[R] Read TXT file with variable separation

2011-11-29 Thread Raphael Saldanha
Hi! I have to import some TXT files into R, but the separation between the columns are made with different blank spaces, but each file use the same separation. Example: 31 104 5 0 11RUA SAO SEBASTIAO 25 BAIRRO FILETO

Re: [R] how to keep row name if there is only one row selected from a data frame

2011-11-29 Thread agent dunham
Dear Community: Thank you Michael, I did it as you said. However I still have a little problem with this staff. I try my lm's in my df1's variables. Let's say: lm1 - lm( df1$vi) ~ df1$v1 + df1$v2) Then I usally type: plot(lm1, 1:4) I'd like to see in the plots obtained the name of the

Re: [R] quick ANOVA question

2011-11-29 Thread Mohamed Lajnef
Hi, Anova compare the means of more than two groups, in your case anova test H0 hypothisis H0: means(control)=mean(tread1)=mean(tread2)=mean(tread3), if there is at least one différence, you can identify the mean difference between groups by using post hoc test to testing your B suggestion.

Re: [R] how to convert the lower triangle of a matrix to a symmetricmatrix

2011-11-29 Thread marella
@Olivier ETERRADOSSI : I tried gdata to convert a (1x1) lower triangular matrix to full matrix and got memory problems. Especially at this step : upperTriangle(a) - lowerTrangle(a) it consumes more than 3 GB . Any ideas on how to create full matrix with efficient memory management ?

[R] problem during installing bayesQR package for R 2.14 version

2011-11-29 Thread narendarreddy kalam
I typed the following command *install.packages('bayesQR')'* to install bayesQR(my R version is 2.14) i am encountered the following error. Installing package(s) into ‘C:/Users/knreddy.IDRBTVM/Documents/R/win-library/2.14’ (as ‘lib’ is unspecified) Warning: unable to access index for repository

Re: [R] Read TXT file with variable separation

2011-11-29 Thread Jan van der Laan
Raphael, This looks like fixed width format which you can read with read.fwf. In fixed width format the columns are not separated by white space (or other characters), but are identified by the positition in the file. So in your file, for example the first field looks to contained in the

Re: [R] problem during installing bayesQR package for R 2.14 version

2011-11-29 Thread R. Michael Weylandt
You can try downloading from the CRAN master (either a pre-packaged binary or source code). There's fortran code you might need to compile if you can't get the binary to work but it should be ok. http://cran.r-project.org/web/packages/bayesQR/index.html Michael On Tue, Nov 29, 2011 at 6:03 AM,

Re: [R] simplify source code

2011-11-29 Thread Christof Kluß
Hi Dennis, thank you very much. That works fine. Is there a possibility that R continue even if one of the models is not solvable? R currently terminates with an error message. greetings Christof Am 27-11-2011 01:34, schrieb Dennis Murphy: vars- c('y1', 'y2', 'y3') # Function to create

Re: [R] append to PDF file

2011-11-29 Thread Christof Kluß
Hi Jim, Hi Ken Am 27-11-2011 00:00, schrieb jim holtman: There is the 'pdftk' (PDF tool kit) that you will find on the web that will do the job. I have used it to both combine and split out the pages in the PDF file. yes, thx. GUI tools like www.pdfsam.org do the job too. But is there a

Re: [R] problem during installing bayesQR package for R 2.14 version

2011-11-29 Thread R. Michael Weylandt
Please cc the general list in your replies. I'm not a Windows expert and there are many on this list who know far more about that OS than I and can handle your question far more ably. As I said I'm not a Windows expert so you may wish to consult the R-Windows FAQ and the R Admin Installation

Re: [R] simplify source code

2011-11-29 Thread R. Michael Weylandt
Look into tryCatch() for error handling. Michael On Tue, Nov 29, 2011 at 7:01 AM, Christof Kluß ckl...@email.uni-kiel.de wrote: Hi Dennis, thank you very much. That works fine. Is there a possibility that R continue even if one of the models is not solvable? R currently terminates with an

Re: [R] append to PDF file

2011-11-29 Thread R. Michael Weylandt
I think you are looking for the system() command. Michael On Tue, Nov 29, 2011 at 7:11 AM, Christof Kluß ckl...@email.uni-kiel.de wrote: Hi Jim, Hi Ken Am 27-11-2011 00:00, schrieb jim holtman: There is the 'pdftk' (PDF tool kit) that you will find on the web that will do the job.  I have

Re: [R] Read TXT file with variable separation

2011-11-29 Thread Raphael Saldanha
Jan, This is what I'm looking for! Very thanks! On Tue, Nov 29, 2011 at 9:24 AM, Jan van der Laan rh...@eoos.dds.nl wrote: Raphael, This looks like fixed width format which you can read with read.fwf. In fixed width format the columns are not separated by white space (or other

[R] Bayesian Quantile regression installation

2011-11-29 Thread narendarreddy kalam
i have R 2.14 version.and i have downloaded bayesQR package from following link http://cran.r-project.org/web/packages/bayesQR/index.html my OS is Windows7.i have downloaded Windows binary: bayesQR_1.3.zip file from above link.I am new to R. So please tell me what is the next step i have to

[R] Non parametric, repeated-measures, factorial ANOVA

2011-11-29 Thread RobH2011
Hi I have data from an experiment that used a repeated-measures factorial 2x2 design (i.e. each participant contributed data to both levels of both factors). I need a non-parametric version of the repeated-measures factorial ANOVA to analyse the data. SPSS only has non-parametric tests for

[R] regarding installation of bayesQR package

2011-11-29 Thread narendarreddy kalam
i have R 2.14 version.and i have downloaded bayesQR package from following link http:// http://cran.r-project.org/web/packages/bayesQR/index.ht ml my OS is Windows7.i have downloaded Windows binary:bayesQR_1.3.zip file from above link.I am new to R. So please tell me what is the next step

[R] fill binary matrices with random 1s

2011-11-29 Thread Grant McDonald
Dear all, I am finding difficulty in the following, I would like to create an empty matrix e.g. 10x10 of 0s and sequentially fill this matrix with randomly placed a 1s until it is saturated. Producing 100 matrices of sequentially increasing density., This process needs to be randomized 1000

[R] Any function\method to use automatically Final Model after bootstrapping using boot.stepAIC()

2011-11-29 Thread aajit75
Hi List, Being new to R, I am trying to apply boot.stepAIC() for Model selection by bootstrapping the stepAIC() procedure. I had gone through the discussion in various thread on the variable selection methods. Understood the pros and cons of various method, also going through the regression

[R] Extracting from zip, removing certain file extensions

2011-11-29 Thread Mathew Brown
Hi there, I'm running R on windows 7 with Rstudio. Everyday I receive a zip file where a bunch of half-hourly files are zipped together. I then use xx=unzip(ind) to get xx, which consists of : [1] ./2011/A20112961503.flx ./2011/A20112961503.log ./2011/A20113211730.slt ./2011/A20113211800.slt

[R] heatmap.2 (blurred output heatmap)

2011-11-29 Thread Stuart
Hi I used to make heatmaps using following commands but now some thing has changed as I get library(gplots) heatmap. 2(qtl.map,Rowv=F,dendrogram=column,col=colorRampPalette(c(blue,lightblue,black,black,yellow,red)),breaks=seq(-4.01,4.01,length.out=51), density.info=none, ) following error and

Re: [R] Extracting from zip, removing certain file extensions

2011-11-29 Thread jim holtman
use pattern matching (regular expressions): e.g., myFileNames[grepl(slt$, myFileNames)] On Tue, Nov 29, 2011 at 8:36 AM, Mathew Brown mathew.br...@forst.uni-goettingen.de wrote: Hi there, I'm running R on windows 7 with Rstudio. Everyday I receive a zip file where  a bunch of half-hourly

Re: [R] append to PDF file

2011-11-29 Thread Uwe Ligges
On 29.11.2011 13:15, R. Michael Weylandt wrote: I think you are looking for the system() command. ... and you certainly do not want to use savePlot but rather use the pdf() device directly. Uwe Ligges Michael On Tue, Nov 29, 2011 at 7:11 AM, Christof Klußckl...@email.uni-kiel.de

Re: [R] Negative exponential fit

2011-11-29 Thread Uwe Ligges
On 29.11.2011 07:06, Indrajit Sengupta wrote: What have you tried so far - can you explain? fitdistrplus package is the default package for fitting distributions. It is a contributed packages, and perhaps it is a good one (I do not know), but calling it the *default* ... who defined that?

Re: [R] Extracting from zip, removing certain file extensions

2011-11-29 Thread Duncan Murdoch
On 29/11/2011 8:36 AM, Mathew Brown wrote: Hi there, I'm running R on windows 7 with Rstudio. Everyday I receive a zip file where a bunch of half-hourly files are zipped together. I then use xx=unzip(ind) to get xx, which consists of : [1] ./2011/A20112961503.flx ./2011/A20112961503.log

Re: [R] fill binary matrices with random 1s

2011-11-29 Thread Sarah Goslee
I have to admit I'm not entirely sure what your question is. How to put a 1 in a random position in a matrix? mat - matrix(0, 10, 10) mat[sample(1:nrow(mat), 1), sample(1:ncol(mat), 1)] - 1 will do so, but if you need to fill a random position that is *currently zero* then you'll need to wrap it

Re: [R] Bayesian Quantile regression installation

2011-11-29 Thread Sarah Goslee
Let's see... you could: - read the directions at http://cran.r-project.org or the longer ones here http://cran.r-project.org/doc/manuals/R-admin.pdf - look at the help for install.packages() - actually look at the menus for R, as there's an install from local file option there somewhere in the

Re: [R] heatmap.2 (blurred output heatmap)

2011-11-29 Thread Uwe Ligges
example(heatmap.2) works for me, hence it is either your data, your version of some package or your version of R that causes the problems, we do not have information of any of these although the posting guide asks you to provide this for each posting. So we cannot help. Uwe Ligges On

Re: [R] Transforming a string into a command

2011-11-29 Thread David Winsemius
On Nov 29, 2011, at 2:30 AM, Xu Wang wrote: David, Did my reply get orphaned All replies are orphaned. You are asked to include context if your question relies on code that has previously been posted. or are you trying to help me realize that asking why something does not work is not

Re: [R] regarding installation of bayesQR package

2011-11-29 Thread Uwe Ligges
On 29.11.2011 13:09, narendarreddy kalam wrote: i have R 2.14 2.14.0 I guess. version.and i have downloaded bayesQR package from following link http:// http://cran.r-project.org/web/packages/bayesQR/index.ht ml my OS is Windows7.i have downloaded Windows binary:bayesQR_1.3.zip file

Re: [R] x, y for point of intersection

2011-11-29 Thread Monica Pisica
Hi again, Working with my real data and not with the little example i sent to the list i discovered that segm_distance function from package pracma does not converge to 0 in all cases, even if i increase the number of iteration to 10,000 for example. It seems that it depends on the

Re: [R] fill binary matrices with random 1s

2011-11-29 Thread Bert Gunter
Folks: On Tue, Nov 29, 2011 at 6:24 AM, Sarah Goslee sarah.gos...@gmail.com wrote: I have to admit I'm not entirely sure what your question is. How to put a 1 in a random position in a matrix? mat - matrix(0, 10, 10)  mat[sample(1:nrow(mat), 1), sample(1:ncol(mat), 1)] - 1 This is

Re: [R] fill binary matrices with random 1s

2011-11-29 Thread David Winsemius
On Nov 29, 2011, at 7:32 AM, Grant McDonald wrote: Dear all, I am finding difficulty in the following, I would like to create an empty matrix e.g. 10x10 of 0s and sequentially fill this matrix with randomly placed a 1s until it is saturated. Producing 100 matrices of sequentially increasing

[R] Help needed in reproducing a plot

2011-11-29 Thread syrvn
Hello, can anybody tell me how to produce a plot like the one in http://cran.r-project.org/web/packages/lme4/vignettes/Implementation.pdf on page 13, Figure 6? The data is stored in: library(nlme) data(Oats) Cheers -- View this message in context:

[R] Problems with Raster and clim.pact packages with large netcdf files (2.7G) in x64 bit R

2011-11-29 Thread Emmanuel Jjunju
I normally use the raster or clim.pact pckages to read netcdf (.nc) files. This has always worked out for me until this weekend every time i try to read a .nc file i get the following error Program: C:\Program Files\RStudio\bin\x64\rsession.exe File: posixio.c, Line 417 Expression: offset = 0

Re: [R] fill binary matrices with random 1s

2011-11-29 Thread Dennis Murphy
Hi: Here's one approach. I assume that your first 1000 matrices have a single 1 in each matrix, the next set of 1000 have two 1's, ..., and the last one has 99 1's. (No point in doing all 1's since they're all constant.) If that's the case, then try the following. # Each row represents a

Re: [R] Extracting from zip, removing certain file extensions

2011-11-29 Thread Mathew Brown
Great, many thanks. On 11/29/2011 3:09 PM, Duncan Murdoch wrote: On 29/11/2011 8:36 AM, Mathew Brown wrote: Hi there, I'm running R on windows 7 with Rstudio. Everyday I receive a zip file where a bunch of half-hourly files are zipped together. I then use xx=unzip(ind) to get xx, which

[R] Matrix for correlation

2011-11-29 Thread Geophagus
hi @ all, I have problem with creating a matrix for a cor() function. I try to use the cor() function on a matrix to test the correlation between each value in a column. Maybe like corr(x, method = xyz). My x has two columns maybe like this: MEDIA VALUE Car 23 Train26 Plane 25 Cab

Re: [R] Help needed in reproducing a plot

2011-11-29 Thread jim holtman
Looks like a typical plot produced using the 'lattice' package. There is plenty of documentation on the use of the package. Run some of the examples. On Tue, Nov 29, 2011 at 10:43 AM, syrvn ment...@gmx.net wrote: Hello, can anybody tell me how to produce a plot like the one in

Re: [R] Matrix for correlation

2011-11-29 Thread R. Michael Weylandt
I'm not sure how you mean to calculate correlation if you have a single observation of each mediumcan you provide your data (or a subset thereof) so we can see what you are actually working with and if correlation makes sense. Michael On Tue, Nov 29, 2011 at 10:41 AM, Geophagus

Re: [R] Matrix for correlation

2011-11-29 Thread Uwe Ligges
On 29.11.2011 16:41, Geophagus wrote: hi @ all, I have problem with creating a matrix for a cor() function. I try to use the cor() function on a matrix to test the correlation between each value in a column. Maybe like corr(x, method = xyz). My x has two columns maybe like this: MEDIA VALUE

Re: [R] quick ANOVA question

2011-11-29 Thread S Ellison
-Original Message- What I like to know is if I apply an ANOVA to this data and choose the control group as the reference group (using the relevel function) what groups exactly are compared? Are only all treated groups 1, 2, 3 tested against the control group or are all possible

Re: [R] Decision Trees /Decision Analysis with R?

2011-11-29 Thread ianjacob
Hi, Unfortunately I do not have an answer to this question yet, but it is something I'm currently examining. We're hoping to construct a template for health economic evaluation using decision tree (eventually working up to more complex modelling methodologies). I'll keep you posted on our

Re: [R] Matrix for correlation

2011-11-29 Thread Grant McDonald
Do you have multiple data points for Car/Train etc? And do you want to see if there are differences between in mean/medians these modes of transport? If so explore anova, kruskal-wallis . Date: Tue, 29 Nov 2011 16:57:57 +0100 From: lig...@statistik.tu-dortmund.de To:

Re: [R] Help needed in reproducing a plot

2011-11-29 Thread Dennis Murphy
Hi: This looks like the one: library('lattice') data(Oats, package = 'MEMSS') print(xyplot(yield ~ nitro | Block, Oats, groups = Variety, type = c(g, b), auto.key = list(lines = TRUE, space = 'top', columns = 3), xlab = Nitrogen concentration (cwt/acre),

[R] Making the lines thicker in histogram

2011-11-29 Thread kerry1912
I'm using a histogram and want to overlay this onto a barplot. I need the histogram lines to be thicker in order for it to stand out more on top of the barplot. Is there a command in order to do this? Thanks in advance. -- View this message in context:

Re: [R] Matrix for correlation

2011-11-29 Thread Geophagus
Hi Michael, thank you so much for your fast reply. On the image below there is an example of what I mean. I need the correlation between the values on the fields with ?. http://r.789695.n4.nabble.com/file/n4119734/corr_ex.png But my source data is not in a matrix. It looks like the table in

Re: [R] Matrix for correlation

2011-11-29 Thread R. Michael Weylandt
I think everyone is worried about your data, not what a correlation matrix is. Now I think you may be even more turned around: you want a correlation between the values of the correlation matrix? Just dput() your data object and copy it into your email and we'll see if it's possible to calculate

[R] Notation

2011-11-29 Thread Silvano
Hi, what's mean / in command: betareg(inf~Grupo/Sexo, data=dados) it's a effect nested? -- Silvano Cesar da Costa Departamento de Estatística Universidade Estadual de Londrina Fone: 3371-4346 __

[R] Weird Excel Time Format

2011-11-29 Thread Hasan Diwan
I have a 10-column XLS file, with 2 date fields. As far as I can tell, they were configured identically in Excel 2010. One of these fields resembles 39406.577662037, whilst in Excel, it is shown as 2007-11-20 13:42:20. Applying as.Date() with the default format doesn't do it. Any ideas as to what

[R] format numbers without leading or trailing 0s

2011-11-29 Thread Michael Friendly
A simple question, but I can't find something to do what I want: Given: a vector of numbers, like lambda - c(0, 0.005, 0.01, 0.02, 0.04, 0.08) Desired: format them in minimal space for use as plot labels, ie, without leading or tailing 0s. For this example: lambdaf - c(0, .005, .01, .02,

Re: [R] format numbers without leading or trailing 0s

2011-11-29 Thread Sarah Goslee
Here's one way to get rid of leading zeros before the decimal point: gsub(^0\\., \\., as.character(lambda)) [1] 0.005 .01 .02 .04 .08 Sarah On Tue, Nov 29, 2011 at 12:04 PM, Michael Friendly frien...@yorku.ca wrote: A simple question, but I can't find something to do what I want:

Re: [R] Weird Excel Time Format

2011-11-29 Thread Prof Brian Ripley
If all else fails, read the help page. There are examples on ?as.Date of reading Excel dates. But I don't believe the time you give. (0.577662037 is just before 13:51:50). On Tue, 29 Nov 2011, Hasan Diwan wrote: I have a 10-column XLS file, with 2 date fields. As far as I can tell, they

Re: [R] format numbers without leading or trailing 0s

2011-11-29 Thread Bert Gunter
.. and if you want to simultaneously handle possible multiple trailing zeros (not sure whether this could even happen) (somewhat but not completely tested) lambda - c(0, 0.005, 0.01, 0.02, 0.04, 0.08) gsub(^0(\\..*[^0])0*$,\\1,lambda) [1] 0.005 .01 .02 .04 .08 Note that the

Re: [R] Making the lines thicker in histogram

2011-11-29 Thread Jean V Adams
kerry1912 wrote on 11/29/2011 09:51:34 AM: I'm using a histogram and want to overlay this onto a barplot. I need the histogram lines to be thicker in order for it to stand out more on top of the barplot. Is there a command in order to do this? Thanks in advance. This topic has been

Re: [R] Weird Excel Time Format

2011-11-29 Thread Hasan Diwan
On 29 November 2011 09:32, Prof Brian Ripley rip...@stats.ox.ac.uk wrote: If all else fails, read the help page.  There are examples on ?as.Date of reading Excel dates. I did, it seems there is either (a) a problem with my code, or (b) a problem with the documentation. See below: rawtimeColumn

Re: [R] Weird Excel Time Format

2011-11-29 Thread Jeff Newmiller
You haven't indicated how you are accessing the Excel file, or whether it is an XLS or XLSX file. It sounds like you might be using rcom or a dependent package, in which case you may need to read the Excel COM interface documentation more carefully. In any event, you can't expect as.Date to

Re: [R] format numbers without leading or trailing 0s

2011-11-29 Thread William Dunlap
You may also want to deal with a possible leading negative sign: lambda - c(0, 0.005, 0.01, 0.02, 0.04, 0.08, -0.005, -0.01, -0.02, -0.04, -0.08, 1000) gsub(^0(\\..*[^0])0*$,\\1, lambda) [1] 0 .005 .01.02.04.08 [7] -0.005 -0.01 -0.02 -0.04 -0.08

Re: [R] format numbers without leading or trailing 0s

2011-11-29 Thread Jeff Newmiller
Omitting the leading zero is dangerous, since the decimal point can disappear in a poor hardcopy leading to later misinterpretation. --- Jeff NewmillerThe . . Go Live...

Re: [R] Weird Excel Time Format

2011-11-29 Thread Hasan Diwan
On 29 November 2011 10:26, Jeff Newmiller jdnew...@dcn.davis.ca.us wrote: You haven't indicated how you are accessing the Excel file, or whether it is an XLS or XLSX file. It sounds like you might be using rcom or a dependent package, in which case you may need to read the Excel COM interface

Re: [R] Weird Excel Time Format

2011-11-29 Thread Kevin E. Thorpe
On 11/29/2011 01:39 PM, Hasan Diwan wrote: On 29 November 2011 10:26, Jeff Newmillerjdnew...@dcn.davis.ca.us wrote: For my part, I highly recommend exporting to CSV before importing to R. Will look into doing so... I don't think this point can be stressed enough. I have had too many bad

[R] Why Numeric Values Become Factors in Data Frame

2011-11-29 Thread Rich Shepard
I have a data frame with 1 factor, one date, and 37 numeric values: str(waterchem) 'data.frame': 3525 obs. of 39 variables: site : Factor w/ 64 levels D-1,D-2,D-3,..: 1 1 1 1 1 ... $ sampdate : Date, format: 2007-12-12 2008-03-15 ... $ CO3 : num 1 1 6.7 1 1 1 1 1 1 1 ... $

Re: [R] Transforming a string into a command

2011-11-29 Thread Xu Wang
Petr, thanks for pointing that out. Jim, you are exactly right! Thank you for catching that. I did not realize in the other replies that they were using log and not ln. David, thank you for the lessons. I will improve my question asking skills. Thanks to all, Xu On Tue, Nov 29, 2011 at 9:31

[R] hour in x-axis

2011-11-29 Thread threshold
Dear R useres, got the following problem. Given the AggData (listed below) I need to plot AggData[,2] vs time (AggData[,1]) for chosen 'rows'. Ive done already: plot(AggData[rows,2], xaxt='n') axis(1,at=seq(1,length(rows),1),sub(,, AggData[rows,1])) which works, but I need to list only chosen

[R] Calculating the probability for a logistic regression

2011-11-29 Thread sirilkt
Hi All, When we run the command : summary ( newmod-gam(Dlq~ formula,family,,data) ) in R, the output would the effect of smoothness in R. As of now to calculate the probability I am following the below approach: 1) Run the plot of the GAM , interpret the curves 2) Re Run the Regression

[R] Parameters setting in functions optimization

2011-11-29 Thread Diane Bailleul
Good afternoon everybody, I'm quite new in functions optimization on R and, whereas I've read lot's of function descriptions, I'm not sure of the correct settings for function like optimx and nlminb. I'd like to minimize my parameters and the loglikelihood result of the function. My parameters

[R] R help

2011-11-29 Thread Heh Ness
I have a model like this (Nelson and Siegel 1987) img src=http://r.789695.n4.nabble.com/file/n4120161/31f188c684764cd431619dbb59fed5ae.png; border=0/ where tau and y are the maturities and yields, respectively, given to me in my data file..

Re: [R] Why Numeric Values Become Factors in Data Frame

2011-11-29 Thread Joshua Wiley
Hi Rich, Try looking at: levels(waterchem$SC) There must be something in that column that is triggering R to read it as character. Potential examples include using . to indicate missing values or anything else that is not itself directly numeric. You might also get some mileadge out of

Re: [R] Why Numeric Values Become Factors in Data Frame

2011-11-29 Thread David Winsemius
On Nov 29, 2011, at 2:18 PM, Rich Shepard wrote: I have a data frame with 1 factor, one date, and 37 numeric values: str(waterchem) 'data.frame': 3525 obs. of 39 variables: site : Factor w/ 64 levels D-1,D-2,D-3,..: 1 1 1 1 1 ... $ sampdate : Date, format: 2007-12-12 2008-03-15 ...

Re: [R] Why Numeric Values Become Factors in Data Frame

2011-11-29 Thread Marc Schwartz
On Nov 29, 2011, at 1:18 PM, Rich Shepard wrote: I have a data frame with 1 factor, one date, and 37 numeric values: str(waterchem) 'data.frame': 3525 obs. of 39 variables: site : Factor w/ 64 levels D-1,D-2,D-3,..: 1 1 1 1 1 ... $ sampdate : Date, format: 2007-12-12 2008-03-15 ...

Re: [R] Why Numeric Values Become Factors in Data Frame

2011-11-29 Thread William Dunlap
You can see what the offending strings are with with(waterchem, levels(SC)[is.na(as.numeric(levels(SC)))]) [1] - + Warning message: In eval(expr, envir, enclos) : NAs introduced by coercion but it may be easiest to use the colClasses argument to read.table to force that column to be

Re: [R] hour in x-axis

2011-11-29 Thread Justin Haynes
without knowing much about your data or the base plotting... I'd use the library ggplot2. First, you'll need to format your dates to POSIXct AggData$time - as.POSIXct(AggData$time,format='%H:%M') Then plotting is trivial. ggplot(AggData,aes(x=time,y=value))+geom_points() or +geom_line() if

Re: [R] problem during installing bayesQR package for R 2.14 version

2011-11-29 Thread John C Frain
By any chance is Kalem accessing the Internet through a proxy server which requires a userid and password. There're are instructions in the Windows FAQ on how to deal with this. He may need to obtain some information from his IT department. Alternatively he could download the zip file and

[R] aggregate syntax for grouped column means

2011-11-29 Thread Juliet Hannah
I am calculating the mean of each column grouped by the variable 'id'. I do this using aggregate, data.table, and plyr. My aggregate results do not match the other two, and I am trying to figure out what is incorrect with my syntax. Any suggestions? Thanks. Here is the data. myData -

Re: [R] aggregate syntax for grouped column means

2011-11-29 Thread Jeff Newmiller
The semantics for na.rm are different for aggregate than for the other options. The former removes any rows that contain an NA prior to performing the computation, the latter methods work column-wise. You have to decide which is correct for your purposes.

Re: [R] aggregate syntax for grouped column means

2011-11-29 Thread Justin Haynes
look at just your data that is in that first id category and I bet you can figure it out! myData[myData$id=='0m11',] var1 var2 id 10 30.79 32.15 0m11 11 30.79 32.39 0m11 12 30.94NA 0m11 aggregate performs the na.rm step on the entire row thus, a mean of 30.79. data.table and plyr

Re: [R] Weird Excel Time Format

2011-11-29 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Hasan Diwan Sent: Tuesday, November 29, 2011 10:16 AM To: Prof Brian Ripley Cc: R Project Help Subject: Re: [R] Weird Excel Time Format On 29 November 2011 09:32, Prof Brian

[R] Help in determining the formula for a mixed model analysis

2011-11-29 Thread Marianne Stephan
Dear R and statistics experts: I have data of a behavioral experiment with the aim to investigate the effect of a memory task on motor learning. Question: I would appreciate help in figuring out a possible formula to determine whether motor learning across sessions differs between 2

Re: [R] Vegan: Diversity Plot, label points

2011-11-29 Thread Gavin Simpson
On Wed, 2011-11-23 at 16:02 -0300, Alejo C.S. wrote: Dear List, I can'f figure how to add point labels in the next plot (example from ?taxondive help page): library(vegan) data(dune) data(dune.taxon) taxdis - taxa2dist(dune.taxon, varstep=TRUE) mod - taxondive(dune, taxdis) plot(mod)

Re: [R] I cannot get species scores to plot with site scores in MDS when I use a distance matrix as input. Problems with NA's?

2011-11-29 Thread Gavin Simpson
On Thu, 2011-11-24 at 07:57 -0800, B77S wrote: Try the daisy() function from the package cluster, it seems to be able to handle NAs and non-dummy coded character variables metaMDS(daisy(df, metric=gower)) That won't help the OP as the species scores (the species data, i.e. the traits in this

Re: [R] I cannot get species scores to plot with site scores in MDS when I use a distance matrix as input. Problems with NA's?

2011-11-29 Thread Gavin Simpson
On Thu, 2011-11-24 at 12:16 +, Edwin Lebrija Trejos wrote: Hi, First I should note I am relatively new to R so I would appreciate answers that take this into account. I am trying to perform an MDS ordination using the function “metaMDS” of the “vegan” package. I want to ordinate species

Re: [R] Why Numeric Values Become Factors in Data Frame

2011-11-29 Thread Rich Shepard
On Tue, 29 Nov 2011, Rich Shepard wrote: Pointers on how to determine why this one variable has some values and characters rather than as numerics are needed. Joshua, Marc, David, Bill, Sarah, Bert, et al.: Thank you all for the insights and ideas. It was a valuable lesson and it helped

[R] Problem in log

2011-11-29 Thread Gyanendra Pokharel
Hi all I have a function of log defined by y = log(1- exp(-a)), when exp(-a) is greater, 1, it produce NaN. How can I remove this in R? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Problem in log

2011-11-29 Thread R. Michael Weylandt
Do you mean remove the NaNs? Try na.omit() or complete.cases() or many other options. If you mean you want the complex log, try log(as.complex(1-exp(-a))) Michael On Tue, Nov 29, 2011 at 5:02 PM, Gyanendra Pokharel gyanendra.pokha...@gmail.com wrote: Hi all I have a function of log defined by

Re: [R] [SOLVED]looking for beta parameters

2011-11-29 Thread Kehl Dániel
I managed to solve the problem myself without using this code. thx 2011-11-24 12:26 keltezéssel, Kehl Dániel írta: Dear Community, I am trying to write code for the following problem. Lets assume we have a beta distribution. I know one quantile, lets say, 10% of the mass lies above .8, that

  1   2   >