Re: [R] Fast nested List-data.frame

2010-01-05 Thread Greg Hirson
Dieter, I'd approach this by first making a matrix, then converting to a data frame with appropriate types. I'm sure there is a way to do it with structure in one step. Operations on matrices are usually faster than on dataframes. len - 10 d - replicate(len, list(pH = 3, marker = TRUE,

Re: [R] Fast nested List-data.frame

2010-01-05 Thread Greg Hirson
The as.numeric(d.df$pH) should have been an as.numeric(as.character(d.df$pH)). Sorry for the confusion. Greg On 1/5/10 12:33 AM, Greg Hirson wrote: Dieter, I'd approach this by first making a matrix, then converting to a data frame with appropriate types. I'm sure there is a way to do it

[R] R-package related to the topic of INARMA models

2010-01-05 Thread Feng Li
Dear R, I am looking for R-package related to INARMA (Integer-valued ARMA). Can anyone give me some information? I did not get information from task view. Many thanks. Feng -- Feng Li Department of Statistics Stockholm University 106 91 Stockholm, Sweden http://feng.li/

Re: [R] Fast nested List-data.frame

2010-01-05 Thread Dieter Menne
Greg Hirson wrote: I'd approach this by first making a matrix, then converting to a data frame with appropriate types. Well, I knew that matrixes are faster for numerics, but I also knew that the required conversion to character would be a show-stopper. My second wisdom was bogus. Your

Re: [R] Fast nested List-data.frame

2010-01-05 Thread Dieter Menne
This is better by a factor of 4: len = 10 d = replicate(len, list(pH = 3,marker = TRUE,position = A),FALSE) system.time( { pHAll = data.frame( pH = unlist(lapply(d,[[,1)), pH = unlist(lapply(d,[[,2)), pH = unlist(lapply(d,[[,3))) } ) Dieter -- View this message in

Re: [R] R-package related to the topic of INARMA models

2010-01-05 Thread Prof Brian Ripley
On Tue, 5 Jan 2010, Feng Li wrote: Dear R, I am looking for R-package related to INARMA (Integer-valued ARMA). Can anyone give me some information? I did not get information from task view. That's a very specialized topic, and you have not said what you want to do with such processes. I

Re: [R] xyplot - help with multiple Y's vs. X of a member data in multiple panels

2010-01-05 Thread Santosh
Thanks for your email.. Yes, I am looking for lattice version of matplot... Attached are some codes for simplicity for rapid testing..Any suggestions would be highly appreciated... library(lattice) dat - data.frame(x = rep(1:10,2), y1 = rnorm(20),

Re: [R] Checking for normality and homogeneity of variance

2010-01-05 Thread Alain Zuur
Haiyang AI wrote: Dear all, I'm a beginner of R and I need to carry out some three-way mixed ANOVAs. Following examples at http://personality-project.org/r/r.anova.html, I managed to get the ANOVA part, but I don't know how can I check data normality and homogeneity of variance in R

Re: [R] Tranpose and Aggregate Data - now Reshape - cast

2010-01-05 Thread Noli Sicad
library(reshape) names(harvest.dat) = c(CROP_ID, CROPTYPE, PERIOD,CUT_AGE) harvest -cast(harvest.dat, CROP_ID + CROPTYPE ~ PERIOD) It seems that I am getting the frequencies instead of the individual values. Output ~ CROP_ID CROPTYPE 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Re: [R] xyplot - help with multiple Y's vs. X of a member data in multiple panels

2010-01-05 Thread Felix Andrews
You should reshape the data into a long format, and an easy way to do that is to use the 'reshape' package: library(reshape) mdat - melt(dat, measure.vars = c(y1, y2, y3)) I'm still not sure what you want in the plot. Confusingly, your last example dropped the ID you referred to earlier, and

Re: [R] importing data from BUGS format to R?

2010-01-05 Thread Pseudomonas
Martyn Plummer-2 wrote: I wrote a function called bugs2jags, which you will find in the coda package, for converting WinBUGS data files into the data format used by JAGS which is, by no coincidence, the format used by the R function dump(). First of all excuse me for reviving this very

Re: [R] by function ??

2010-01-05 Thread Matthew Dowle
I wrote : (some may return vectors, others may return vectors) Its been pointed out there was a typo, and wasn't very clear anyway. It should read '(some may return vectors, others may return scalars)'. I've been asked for further explanation so here goes ... The point I was trying to make is

[R] Data Frame Transpose

2010-01-05 Thread Noli Sicad
Hi, forests - read.csv(C:\\Down2\\R_forestmgt\\forest_cut-Age.csv) m - forests fn - function(x) { y - t(x[,2]) data.frame( Croptype=x[1,1], Period =x[1,2], name=colnames(x)[2], x01=y[,1])x01=y[,1], x02=y[,2], x03=y[,3] } ---Problem here m - do.call( rbind,

[R] Is the Intercept Term always in First Position?

2010-01-05 Thread Viechtbauer Wolfgang (STAT)
Dear All, I have a question about formulas and model.matrix(). If one specifies a model via a formula, the corresponding design matrix can be obtained with the model.matrix() function. For example: x1 - c(1,4,2,3,5) x2 - c(1,1,2,2,2) myformula - ~ x1 + factor(x2) model.matrix(myformula) My

[R] Interception point between two lines

2010-01-05 Thread FMH
Dear All, Let mod2 and mod3 are two regression equations representing two distinct lines and i'm keen to find the intreception point between these two lines and the following are part of the codes.     m1 - as.matrix(rbind(coef(mod2), coef(mod3))) a - cbind(c(1,1),

Re: [R] Interception point between two lines

2010-01-05 Thread Uwe Ligges
On 05.01.2010 14:37, FMH wrote: Dear All, Let mod2 and mod3 are two regression equations representing two distinct lines and i'm keen to find the intreception point between these two lines and the following are part of the codes. m1- as.matrix(rbind(coef(mod2), coef(mod3)))

[R] Align two protein sequences using BLAST

2010-01-05 Thread Alla Bulashevska
Dear R users, I would like to align two protein sequences using BLAST (bl2seq). The question is whether this programm have been implemented in R. Thank you for your help, Alla. __ R-help@r-project.org mailing list

Re: [R] R matching lat/lon pairs from two datasets?

2010-01-05 Thread Matthew Dowle
Or if there is a requirement for speed or shorter more convenient syntax then there is a data.table join. Basically setkey(data1,V1,V2) and setkey(data2,V1,V2), then data1[data2] does the merge very quickly. You probably then want to do something with the merged data set, which you just add

[R] Data replacement

2010-01-05 Thread Lisa
Dear all, I have a question and need your help. I have a dataset that looks like this: data idcode1code2 1 114 2 123 3 244 4 315 5 324 6 4

Re: [R] Is the Intercept Term always in First Position?

2010-01-05 Thread Prof Brian Ripley
On Tue, 5 Jan 2010, Viechtbauer Wolfgang (STAT) wrote: Dear All, I have a question about formulas and model.matrix(). If one specifies a model via a formula, the corresponding design matrix can be obtained with the model.matrix() function. For example: x1 - c(1,4,2,3,5) x2 - c(1,1,2,2,2)

[R] solving cubic/quartic equations non-iteratively

2010-01-05 Thread Mads Jeppe Tarp-Johansen
To R-helpers, R offers the polyroot function for solving mentioned equations iteratively. However, Dr Math and Mathworld (and other places) show in detail how to solve mentioned equations non-iteratively. Do implementations for R that are non-iterative and that solve mentioned equations

Re: [R] Align two protein sequences using BLAST

2010-01-05 Thread Tony Chiang
You should send this note to the biconductor mailing list rather than the R-help. As to your question, please look at the Biostrings bioconductor package. On Tue, Jan 5, 2010 at 6:09 AM, Alla Bulashevska alla.bullashev...@fdm.uni-freiburg.de wrote: Dear R users, I would like to align two

Re: [R] Align two protein sequences using BLAST

2010-01-05 Thread David Winsemius
On Jan 5, 2010, at 10:46 AM, Tony Chiang wrote: You should send this note to the biconductor mailing list rather than the R-help. As to your question, please look at the Biostrings bioconductor package. The BioC webpages give a link to the Gmane archive for searching. A search on blast

Re: [R] Data Frame Transpose

2010-01-05 Thread John Kane
Well, if nothing else, you have missing comma. :) x01=y[,1]), x01=y[,1], x02=y[,2], x03=y[,3] -- fn - function(x) {   y - t(x[,2])   data.frame( Croptype=x[1,1], Period =x[1,2], name=colnames(x)[2], x01=y[,1])x01=y[,1], x02=y[,2], x03=y[,3] } ---Problem here m -

Re: [R] solving cubic/quartic equations non-iteratively

2010-01-05 Thread Stavros Macrakis
There are certainly formulas for solving polynomials numerically up to 4th degree non-iteratively, but you will almost certainly get better results using iterative methods. Even the much more trivial formula for the 2nd degree (quadratic) is tricky to implement correctly and accurately, see: *

Re: [R] solving cubic/quartic equations non-iteratively

2010-01-05 Thread Peter Dalgaard
Mads Jeppe Tarp-Johansen wrote: To R-helpers, R offers the polyroot function for solving mentioned equations iteratively. However, Dr Math and Mathworld (and other places) show in detail how to solve mentioned equations non-iteratively. Do implementations for R that are non-iterative

Re: [R] Bar plots with stacked and grouped (juxtaposed) bars together

2010-01-05 Thread John Kane
I have the feeling that you can do this with ggplot2 but why? You are likely to be much better off using a dotchart. ?dotchart --- On Mon, 1/4/10, Elmer Wix elmer.cabekaziruronometu@gmail.com wrote: From: Elmer Wix elmer.cabekaziruronometu@gmail.com Subject: [R] Bar plots with

Re: [R] solving cubic/quartic equations non-iteratively

2010-01-05 Thread spencerg
standard square root computation requires an iteration. Spencer Peter Dalgaard wrote: Mads Jeppe Tarp-Johansen wrote: To R-helpers, R offers the polyroot function for solving mentioned equations iteratively. However, Dr Math and Mathworld (and other places) show in detail how to solve

[R] The output of script is hidden in console

2010-01-05 Thread vtvdung
Hi everyone, I execute a script with source(filename) The script has effect but i don't see the output on console screen.Why? I'm a newbie. Thanks :handshake: -- View this message in context: http://n4.nabble.com/The-output-of-script-is-hidden-in-console-tp999095p999095.html Sent from the R

[R] R session in Compstat' 2010

2010-01-05 Thread Francois Husson
Dear members of the R user community, I am pleased to inform you that the Compstat'2010 conference (19th conference on Computational statistics) will take place in Paris from the 22 to the 27th of august. An R session can be organized during this conference. People have to submit a full paper

Re: [R] The output of script is hidden in console

2010-01-05 Thread Tom Fletcher
There are probably numerous ways, but one is to add print() to the functions that you wish to display in the console. For example, in your source file, Instead of summary(x) try print(summary(x)) This should do the trick. Tom Fletcher -Original Message- From:

Re: [R] Data replacement

2010-01-05 Thread Dieter Menne
Lisa wrote: I have a dataset that looks like this: data idcode1code2 1 114 2 123 3 244 .. I want to change some numbers in the columns of “code1” and “code2” based on “indx” as below

Re: [R] Negative binomial

2010-01-05 Thread David Winsemius
On Jan 5, 2010, at 9:38 AM, Stefani Mallia wrote: Hi, I'm trying to fit a glm with a negative binomial error distribution and a log link, using the example found in the paper Stochastic Claims Reserving In General Insurance by England and Verrall. I am attaching a pdf since it is more

Re: [R] Negative binomial

2010-01-05 Thread David Winsemius
On Jan 5, 2010, at 12:20 PM, David Winsemius wrote: On Jan 5, 2010, at 9:38 AM, Stefani Mallia wrote: Hi, I'm trying to fit a glm with a negative binomial error distribution and a log link, using the example found in the paper Stochastic Claims Reserving In General Insurance by England

[R] mean for subset

2010-01-05 Thread Geoffrey Smith
Hello, does anyone know how to take the mean for a subset of observations? For example, suppose my data looks like this: OBS NAME SCORE 1 Tom 92 2 Tom 88 3 Tom 56 4 James85 5 James75 6 James32 7

Re: [R] mean for subset

2010-01-05 Thread Gabor Grothendieck
Have a look at this post and the rest of that thread: https://stat.ethz.ch/pipermail/r-help/2010-January/223420.html On Tue, Jan 5, 2010 at 1:29 PM, Geoffrey Smith g...@asu.edu wrote: Hello, does anyone know how to take the mean for a subset of observations? For example, suppose my data looks

Re: [R] mean for subset

2010-01-05 Thread Duncan Murdoch
On 05/01/2010 1:29 PM, Geoffrey Smith wrote: Hello, does anyone know how to take the mean for a subset of observations? For example, suppose my data looks like this: OBS NAME SCORE 1 Tom 92 2 Tom 88 3 Tom 56 4 James85 5

Re: [R] mean for subset

2010-01-05 Thread Achim Zeileis
On Tue, 5 Jan 2010, Geoffrey Smith wrote: Hello, does anyone know how to take the mean for a subset of observations? For example, suppose my data looks like this: OBS NAME SCORE 1 Tom 92 2 Tom 88 3 Tom 56 4 James85 5

[R] Weigths in lm and kruskal_test

2010-01-05 Thread Armin Goralczyk
Is it correct that the weights argument in lm and kruskal_test from package coin have different meanings? Example: library(coin) set.seed(29) x - gl(3, 10) y - rnorm(length(x), mean = c(0, 0, 1)[x]) d - data.frame(y = y, x = x) w - rep(2, nrow(d)) ### double each obs ### all the same

Re: [R] mean for subset

2010-01-05 Thread Gabor Grothendieck
Here is the solution using sqldf which can do it in one statement: # read in data Lines - OBS NAME SCORE + 1 Tom 92 + 2 Tom 88 + 3 Tom 56 + 4 James85 + 5 James75 + 6 James32 + 7 Dawn 56 + 8

Re: [R] mean for subset

2010-01-05 Thread Henrique Dallazuanna
Try this: with(split(DF, with(DF, ave(SCORE, NAME, FUN = length)))[['3']], tapply(SCORE, NAME[,drop = TRUE], FUN = mean)) Or: with(DF, tapply(SCORE, NAME, mean))[table(DF$NAME) == 3] On Tue, Jan 5, 2010 at 4:29 PM, Geoffrey Smith g...@asu.edu wrote: Hello, does anyone know how to take the

[R] variable three dimensional array

2010-01-05 Thread Fahim Md
I am using R for my bioinformatics research. I am dealing with a graph in which I need to find all possible path. I was looking for some package that solve my purpose but all in vain. There are available algorithms but most of them find shortest path that ignore other paths So I decided to write

[R] Usage of weights in kruskal_test from package coin

2010-01-05 Thread Armin Goralczyk
With this email I will be following up on this (some months old) post: http://tolstoy.newcastle.edu.au/R/e7/help/09/06/0799.html From this I would assume that the following is also valid: set.seed(29) x - gl(3, 10) y - rnorm(length(x), mean = c(0, 0, 1)[x]) d - data.frame(y = y, x = x) # w -

Re: [R] Unwanted association between a function and a namespace

2010-01-05 Thread Patrick Connolly
On Thu, 24-Dec-2009 at 02:14PM +1300, Patrick Connolly wrote: ly way I found to get round the problem was to make an | additional function Summarize in the same place. It involves editing | any old scripts/functions before they work, but work they do. In case anyone was following this thread, I

Re: [R] The output of script is hidden in console

2010-01-05 Thread Bert Gunter
R FAQ 7.16. R Newbies should read this first (+the FAQ for Windows, if appropriate) _before_ posting questions to the list. Bert Gunter Genentech Nonclinical Biostatistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Tom

[R] Naming functions for the purpose of profiling

2010-01-05 Thread Magnus Torfason
Hi all, I have some long-running code that I'm trying to profile. I am seeing a lot of time spent inside the Anonymous function. Of course, this can in fact be any of several functions, but I am unable to see how I could use the information from Rprof.out to discern which function is taking

Re: [R] Data replacement

2010-01-05 Thread Lisa
Thank you for your kind help. Your R script works well. Lisa Dieter Menne wrote: Lisa wrote: I have a dataset that looks like this: data idcode1code2 1 114 2 123 3 244 .. I want

[R] Multivariate Poisson GLM??

2010-01-05 Thread Corey Sparks
Dear R Users, I'm working on a problem where I have a multivariate response vector of counts and a continuous predictor. I've thought about doing this the same way you would do a Multvariate regression model with normally distributed data, but since these data are counts, they are probably better

[R] why is object.size is more for constant numeric vector?

2010-01-05 Thread Utkarsh Singhal
Hi All, I ran the following lines in R: print(object.size(a - rep(1,10^6)),units=Mb) print(object.size(a - rep(3.542,10^6)),units=Mb) print(object.size(b - rep(x,10^6)),units=Mb) print(object.size(b - rep(xyzxyz xyz,10^6)),units=Mb) print(object.size(b - 1:10^6),units=Mb) print(object.size(b -

Re: [R] why is object.size is more for constant numeric vector?

2010-01-05 Thread Gabor Grothendieck
Note this: class(rep(1, 3)) [1] numeric class(1:3) [1] integer On Tue, Jan 5, 2010 at 3:16 PM, Utkarsh Singhal utkarsh@gmail.com wrote: Hi All, I ran the following lines in R: print(object.size(a - rep(1,10^6)),units=Mb) print(object.size(a - rep(3.542,10^6)),units=Mb)

Re: [R] solving cubic/quartic equations non-iteratively

2010-01-05 Thread Carl Witthoft
quote: There are certainly formulas for solving polynomials numerically up to 4th degree non-iteratively, but you will almost certainly get better results using iterative methods. endquote I must be missing something here. Why not use the analytic formulas for polynomials below 5th degree?

[R] bootstrapping a matrix and calculating Pearson's correlation coefficient

2010-01-05 Thread Lee William
Hi All, I have got matrix 'data' of dimension 22000x600. I want to make 50 independent samples of dimension 22000x300 from the original matrix 'data'. And then want to calculate pearsons CC for each of the obtained 50 matrices. It seems it is possible to do this using 'boot' function from library

Re: [R] model simplification using Crawley as a guide

2010-01-05 Thread hpdutra
So here is some information that I hope gets criticized by the higher-intelligences that posted on this topic. Beware that I'm not a statistician and I'm just saying about what I think is correct. First, before fitting any model, check the distribution of your data, in some cases a simple anova

[R] zero-fill absent data

2010-01-05 Thread Dan Kortschak
Hello, I have a set of data frames, generated by an SQL query that I am working with. Because of the way the query was written, zero values for the dependent variable (V2 in the example) are not recorded. Up until now this has not been a problem. I would like to be able to fill all absent data

Re: [R] xyplot - help with multiple Y's vs. X of a member data in multiple panels

2010-01-05 Thread Santosh
Hi.. thanks for the tips.. that variation works. How can I control pch, lty and col for each member (gp1) in the group (paste(gp2, gp3))? Regards,Santosh On Tue, Jan 5, 2010 at 2:15 AM, Felix Andrews fe...@nfrac.org wrote: You should reshape the data into a long format, and an easy way to do

Re: [R] bootstrapping a matrix and calculating Pearson's correlation coefficient

2010-01-05 Thread Liviu Andronic
Hello On 1/5/10, Lee William leeon...@gmail.com wrote: I have got matrix 'data' of dimension 22000x600. I want to make 50 independent samples of dimension 22000x300 from the original matrix 'data'. And then want to calculate pearsons CC for each of the obtained 50 matrices. It seems it is

Re: [R] zero-fill absent data

2010-01-05 Thread Peter Alspach
Tena koe Dan On approach - create a fullFrame with all your observations and merge with the frame: frame - as.data.frame(cbind(c(1:2,5:7,10),c(0.5,0.2,1,1.6,2,0))) fullFrame - as.data.frame(min(frame[,1]):max(frame[,1])) # Create fullFrame fullFrame min(frame[, 1]):max(frame[, 1]) 1

Re: [R] zero-fill absent data

2010-01-05 Thread Gabor Grothendieck
The zoo package's merge.zoo routines has a fill=0 argument so: create an expanded index, ix, and then in the next line create zoo objects from the data and the expanded index and merge them together. Finally in the last line convert back to a data frame. library(zoo) ix - with(frame,

[R] prefixing values in a table

2010-01-05 Thread laura . hug
Hi, I have generated a table of counts, and now need to add a prefix to the counts. #count KO occurrences KO_occur = table(groupKOIDs) #where groupKOIDs is a vector of characters e.g., if groupKOIDs = c(A, A, B, A) then KO_occur would look like this: A B 3 1 and I need to add a W to

Re: [R] xyplot: problems with column names legend

2010-01-05 Thread Jay
Anybody? Frustrating to be unable to solve this silly little problem... On Jan 3, 12:48 pm, Jay josip.2...@gmail.com wrote: Thanks, the backtickes got the code working. However, now I cant get it to draw the legend/key. For example, look at this

Re: [R] Multivariate Poisson GLM??

2010-01-05 Thread Kjetil Halvorsen
You could have a look at the VGAM (vector glm /gam models) at CRAN. Kjetil On Tue, Jan 5, 2010 at 5:59 PM, Corey Sparks corey.spa...@utsa.edu wrote: Dear R Users, I'm working on a problem where I have a multivariate response vector of counts and a continuous predictor.  I've thought about

[R] Anybody can suggest a better method to build a package while ignoring some functions

2010-01-05 Thread rusers.sh
Hi, Say i have three functions in a new package, a,b and c. I only want the one function a to be exported for use. b and c are not very stable. If i specify to export all the three functions in the NAMESPACE file (export(a,b,c)), no errors appeared after checking the package. And i am sure

[R] chi-squared test

2010-01-05 Thread Xanthe Walker
I would like to do a chi-squared test on the following matrix: CP-matrix(c(26,17,9,27,8,9,9,8,29,9,6,17,81,7,43,36,2,4,3,0,5,1,0,12,29,9,12,19,0,0),nrow=3) dimnames(CP) - list(c(less10,bt10and50,more50),c(T10,T9,T8,T7,T6,T5,T4,T3,T2,T1)) I want to set the expected values as 26, 17, 9 (ie. the

Re: [R] The output of script is hidden in console

2010-01-05 Thread Noli Sicad
If you are using windows, In windows console. Rgui.exe filename.R -The command does not work at all. You have open Rgui.exe first, retrieve filename.R then run the script. Noli On 1/5/10, vtvdung vtvdung.in...@yahoo.com wrote: Hi everyone, I execute a script with

Re: [R] Data Frame Transpose

2010-01-05 Thread Noli Sicad
Hi John Thanks for your reply. I think I was posting properly the problem. Here are the error, R script and console errors below. Thanks. Noli ~~~ The error: ~~ Error in data.frame(CROP_ID = x[1, 1], CROPTYPE = x[1, 2], name = colnames(x)[4:5], : subscript out of bounds ~~~

Re: [R] svm

2010-01-05 Thread Steve Lianoglou
Hi, On Tue, Jan 5, 2010 at 7:01 PM, Amy Hessen amy_4_5...@hotmail.com wrote: Hi, I understand from help pages that in order to use a data set with svm, I have to divide it into two files: one for the dataset without the class label and the other file contains the class label as the

Re: [R] xyplot: problems with column names legend

2010-01-05 Thread Felix Andrews
You have not said what the problem is, i.e. what you have tried and what you expect. Please post a small, reproducible example if you want help. Regards -Felix 2010/1/6 Jay josip.2...@gmail.com: Anybody? Frustrating to be unable to solve this silly little problem... On Jan 3, 12:48 pm, Jay

Re: [R] prefixing values in a table

2010-01-05 Thread jim holtman
try this: x - c(A, A, B, A) x.t - table(x) x.t x A B 3 1 x.tw - paste(W, x.t, sep='') names(x.tw) - names(x.t) x.tw AB W3 W1 On Tue, Jan 5, 2010 at 6:38 PM, laura@utoronto.ca wrote: Hi, I have generated a table of counts, and now need to add a prefix to the counts.

Re: [R] chi-squared test

2010-01-05 Thread David Winsemius
On Jan 5, 2010, at 8:53 PM, Xanthe Walker wrote: I would like to do a chi-squared test on the following matrix: CP- matrix (c (26,17,9,27,8,9,9,8,29,9,6,17,81,7,43,36,2,4,3,0,5,1,0,12,29,9,12,19,0,0 ),nrow=3) dimnames(CP) - list (c (less10 ,bt10and50

[R] xyplot: adjusting the scale (min, max tick)

2010-01-05 Thread Jay
Hi, I'm terribly sorry but it seems it cannot figure this one out by myself so, please, if somebody could help I would be very grateful. So, when I plot with xyplot() I get an y-axis that is very ugly... starting from a random number and having so many ticks that it becomes unreadable. How do I

[R] debugging package

2010-01-05 Thread Markus Weisner
I am trying to debug a package to submit it to CRAN and am getting a bunch of error messages. Most of the errors are because of the Rd files which were automatically populated by the package.skeleton function. I find the section on documentation to be pretty confusion in the R Extensions manual.

Re: [R] xyplot: problems with column names legend

2010-01-05 Thread Peter Ehlers
Jay, I don't recall the details of your original post so the following may be entirely off the mark; nevertheless, here goes: thetext - paste('Data', 1:8) # or: thetext - paste('Data', c('one', 'two', 'three', etc)) xyplot(decrease ~ treatment, OrchardSprays, groups = rowpos, type = a,

[R] removing the rows with negative elements

2010-01-05 Thread faridamsb
Hello All, I would like to remove the entire row, if there is any negative element in that row. What is the best way to do that? For example, x-matrix(c(2,-1,-2,3,5,6,-3,7,4,2,1,0), 4, 3) the returning matrix should look like [,1] [,2] [,3] [1,] 2 5 4 [2,] 3 7 0 Thank you in advance, FM

Re: [R] xyplot: adjusting the scale (min, max tick)

2010-01-05 Thread Peter Ehlers
Have a look at the 'scales' argument. For example: # default plot xyplot(Sepal.Length ~ Petal.Length | Species, data = iris) # modified plot xyplot(Sepal.Length ~ Petal.Length | Species, data = iris, scales=list(y=list(at=c(-5,0,5,10), limits=c(-5,10 -Peter Ehlers Jay wrote: Hi,

Re: [R] removing the rows with negative elements

2010-01-05 Thread Simon Blomberg
x[-which(x 0, arr.ind=TRUE)[,1],] but I'm sure someone will suggest an easier way. Simon. On Wed, 2010-01-06 at 05:13 +, farida...@gmail.com wrote: Hello All, I would like to remove the entire row, if there is any negative element in that row. What is the best way to do that?

Re: [R] removing the rows with negative elements

2010-01-05 Thread Peter Ehlers
x[apply(x,1,function(x)all(x=0)),] -Peter Ehlers Simon Blomberg wrote: x[-which(x 0, arr.ind=TRUE)[,1],] but I'm sure someone will suggest an easier way. Simon. On Wed, 2010-01-06 at 05:13 +, farida...@gmail.com wrote: Hello All, I would like to remove the entire row, if there is

Re: [R] removing the rows with negative elements

2010-01-05 Thread faridamsb
Thank you! On Jan 6, 2010 12:31am, Peter Ehlers ehl...@ucalgary.ca wrote: x[apply(x,1,function(x)all(x=0)),] -Peter Ehlers Simon Blomberg wrote: x[-which(x but I'm sure someone will suggest an easier way. Simon. On Wed, 2010-01-06 at 05:13 +, farida...@gmail.com wrote:

[R] seewave package:spectrogram resonance contour

2010-01-05 Thread rajesh j
Hi, I'd like to plot resonance contours on my spectrogram in the seewave package. Is this possible? -- Rajesh.J [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] why is object.size is more for constant numeric vector?

2010-01-05 Thread Prof Brian Ripley
On Wed, 6 Jan 2010, Utkarsh Singhal wrote: Hi All, I ran the following lines in R: print(object.size(a - rep(1,10^6)),units=Mb) print(object.size(a - rep(3.542,10^6)),units=Mb) print(object.size(b - rep(x,10^6)),units=Mb) print(object.size(b - rep(xyzxyz xyz,10^6)),units=Mb)

[R] MacOS X binary of package cairoDevice

2010-01-05 Thread wenjun zheng
Dear Michael and all R users, I find that there's no MacOS X binary of package cairoDevice on CRAN now. Can you or anybody else give me an older MacOS X edition for cairoDevice. Thank you. -- Wenjun [[alternative HTML version deleted]] __

Re: [R] removing the rows with negative elements

2010-01-05 Thread Dimitris Rizopoulos
try also this: x - matrix(c(2,-1,-2,3,5,6,-3,7,4,2,1,0), 4, 3) x[!rowSums(x 0), ] Best, Dimitris farida...@gmail.com wrote: Hello All, I would like to remove the entire row, if there is any negative element in that row. What is the best way to do that? For example,

Re: [R] removing the rows with negative elements

2010-01-05 Thread Petr PIKAL
Another option is x[rowSums(x0)==0, ] but beware of floating point if your numbers can be near zero. Regards Petr r-help-boun...@r-project.org napsal dne 06.01.2010 06:52:48: Thank you! On Jan 6, 2010 12:31am, Peter Ehlers ehl...@ucalgary.ca wrote: x[apply(x,1,function(x)all(x=0)),]