Re: [R] Problem between panel.abline and log scales (lattice)

2009-01-19 Thread Deepayan Sarkar
On 1/12/09, Ptit_Bleu ptit_b...@yahoo.fr wrote: Hello and Happy New Year to all R-Users !!! I would like to plot a lattice graph with a logarthmic y axis and add two reference lines that is : ref-c(0.0070, 0.0096) graph1-xyplot(data$y1 ~ as.numeric(strptime(data$x1, format=%Y-%m-%d

[R] time series contains internal NAs error

2009-01-19 Thread Harsh
Hello R List, I seem to have a peculiar problem. When using time series data, I get the following error when running the acf and pacf function. Using the function acf(dtxts,plot= TRUE,xaxt = n,col=red,na.action = na.omit) (where dtxts is a time series object created with package xts ) results in

Re: [R] Mac OS X / preview.app / fullrefman.pdf

2009-01-19 Thread Stefan Evert
when reading R's fullrefman.pdf (available from http://cran.r-project.org/doc/manuals/fullrefman.pdf) in Mac OS X's preview.app (version 4.1, on Mac OS 10.5.x), if i try to do a keyword search within the document, the indexing step freezes about 2/3 the way through the progress bar. this

[R] bootstrapped eigenvector method following prcomp

2009-01-19 Thread Axel Strauß
G'Day R users! Following an ordination using prcomp, I'd like to test which variables singnificantly contribute to a principal component. There is a method suggested by Peres-Neto and al. 2003. Ecology 84:2347-2363 called bootstrapped eigenvector. It was asked for that in this forum in

[R] pchisq error

2009-01-19 Thread Jeremy Silver
Dear R experts, I'm trying to call 'pchisq' from within a C subroutine. The following error is returned: ** NON-convergence in pgamma()'s pd_lower_cf() f= nan. This error message is not printed the first time I call 'pchisq' from the C subroutine, but the second time or the next time I call

Re: [R] regex - negate a word

2009-01-19 Thread Wacek Kusnierczyk
Rolf Turner wrote: On 19/01/2009, at 10:44 AM, Gabor Grothendieck wrote: Well, that's why it was only provided when you insisted. This is not what regexp's are good at. On Sun, Jan 18, 2009 at 4:35 PM, Rau, Roland r...@demogr.mpg.de wrote: Thanks! (I have to admit, though, that I expected

Re: [R] bootstrapped eigenvector method following prcomp

2009-01-19 Thread Axel Strauß
Axel Strauß schrieb: G'Day R users! Following an ordination using prcomp, Sorry, correction. I mean using princomp. I'd like to test which variables singnificantly contribute to a principal component. There is a method suggested by Peres-Neto and al. 2003. Ecology 84:2347-2363 called

[R] JRI problem

2009-01-19 Thread Ruan Weichao
Hi, I installed JRI in my 64bit linux. And when i run the test case in JRI, it turns out such Exception: JNI_GetCreatedJavaVMs said there's no JVM running! Exception in thread Thread-1 java.lang.NullPointerException at org.rosuda.JRI.Rengine.setupR(Rengine.java:131) at

Re: [R] regex - negate a word

2009-01-19 Thread Wacek Kusnierczyk
Stavros Macrakis wrote: On Sun, Jan 18, 2009 at 2:22 PM, Wacek Kusnierczyk waclaw.marcin.kusnierc...@idi.ntnu.no wrote: x[-grep(abc, x)] which unfortunately fails if none of the strings in x matches the pattern, i.e., grep returns integer(0); Yes. arguably, x[integer(0)]

Re: [R] pchisq error

2009-01-19 Thread Thomas Lumley
I don't get the error, but I assume it's because your C function returns a double and .C() assumes it is a void function. -thomas On Mon, 19 Jan 2009, Jeremy Silver wrote: Dear R experts, I'm trying to call 'pchisq' from within a C subroutine. The following error is returned: **

Re: [R] bootstrapped eigenvector method following prcomp

2009-01-19 Thread Gavin Simpson
Hi Alex, I presume you've asked Jari what the bug is? He obviously knows and you are asking a lot for the rest of us to i) know the method you speak of and ii) debug the code of another. As an alternative, try function testdim() in the ade4 package. This implements the method of Dray: Dray, S

Re: [R] pchisq error

2009-01-19 Thread Bernardo Rangel Tura
On Mon, 2009-01-19 at 09:54 +0100, Jeremy Silver wrote: Dear R experts, (...) pchisq(5.464342,1,lower.tail = FALSE) [1] 0.01940836 reproduceError(5.464342) stat = 5.464342, p = 0.019408 pchisq(5.464342,1,lower.tail = FALSE) [1] NaN Warning messages: 1: In pchisq(5.464342,

Re: [R] pchisq error

2009-01-19 Thread Jeremy Silver
oops. . . . Turning it into a void function fixed the problem! Thanks. Jeremy Thomas Lumley wrote: I don't get the error, but I assume it's because your C function returns a double and .C() assumes it is a void function. -thomas On Mon, 19 Jan 2009, Jeremy Silver wrote: Dear R

Re: [R] regex - negate a word

2009-01-19 Thread Prof Brian Ripley
On Mon, 19 Jan 2009, Rolf Turner wrote: On 19/01/2009, at 10:44 AM, Gabor Grothendieck wrote: Well, that's why it was only provided when you insisted. This is not what regexp's are good at. On Sun, Jan 18, 2009 at 4:35 PM, Rau, Roland r...@demogr.mpg.de wrote: Thanks! (I have to admit,

Re: [R] Perl-R bridge

2009-01-19 Thread adam_pgsql
you could take a look at this: http://www.omegahat.org/RSPerl/ but I'm not sure how well maintained it is currently. adam On 19 Jan 2009, at 02:00, ANJAN PURKAYASTHA wrote: Hi, I'm planning to access R from my perl scripts. The only noteworthy bridge seems to be

Re: [R] Memory allocation

2009-01-19 Thread Keith Ponting
Gabriel Margarido gramarga at gmail.com writes: ... I looked for a way to return the values without copying (even tried Rmemprof), but without success. Any ideas? ... I solved similar problems using the R.oo package, which emulates pass-by-reference semantics in 'R'. HTH Keith

Re: [R] Deleting columns where the frequency of values are too disparate

2009-01-19 Thread Richard . Cotton
Please consider the following toy data matrix example, called x for simplicity. There are 20 different individuals (ID), with information about the alleles (A,T, G, C) at six different loci (Locus1 - Locus6) for each of these 20 individuals. At any single locus (e.g., Locus1 or Locus2,

[R] How to assign names in a list

2009-01-19 Thread john seers (IFR)
Hi All How can you associate names with a list when names have not been assigned? For example if you have a list like this: list2-list(1,2,3) list2 [[1]] [1] 1 [[2]] [1] 2 [[3]] [1] 3 How do you make it look like this with names? : f1-1 f2-2 f3-3 list1-list(name1=f1, name2=f2, name3=f3)

Re: [R] How to assign names in a list

2009-01-19 Thread Henrique Dallazuanna
If I understand correctly: names(list2) - paste(name, 1:3, sep = ) On Mon, Jan 19, 2009 at 10:23 AM, john seers (IFR) john.se...@bbsrc.ac.ukwrote: Hi All How can you associate names with a list when names have not been assigned? For example if you have a list like this:

[R] termplot

2009-01-19 Thread Robert Michael Inman
I have used glm and stepAIC to choose a best model. I can use termplot to assess the contribution of each explanatory variable in the glm. However the final model after running stepAIC includes interaction terms, and when I do termplot I get Error in `[.data.frame`(mf, , i) : undefined columns

Re: [R] How to assign names in a list

2009-01-19 Thread john seers (IFR)
Thanks Henrique and Nathalie for your answers. Very strange - I thought I had tried that and it had not worked so I came to the conclusion that names did not work on lists. Now it does work, so I must have had some finger trouble. Regards John --- From: Henrique

Re: [R] lattice question: independent per-row or per-column scaling?

2009-01-19 Thread hadley wickham
On Thu, Jan 8, 2009 at 11:25 AM, René J.V. Bertin rjvber...@gmail.com wrote: Hello - and happy newyear to all of you! I've got some data that I'm plotting with bwplot, a 3x2x3 design where the observable decreases with the principle independent factor, but at different rates. I'd like to

Re: [R] conditional weighted quintiles

2009-01-19 Thread David Freedman
You might want to look at the 'quantreg' package, written by Roger Koenker, in CRAN. The associated vignette has many examples. Abuzer Bakis wrote: Dear All, I am economist and working on poverty / income inequality. I need descriptive statitics like the ratio of education

[R] reference category for factor in regression

2009-01-19 Thread Jos Elkink
Hi all, I am struggling with a strange issue in R that I have not encountered before and I am not sure how to resolve this. The model looks like this, with all irrelevant variables left out: LABOUR - a dummy variable NONLABOUR = 1 - LABOUR AGE - a categorical variable / factor VOTE - a dummy

Re: [R] time series contains internal NAs error

2009-01-19 Thread stephen sefick
It would be helpful to have a reproducible dataset to track down what is happening. On Mon, Jan 19, 2009 at 3:45 AM, Harsh singhal...@gmail.com wrote: Hello R List, I seem to have a peculiar problem. When using time series data, I get the following error when running the acf and pacf

Re: [R] time series contains internal NAs error

2009-01-19 Thread Harsh
Very Sorry for the oversight. The dataset that I have used is: Sunspots,Datefield 9.5,1/1/1900 2.7,1/1/1901 5,1/1/1902 24.4,1/1/1903 42,1/1/1904 63.5,1/1/1905 53.8,1/1/1906 62,1/1/1907 48.5,1/1/1908 43.9,1/1/1909 18.6,1/1/1910 5.7,1/1/1911 3.6,1/1/1912 1.4,1/1/1913 9.6,1/1/1914 47.4,1/1/1915

Re: [R] about power.law.fit

2009-01-19 Thread Gábor Csárdi
power.law.fit simply ML fits the 'prob(d) = d^\alpha' model to the input, where d is positive integer. It seems to work for me: data - sample(1:1, prob=(1:1)^-3, rep=TRUE) power.law.fit(data) Call: mle(minuslogl = mlogl, start = list(alpha = start)) Coefficients: alpha 3.017056

Re: [R] reference category for factor in regression

2009-01-19 Thread ONKELINX, Thierry
Dear Jos, In R you don't need to create you own dummy variables. Just create a factor variable LABOUR (with two levels) and rerun your model. Then you should be able to calculate all coefficients. HTH, Thierry ir.

Re: [R] time series contains internal NAs error

2009-01-19 Thread Achim Zeileis
On Mon, 19 Jan 2009, stephen sefick wrote: It would be helpful to have a reproducible dataset to track down what is happening. True. Although in this case it's relatively easy to guess what went wrong. The user probably has some irregular series, for example daily with missing days: x

Re: [R] time series contains internal NAs error

2009-01-19 Thread Gabor Grothendieck
The statement to read in the data is missing from your post but I suspect that you are representing the data as daily data so its filling in 364 or 365 NA's between points. Represent it as the annual data that it is. Try this: Lines - Sunspots,Datefield 9.5,1/1/1900 2.7,1/1/1901 5,1/1/1902

Re: [R] lattice question: independent per-row or per-column scaling?

2009-01-19 Thread Chuck Cleland
On 1/19/2009 8:51 AM, hadley wickham wrote: On Thu, Jan 8, 2009 at 11:25 AM, René J.V. Bertin rjvber...@gmail.com wrote: Hello - and happy newyear to all of you! I've got some data that I'm plotting with bwplot, a 3x2x3 design where the observable decreases with the principle independent

Re: [R] time series contains internal NAs error

2009-01-19 Thread Achim Zeileis
On Mon, 19 Jan 2009, Gabor Grothendieck wrote: The statement to read in the data is missing from your post but I suspect that you are representing the data as daily data so its filling in 364 or 365 NA's between points. Represent it as the annual data that it is. One further pointer: Also

Re: [R] termplot

2009-01-19 Thread John Fox
Dear Bob, Take a look at the effects package, described in http://www.jstatsoft.org/v08/i15/paper. I hope this helps, John -- John Fox, Professor Department of Sociology McMaster University Hamilton, Ontario, Canada web: socserv.mcmaster.ca/jfox -Original

[R] Sweave encoding problem

2009-01-19 Thread Gerrit Voigt
Hello, Sweave seems to have trouble processing german letters in R. For example, my noweb R-input looks like this. = Oberflächenfehler = c(4, 11, 6, 2, 7, 9) @ If I send it through Sweave, I get the following error message. error: chunk 1 Error in parse(text = chunk) : unexpected input in

Re: [R] plot data with a colour scale - more details!

2009-01-19 Thread Rayhan Ahmed
Hi Jim, This is clearly the function I need to use. However, I am new to Rplot and coding. I know that my output image is not what the data indicate. My input file is a matrix, where the first row is the residue number (10 values), and the second row is the hydrophathy values (10 corresponding

Re: [R] reference category for factor in regression

2009-01-19 Thread Jos Elkink
Hi Thierry, Thanks for your quick answer. The problem is not so much the LABOUR variable, however, but the AGE variable, which consists of about 5 categories for which I do indeed not create separate dummy variables. But R does not behave as expected when deciding on which dummy to use as

Re: [R] Mac OS X / preview.app / fullrefman.pdf

2009-01-19 Thread Berend Hasselman
mmuurr[AT]gmail.com wrote: . has anyone else experienced this? i sent in a bug report to Apple, but i doubt i'll see any change in preview.app prior to the next OS release. fullrefman.pdf is also the only document that i've ever observed this behavior with, and since i can now

Re: [R] Sweave encoding problem

2009-01-19 Thread Rau, Roland
Hi Gerrit, -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Gerrit Voigt Sent: Monday, January 19, 2009 4:48 PM To: r-help@r-project.org Subject: [R] Sweave encoding problem Hello, Sweave seems to have trouble processing

[R] WinBUGS with R

2009-01-19 Thread Lindsay Stirton
Dear UseRs, I am having some problems using R with WinBUGS using the R2WinBUGS package. Specifically, when I try to run bugs() I get the following message. Error in FUN(X[[1L]], ...) : .C(..): 'type' must be real for this format To give a little more context, my bugs() command (for a

Re: [R] reference category for factor in regression

2009-01-19 Thread Berwin A Turlach
G'day Jos, On Mon, 19 Jan 2009 15:52:00 + Jos Elkink jos.elk...@ucd.ie wrote: Thanks for your quick answer. The problem is not so much the LABOUR variable, however, but the AGE variable, which consists of about 5 categories for which I do indeed not create separate dummy variables. But R

Re: [R] reference category for factor in regression

2009-01-19 Thread Stephan Kolassa
Hi Jos, you can force R to set contrasts for factors the way you like them with contrasts(). You seem to be thinking of treatment contrasts, which are most easily interpreted, but there are also others. However: are you sure you want to bin an age variable into categories? You will lose

Re: [R] bootstrapped eigenvector method following prcomp

2009-01-19 Thread Stas Kolenikov
I don't know if there are bugs in the code, but the step 4) does not compute significance... at least the way statisticians know it. The fractions above or below 0 are not significance. I don't even know how to call those... probably cdf of the bootstrap distribution evaluated at zero. Let's put

Re: [R] reference category for factor in regression

2009-01-19 Thread Marc Schwartz
Jos, See ?relevel for information on how to reorder the levels of a factor, while being able to specify the reference level. Basically, the first level of the factor is taken as the reference. If you want to utilize a different ordering, as an alternative to the above, simply use: AGE -

[R] ifelse help?

2009-01-19 Thread rkevinburton
I am having a hard time understanding what is happening with ifelse. Let me illustrate: h - numeric(5) p - 1:5 j - floor(j) x - 1:1000 ifelse(h == 0, x[j+2], 1:5) [1] 2 3 4 5 6 My question is, shouldn't this be retruning 25 numbers? It seems that the ifelse should check 5 values of h for

[R] Using apply to generate matrix from rows?

2009-01-19 Thread Stephan Lindner
Dear all, I have a simple question which I unfortunately do not seem to be able to solve myself. I have a (NxK) matrix and want to generate a new matrix by multiplying each row with itself such that the new matrix has dimension ((N*K)xK) (or better, generate an array with dimension (K,K,N)). I

Re: [R] lazy evaluation question

2009-01-19 Thread Peter Dalgaard
Gabor Grothendieck wrote: Note that rm(i) for(j in 1:4) F(j) raises an error due to scoping issues. Yes. This has nothing to do with lazy evaluation, and everything to do with scoping: f is not defined in the scope of F, so does not know about its variables (nor those in the implicit loop

Re: [R] lazy evaluation question

2009-01-19 Thread Gabor Grothendieck
On Mon, Jan 19, 2009 at 12:40 PM, Peter Dalgaard p.dalga...@biostat.ku.dk wrote: Gabor Grothendieck wrote: Note that rm(i) for(j in 1:4) F(j) raises an error due to scoping issues. Yes. This has nothing to do with lazy evaluation, and everything to do with scoping: f is not defined in

Re: [R] Using apply to generate matrix from rows?

2009-01-19 Thread Henrique Dallazuanna
Try this: matrix(apply(u, 1, tcrossprod), nr = nrow(u)*ncol(u), byrow = T) On Mon, Jan 19, 2009 at 3:39 PM, Stephan Lindner lindn...@umich.edu wrote: Dear all, I have a simple question which I unfortunately do not seem to be able to solve myself. I have a (NxK) matrix and want to generate

Re: [R] Using apply to generate matrix from rows?

2009-01-19 Thread Jorge Ivan Velez
Dear Stephan, Try this: do.call(rbind,lapply(1:2,function(x) matrix(u[x,]%*%t(u[x,]),ncol=ncol(u HTH, Jorge On Mon, Jan 19, 2009 at 12:39 PM, Stephan Lindner lindn...@umich.eduwrote: Dear all, I have a simple question which I unfortunately do not seem to be able to solve myself. I

[R] download/retain text file structure with RCurl/getURL()

2009-01-19 Thread zack holden
Dear list, I'm trying to download a text file directly from the internet using the RCurl package and the command getURL. Duncan Lang graciously helped me solve the first step in this problem using the following command: # txtfile -

Re: [R] ifelse help?

2009-01-19 Thread Charles C. Berry
On Mon, 19 Jan 2009, rkevinbur...@charter.net wrote: I am having a hard time understanding what is happening with ifelse. Let me illustrate: h - numeric(5) p - 1:5 j - floor(j) And j is 0:4 + epsilon , where 0 = epsilon 1, evidently. x - 1:1000 ifelse(h == 0, x[j+2], 1:5) [1] 2 3 4 5 6

Re: [R] download/retain text file structure with RCurl/getURL()

2009-01-19 Thread Gabor Grothendieck
If you are having problems with the default download.file method you can try method = wget: f - ftp://ftp.wcc.nrcs.usda.gov/data/snow/snow_course/table/history/idaho/13e19.txt; download.file(f, basename(f), method = wget) On Mon, Jan 19, 2009 at 1:26 PM, zack holden zack_hol...@hotmail.com

[R] gz netCDF files

2009-01-19 Thread Magdalena Lucini
Hello, I am trying to access several netCDF files that are also zipped (via gzip I guess) (and stored in a directory that I only have reading permit) I tried to unzip them using gzfile, gzcon, etc, and then open them with open.ncdf (from ncdf package). Everything was unsuccesful. I had no

Re: [R] lazy evaluation question

2009-01-19 Thread Wacek Kusnierczyk
Peter Dalgaard wrote: snip Notice also that in lapply(1:4,function(i) F(i)) it would be pretty weird if lapply would behave differently depending on the name of formal arguments of the function, i.e. if lapply(1:4,function(meep) F(meep)) gave a different result. And f() depends on

[R] candisc

2009-01-19 Thread Pete Shepard
Hello, I have a question regarding the candisc package. My data are: speciesthreefive 12.956.63 12.537.79 13.575.65 13.165.47 22.584.46 22.166.22 23.273.52 I put these in a table and then a linear model newdata - lm(cbind(three,

[R] Error while adding legends to xyplot

2009-01-19 Thread V Prasanth
Dear All: Greetings! I am able to produce an xyplot in R; But I am not able to put multiple legends on it! So for that matter, I have saved the xyplot and reproduced the same using the simple plot option. Then using the legend option I successfully placed the require text and its

Re: [R] Perl-R bridge

2009-01-19 Thread Adam Witney
you could take a look at this: http://www.omegahat.org/RSPerl/ but I'm not sure how well maintained it is currently. adam On 19 Jan 2009, at 02:00, ANJAN PURKAYASTHA wrote: Hi, I'm planning to access R from my perl scripts. The only noteworthy bridge seems to be

[R] predict.tree

2009-01-19 Thread H.H.H.B.M.van_Haagen
Dear Brian, I looked on the internet for this warning message Warning message: 'newdata' had X rows but variable(s) found have Y rows that happens when using some kind of fitting and prediting. I still can't figure out what is going wrong by reading the documentation or the posts in de forum.

Re: [R] using R how to read a one column alone from a database table from MySQL

2009-01-19 Thread sankar82
hello dieter, sorry for the late reply... yes my homework needs to be done in R and thats y i have these questions posted in this forum...hope u reply me the solutions and also thank you for spending ur precious time in my problem... BR sankar. Dieter Menne wrote: sankar82

Re: [R] lattice question: independent per-row or per-column scaling?

2009-01-19 Thread René J.V. Bertin
Thanks for all the answers. I'll have a look at ggplot2. I'd seen the possibility to set panel-specific limits via ylim, but I was in fact looking for a switch to achieve non-global automatic scaling. Given the fact that there is no built in provision for that, I take it it's a functionality that

Re: [R] download/retain text file structure with RCurl/getURL()

2009-01-19 Thread David Winsemius
It's a fixed width format, with irregular entries, perhaps something along the lines of: read.fwf(textConnection(txtfile), skip = 8, # skips the header widths = column widths vector, colnames= colnames , nrows=48 )#drops the trailing summary text perhaps :

Re: [R] lattice question: independent per-row or per-column scaling?

2009-01-19 Thread René J.V. Bertin
Thanks for all the answers. I'll have a look at ggplot2. I'd seen the possibility to set panel-specific limits via ylim, but I was in fact looking for a switch to achieve non-global automatic scaling. Given the fact that there is no built in provision for that, I take it it's a functionality that

[R] Trend.spatial function in geoR

2009-01-19 Thread Julia L. Angstmann
I am having difficulty getting the trend.spatial function in geoR to work properly. After creating a trend.spatial object with a covariate, I try to add the command into my likfit() function as follows: trend1.trend.spatial - trend.spatial(1st, trend1.geodata) trend1.spatial.EC0.1.reml -

Re: [R] ifelse help?

2009-01-19 Thread rkevinburton
Sorry I didn't give the proper initialization of j. But you are right j should also be an array of 5. So x[j + 5] would return 5 values. So if the array returned from 'ifelse' is the same dimention as test (h), then are all the values of h being tested? So since h as you say has no dimensions

[R] plotting arrows with different colors and varying head size

2009-01-19 Thread Héctor Villalobos
Dear list, I would like to plot arrows with different colors according to arrow length, and also (if possible) with head size proportional to arrow length. The idea is to make a quiver-like plot of matlab with wind speed data. So far, I´ve been able to use different colors, but I need to find

Re: [R] reference category for factor in regression

2009-01-19 Thread Jos Elkink
Hi all, Thanks for the advice. See ?relevel for information on how to reorder the levels of a factor, while being able to specify the reference level. Basically, the first level of the factor is taken as the reference. Yes, that is how I always used it. But the problem is, in this particular

[R] Compare matrices

2009-01-19 Thread Andrej Kastrin
Dear all, Suppose that I have a matrix A A - matrix(c(3,3,3,3,3,3,3,3,3),3,3) and a logical matrix B B - matrix(c(T,T,T,F,T,T,F,T,F),3,3) The result matrix should be C - matrix(c(3,3,3,NA,3,3,NA,3,NA),3,3) Is there any simple tip or trick to perform this without looping? Thanks

Re: [R] Compare matrices

2009-01-19 Thread Dimitris Rizopoulos
try this: A - matrix(c(3,3,3,3,3,3,3,3,3),3,3) B - matrix(c(T,T,T,F,T,T,F,T,F),3,3) C - A C[!B] - NA C I hope it helps. Best, Dimitris Andrej Kastrin wrote: Dear all, Suppose that I have a matrix A A - matrix(c(3,3,3,3,3,3,3,3,3),3,3) and a logical matrix B B -

Re: [R] reference category for factor in regression

2009-01-19 Thread Stephan Kolassa
Hi Jos, does explicitly recoding AGE help? AGE - factor(c(65+,18-24,18-24,25-34)) str(AGE) AGE - factor(c(65+,18-24,18-24,25-34),levels=c(65+,18-24,25-34)) str(AGE) Best, Stephan Jos Elkink schrieb: Hi all, Thanks for the advice. See ?relevel for information on how to reorder the

Re: [R] Compare matrices

2009-01-19 Thread Rolf Turner
On 20/01/2009, at 9:48 AM, Andrej Kastrin wrote: Dear all, Suppose that I have a matrix A A - matrix(c(3,3,3,3,3,3,3,3,3),3,3) and a logical matrix B B - matrix(c(T,T,T,F,T,T,F,T,F),3,3) The result matrix should be C - matrix(c(3,3,3,NA,3,3,NA,3,NA),3,3) Is there any simple

Re: [R] Compare matrices

2009-01-19 Thread Steven McKinney
Use the is.na() function to assign NA values: is.na(A) - !B A [,1] [,2] [,3] [1,]3 NA NA [2,]333 [3,]33 NA C - matrix(c(3,3,3,NA,3,3,NA,3,NA),3,3) all.equal(A, C) [1] TRUE Steven McKinney Statistician Molecular Oncology and Breast Cancer Program

Re: [R] Compare matrices

2009-01-19 Thread David Winsemius
On Jan 19, 2009, at 3:54 PM, Dimitris Rizopoulos wrote: try this: A - matrix(c(3,3,3,3,3,3,3,3,3),3,3) B - matrix(c(T,T,T,F,T,T,F,T,F),3,3) C - A C[!B] - NA C Very elegant. Another, perhaps less elegant, effort: B[which(B == FALSE)] - NA B [,1] [,2] [,3] [1,] TRUE NA NA [2,]

Re: [R] Fitting of lognormal distribution to lower tail experimental data

2009-01-19 Thread Mattias Brännström
Thank you very much, Göran! I had to install R 2.8.1 since it did not work with 2.4.1. This is exactly what I wanted, now I can move on with my analysis! (And learn more about cencoring...) Best regards, Mattias __ R-help@r-project.org mailing list

[R] maptools, sunriset, POSIX timezones

2009-01-19 Thread Phil Taylor
Hi ... I wonder if anyone can provide some insight into why the first three examples using the sunriset function (appended below, with results) give the correct answer, but the fourth generates and error. The first two use ISOdatetime with and without a time zone attribute, and the sunriset

Re: [R] Compare matrices

2009-01-19 Thread Rolf Turner
On 20/01/2009, at 10:05 AM, David Winsemius (who should know better) wrote: snip B[which(B == FALSE)] - NA snip This sort of syntax drives me, and all right-thinking people, subclinically neurotic (or as a psychiatrist would say, stark staring bonkers). Admittedly

Re: [R] plotting arrows with different colors and varying head size

2009-01-19 Thread Greg Snow
Look at the my.symbols function in the TeachingDemos package (along with the ms.arrows function in the same package), that may do what you want. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original

Re: [R] XYplot in Lattice Package

2009-01-19 Thread jimdare
Thanks for your help David. I managed to track down this solution in regard to the second question: http://www.nabble.com/lattice-xyplot-with-bty%3D%22l%22-tt12486052.html#a12489170 Regards, James David Winsemius wrote: On Jan 15, 2009, at 9:27 PM, jimdare wrote: Dear R-Users

Re: [R] Concave Hull

2009-01-19 Thread Greg Snow
I don't know if it is the same algorithm or not, but there is the function chull that finds the convex hull. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From:

Re: [R] Bar Plot ggplot2 Filling bars with cross hatching

2009-01-19 Thread Greg Snow
I think the fact that the grid package does not support cross-hatching is a feature not a bug (or deficiency), and I hope that this is not fixed. Tufte's book (The Visual Display of Quantitative Information) has a section on why cross-hatching should be avoided (unless of course your goal is

Re: [R] MH algorithm syntax help

2009-01-19 Thread ekwaters
Well spotted, the b is a muck up (what happens when you are basing stuff on someone else's code). The bit you though might be a dimension mismatch seems to work ok, but the bit that I was worried about from the start doesn't; the reason I have sqrt of var y/ var x is because my posterior is for a

Re: [R] bootstrapped eigenvector method following prcomp

2009-01-19 Thread Axel Strauß
@ Stas Thanks for the extensive answer! I squeezed my data in your function but still need to mull over it and your comments for some time. спасибо, Axel Stas Kolenikov schrieb: I don't know if there are bugs in the code, but the step 4) does not compute significance... at least the way

[R] Month tick marks on a plot()

2009-01-19 Thread glenn
Hi All, I have a small dataframe [dates, values) I am plotting with plot(df,type=²l²) And the date date covers a year. The graph only have marks at Œ2008¹ and Œ2009¹. How do I get the months labeled at the bottom please Thanks as always Glenn [[alternative HTML version deleted]]

Re: [R] Month tick marks on a plot()

2009-01-19 Thread jim holtman
?axis On Mon, Jan 19, 2009 at 6:39 PM, glenn g1enn.robe...@btinternet.com wrote: Hi All, I have a small dataframe [dates, values) I am plotting with plot(df,type=²l²) And the date date covers a year. The graph only have marks at Œ2008¹ and Œ2009¹. How do I get the months labeled at the

[R] easiest way to integrate own functions on startup

2009-01-19 Thread Jörg Groß
Hi, I am currently writing some own functions that I frequently need. So, it would be perfect if I could load these functions at the beginning of each R-session with a small command. I tried to generate a R-package and install it that way. But it seems that it is not so easy to add new

Re: [R] easiest way to integrate own functions on startup

2009-01-19 Thread Duncan Murdoch
On 19/01/2009 7:13 PM, Jörg Groß wrote: Hi, I am currently writing some own functions that I frequently need. So, it would be perfect if I could load these functions at the beginning of each R-session with a small command. I tried to generate a R-package and install it that way. But it

Re: [R] Bar Plot ggplot2 Filling bars with cross hatching

2009-01-19 Thread stephen sefick
what is your suggestion for distinguishing between many bars without color? I have grown up in the time of standarized tests - good or bad I never felt nauseous. Stephen On Mon, Jan 19, 2009 at 5:20 PM, Greg Snow greg.s...@imail.org wrote: I think the fact that the grid package does not

Re: [R] Bar Plot ggplot2 Filling bars with cross hatching

2009-01-19 Thread Duncan Murdoch
On 19/01/2009 7:36 PM, stephen sefick wrote: what is your suggestion for distinguishing between many bars without color? I have grown up in the time of standarized tests - good or bad I never felt nauseous. Use gray levels or labels. If many is bigger than 5, it's not going to be easy,

Re: [R] Bar Plot ggplot2 Filling bars with cross hatching

2009-01-19 Thread Rolf Turner
On 20/01/2009, at 1:36 PM, stephen sefick wrote: what is your suggestion for distinguishing between many bars without color? Exactly. Sometimes colour printing can be expensive. I have grown up in the time of standarized tests - good or bad I never felt nauseous. Ni moi

Re: [R] Bar Plot ggplot2 Filling bars with cross hatching

2009-01-19 Thread Gabor Grothendieck
If classic graphics is ok try this which uses hatches and different shades of grey: barplot(lizards, names.arg = color, col = grey(c(.2, .5, 1)), density = 20, angle = c(45, -45, 0), legend = color) On Wed, Jan 14, 2009 at 10:18 PM, stephen sefick ssef...@gmail.com wrote: #I am putting a

Re: [R] Bar Plot ggplot2 Filling bars with cross hatching

2009-01-19 Thread Rolf Turner
On 20/01/2009, at 1:46 PM, Duncan Murdoch wrote: On 19/01/2009 7:36 PM, stephen sefick wrote: what is your suggestion for distinguishing between many bars without color? I have grown up in the time of standarized tests - good or bad I never felt nauseous. Use gray levels or labels. If

Re: [R] easiest way to integrate own functions on startup

2009-01-19 Thread Jörg Groß
Is there a way to execute this command on every R-start? I tried to add something in the Startup.h file - but that didn't work. (working on a mac) Thanks! Am 20.01.2009 um 01:25 schrieb Duncan Murdoch: On 19/01/2009 7:13 PM, Jörg Groß wrote: Hi, I am currently writing some own

Re: [R] easiest way to integrate own functions on startup

2009-01-19 Thread stephen sefick
?.Rprofile On Mon, Jan 19, 2009 at 8:03 PM, Jörg Groß jo...@licht-malerei.de wrote: Is there a way to execute this command on every R-start? I tried to add something in the Startup.h file - but that didn't work. (working on a mac) Thanks! Am 20.01.2009 um 01:25 schrieb Duncan

Re: [R] Month tick marks on a plot()

2009-01-19 Thread Gabor Grothendieck
The zoo faq has an example: library(zoo) vignette(zoo-faq) # see question 8 On Mon, Jan 19, 2009 at 6:39 PM, glenn g1enn.robe...@btinternet.com wrote: Hi All, I have a small dataframe [dates, values) I am plotting with plot(df,type=²l²) And the date date covers a year. The graph only have

Re: [R] easiest way to integrate own functions on startup

2009-01-19 Thread Jörg Groß
Hi, I tried to generate a .Rprofile file. But R does not load it automatically. Is there a tutorial on the web on generating such a file? (haven't found anything that helped me) And where do I have to put this .Rprofile-file? In the working directory? Does R generate a .Rprofile file when R

Re: [R] easiest way to integrate own functions on startup

2009-01-19 Thread Bernardo Rangel Tura
On Tue, 2009-01-20 at 01:13 +0100, Jörg Groß wrote: Hi, I am currently writing some own functions that I frequently need. So, it would be perfect if I could load these functions at the beginning of each R-session with a small command. I tried to generate a R-package and install it

Re: [R] easiest way to integrate own functions on startup

2009-01-19 Thread stephen sefick
If you get a program called smultron (or other program that can open hidden files), go to your working directory, and then open hidden file and find your .Rprofile file. I set mine up by searching through the archive and borrowing little bits of code for setting up a self-compiled version on os x

Re: [R] Bar Plot ggplot2 Filling bars with cross hatching

2009-01-19 Thread Don McKenzie
On 19-Jan-09, at 4:59 PM, Rolf Turner wrote: On 20/01/2009, at 1:46 PM, Duncan Murdoch wrote: On 19/01/2009 7:36 PM, stephen sefick wrote: what is your suggestion for distinguishing between many bars without color? I have grown up in the time of standarized tests - good or bad I never

[R] Gentleman and Ihaka's integrity in question

2009-01-19 Thread Robert Wilkins
It does look like Gentleman and Ihaka not only lied to the New York Times, but also to the New Zealand Herald and who knows who else. This is disgusting. The R programming language is the S programming language, and Gentleman and Ihaka are not the ones who designed it.

Re: [R] Gentleman and Ihaka's integrity in question

2009-01-19 Thread markleeds
Hi: I think I saw a link where the author clarified the original article and explained more clearly that the design of R had it roots in S/S+. I don't remember where I saw it but it's somewhere. Also, I think it's jumping the gun to claim that anyone lied to anyone before doing the research

Re: [R] Gentleman and Ihaka's integrity in question

2009-01-19 Thread Berwin A Turlach
Mark, don't feed the troll Cheers, Berwin On Mon, 19 Jan 2009 22:38:24 -0600 (CST) markle...@verizon.net wrote: Hi: I think I saw a link where the author clarified the original article and explained more clearly that the design of R had it roots in S/S+. I don't remember where I

  1   2   >