Re: [R] Questions on pareto

2009-09-16 Thread TsubasaZero
Hi, Thanks a lot. I think this is what I want. actuar package get more distributions. Zero~ David Winsemius wrote: On Sep 15, 2009, at 1:09 PM, TsubasaZero wrote: Hi all, I had generated 1000 random variates (u,v), and I would like to find the corresponding (x,y) for a

[R] Rounding to the nearest 5

2009-09-16 Thread Chris Li
Hi all, I want to round my values to the nearest 5. For example, if I have a value of 11, I want R to round it to 10. I have been searching for this command on the web and in the help file, but I couldn't find anything useful. Any help would be greatly appreciated. Many thanks, Chris --

[R] best method to format output of frequency table

2009-09-16 Thread esawdust
I have some security alert log data that I'm parsing and doing some stats on. One of the fields is the Classtype which is the enumerated value of the type of alert found. classtypes = factor( alerts$Classtype ) fclass_types = table( classtypes ) fclass_types gives me a frequency table of the

Re: [R] cluster-lite

2009-09-16 Thread Henrik Bengtsson
The R.batch package does most of this. It's been several years, but I used it run batch jobs on multiple (30-40) machines with different OS:es but sharing the same file system. No communication needed between hosts. It worked like a charm and I could process 3-4 CPU years in a few weeks for

[R] How to calculate min of a dataset that contains empty column

2009-09-16 Thread Chris Li
Hi all, I have got a dataset like the following: a b c 1 5 2 3 7 I am taking the minimum of each column and use it as the minimum of the y-axis of my graphs. My scripts (simplified version) are like the following: f-array f[1]=a f[2]=b f[3]=c for i in 1:3 name=f[i]

[R] VAR analysis

2009-09-16 Thread MD. ABDULLAH AL MAMUN Mamun
[[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal,

Re: [R] Rounding to the nearest 5

2009-09-16 Thread Bill.Venables
x5 - 5*round(x/5) From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of Chris Li [chri...@austwaterenv.com.au] Sent: 16 September 2009 09:15 To: r-help@r-project.org Subject: [R] Rounding to the nearest 5 Hi all, I want to

Re: [R] How to calculate min of a dataset that contains empty column

2009-09-16 Thread Tal Galili
Let's say your data.frame is called xx Then try: apply(xx,2, function(x) {min(na.omit(x))} ) Does it work ? On Wed, Sep 16, 2009 at 2:24 AM, Chris Li chri...@austwaterenv.com.auwrote: Hi all, I have got a dataset like the following: a b c 1 5 2 3 7 I am taking the

Re: [R] how to load only lines that start with a particular symbol

2009-09-16 Thread Patrick Connolly
On Tue, 15-Sep-2009 at 02:44PM -0700, William Dunlap wrote: | perl can do more complicated processing and filtering than grep. I once used perl to filter the useful 4 or 5 Mb out of a file that was over 250Mb. It took about 3 lines of perl code and about 40 seconds to run. Perl's not exactly

[R] Registration

2009-09-16 Thread ogbos okike
Hi, I have a question to post. But I have a problem finding the appropriate forum. Some of the FAQ on pastecs are answered by r-h...@stat.math.ethz.chmailing list. I searched to see if this mailing list requires registration or not. There was no information about that. I am a registered member of

[R] how can we check file empty or not

2009-09-16 Thread deepak m r
Hi All, I need to check whether the file is empty or not, Please help me in this regards. Best regards, Deepak.M.R __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] how can we check file empty or not

2009-09-16 Thread Paul Hiemstra
deepak m r wrote: Hi All, I need to check whether the file is empty or not, Please help me in this regards. Best regards, Deepak.M.R __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

[R] Example data for analysis of a highly pseudoreplicate mixed-effects experiment

2009-09-16 Thread Matthias Gralle
Hello everybody, it may be better to have sample data. I have provided data with less levels of gene and day and only ca. 400 data points per condition. Sample code: small=as.data.frame(read.csv(small.csv)) small$species=factor(small$species) small$gene=factor(small$gene)

[R] Error with JGR

2009-09-16 Thread srpd TCLTK
Hi, I'm trying to run the JGR package (in windows). I have followed all the steps in the web page http://www.rosuda.org/JGR but when run jgr.exe it returns the error message: Cannot find R.exe - please make sure R version 2.3.0 or higher is installed. I have in my computer R version 2.9.0

Re: [R] How to calculate min of a dataset that contains empty column

2009-09-16 Thread timholland
Presumably there is no reason to attempt plotting an empty column, so best approach is probably to remove the columns that contain no values. Try f.temp-f[,-which(apply(f,2,function(x)all(is.na(x] and then run your script for f.temp instead of the original f. Also, you may find you

[R] extracting one element from all list elements

2009-09-16 Thread Rainer M Krug
Hi I have a list which cosists out of dataframes of the same structure. Now I want to extract one column (let's say column A) from all dataframes and have them in a matrix (or dataframe). At the moment I am doiong: d - data.frame(A=runif(100), B=rnorm(100)) theList - list(e1=d, e2=d, e3=d,

Re: [R] extracting one element from all list elements

2009-09-16 Thread Henrique Dallazuanna
Try this: sapply(theList, '[[', 'A') On Wed, Sep 16, 2009 at 8:34 AM, Rainer M Krug r.m.k...@gmail.com wrote: Hi I have a list which cosists out of dataframes of the same structure. Now I want to extract one column (let's say column A) from all dataframes and have them in a matrix (or

Re: [R] comma as decimal separator in xtable

2009-09-16 Thread Jakson A. Aquino
On Wed, Sep 16, 2009 at 07:11:46AM +0200, Schalk Heunis wrote: This might be of help, first applies the formatting:print(xtable(prettyNum(d, decimal.mark=,))) Thanks! Your solution works for the example that I gave. However, I failed to provide an example that really represent my problem

Re: [R] error: could not find function sd

2009-09-16 Thread Ben Bolker
sselamat wrote: Hi, Everytime I try to get the standard deviation of a vector and enter command of sd(x), i get a reply Error: could not find function sd Can someone help me please? Thanks. Hmmm. Please provide more information, it's hard to imagine how this could happen.

Re: [R] comma as decimal separator in xtable

2009-09-16 Thread David Hajage
Perhaps with the dcolumn package ? http://newton.ex.ac.uk/research/qsystems/people/latham/LaTeX/dcolumn.pdf David 2009/9/16 Jakson A. Aquino jaksonaqu...@gmail.com On Wed, Sep 16, 2009 at 07:11:46AM +0200, Schalk Heunis wrote: This might be of help, first applies the

Re: [R] installation problem

2009-09-16 Thread Michael Bibo
cls59 chuck at sharpsteen.net writes: wesley mathew wrote: Hello All I have some problem for installing XML_2.6-0.tar . I am working in widows and R version is R-2.9.1 Unfortunately, I think there are some problems with CRAN being able to build the XML package for

Re: [R] comma as decimal separator in xtable

2009-09-16 Thread Henrique Dallazuanna
Try this also; format(coef(summary(lm.D9)), decimal.mark = ',') or using gsub: apply(coef(summary(lm.D9)), 2, gsub, pattern = \\., replacement = ,) using lm.D9 object from ?lm example. On Wed, Sep 16, 2009 at 8:50 AM, Jakson A. Aquino jaksonaqu...@gmail.com wrote: On Wed, Sep 16, 2009 at

Re: [R] extracting one element from all list elements

2009-09-16 Thread Rainer M Krug
On Wed, Sep 16, 2009 at 1:35 PM, Henrique Dallazuanna www...@gmail.comwrote: Try this: sapply(theList, '[[', 'A') Thanks Henrique - that is much more elegant. Rainer On Wed, Sep 16, 2009 at 8:34 AM, Rainer M Krug r.m.k...@gmail.com wrote: Hi I have a list which cosists out of

Re: [R] best method to format output of frequency table

2009-09-16 Thread Henrique Dallazuanna
Try this: as.matrix(table(x)) On Tue, Sep 15, 2009 at 6:50 PM, esawdust lan...@360vl.com wrote: I have some security alert log data that I'm parsing and doing some stats on. One of the fields is the Classtype which is the enumerated value of the type of alert found. classtypes = factor(

[R] How can I replicate Excel's 'growth trend' series interpolation?

2009-09-16 Thread Jorgy Porgee
Good day all, I'm trying to replicate Excel's growth trend series interpolation, available by highlighting a number of cells and then under Edit--Fill--Series--Type=growth and select 'Trend'. For example, if my starting point is 1.4 and end point is 30 with the sequence length being 11, the

Re: [R] Error...

2009-09-16 Thread Douglas Bates
On Tue, Sep 15, 2009 at 9:05 AM, Inez Campbell i...@st-andrews.ac.uk wrote: Hi, I am trying to find in FAQ, in the manual, everywhere, the reason and most importantly, how to solve: Error: protect(): protection stack overflow It appeared after requesting a plot. That error message comes from

Re: [R] How can I replicate Excel's 'growth trend' series interpolation?

2009-09-16 Thread Richard M. Heiberger
exp(seq(log(1.4), log(30), length=11)) [1] 1.40 1.902074 2.584203 3.510961 4.770076 6.480741 8.804891 11.962537 16.252591 22.081162 [11] 30.00 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] How can I replicate Excel's 'growth trend' series interpolation?

2009-09-16 Thread Jorgy Porgee
Wow :). Thanks a ton. On Wed, Sep 16, 2009 at 2:31 PM, Richard M. Heiberger r...@temple.edu wrote: exp(seq(log(1.4), log(30), length=11))  [1]  1.40  1.902074  2.584203  3.510961  4.770076  6.480741 8.804891 11.962537 16.252591 22.081162 [11] 30.00

Re: [R] coefficients of aov results has less number of elements?

2009-09-16 Thread Douglas Bates
On Tue, Sep 15, 2009 at 10:34 AM, Peng Yu pengyu...@gmail.com wrote: Hi, I run the following commands. 'A' has 3 levels and 'B' has 4 levels. Should there be totally 3+4 = 7 coefficients (A1, A2, A3, B1, B2, B3, B4)? If you were to define a model matrix for those coefficients it would be

Re: [R] Questions on pareto

2009-09-16 Thread David Winsemius
The other package that I can think of that you might want to investigate if you are attempting to construct bivariate distributions is the copula package. -- David. On Sep 15, 2009, at 10:27 PM, TsubasaZero wrote: Hi, Thanks a lot. I think this is what I want. actuar package get more

Re: [R] error: could not find function sd

2009-09-16 Thread Uwe Ligges
Ben Bolker wrote: sselamat wrote: Hi, Everytime I try to get the standard deviation of a vector and enter command of sd(x), i get a reply Error: could not find function sd Can someone help me please? Thanks. Hmmm. Please provide more information, it's hard to imagine how this could

Re: [R] installation problem

2009-09-16 Thread Uwe Ligges
Michael Bibo wrote: cls59 chuck at sharpsteen.net writes: wesley mathew wrote: Hello All I have some problem for installing XML_2.6-0.tar . I am working in widows and R version is R-2.9.1 Unfortunately, I think there are some problems with CRAN being able to build the XML package for

Re: [R] comma as decimal separator in xtable

2009-09-16 Thread Jakson A. Aquino
On Wed, Sep 16, 2009 at 01:59:29PM +0200, David Hajage wrote: Perhaps with the dcolumn package ? http://newton.ex.ac.uk/research/qsystems/people/latham/LaTeX/dcolumn.pdf Thanks for the suggestion, but the problem isn't of alignment. When I have commas as decimal separators, the values are

Re: [R] Registration

2009-09-16 Thread Uwe Ligges
ogbos okike wrote: Hi, I have a question to post. But I have a problem finding the appropriate forum. Some of the FAQ on pastecs are answered by r-h...@stat.math.ethz.chmailing list. I searched to see if this mailing list requires registration or not. There was no information about that. I am

[R] cycles in a graphical model

2009-09-16 Thread shuva gupta
Hi, Is there is any R package or existing codes in R to detect cycles in a graphical model or DAG  (Directed Acyclic Graph) ? Thanks. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] comma as decimal separator in xtable

2009-09-16 Thread David Hajage
But, it seems that dcolumn can change the decimal separator too (see the table on the first page of the pdf document). For example: \documentclass{article} \usepackage{dcolumn} \newcolumntype{d}[1]{D{.}{,}{#1}} \begin{document} results=tex= x - matrix(rnorm(4), 2, 2) library(xtable)

[R] A matrix problem

2009-09-16 Thread Bogaso
Hi all, I have following ch. matrix : mat [,1][,2] [,3][,4] [1,] NA0.0671746073115122 1.15281464953731 0.822277316923348 [2,] 0.113184828073156 -0.0133150789005112 0.640912657072027 -0.0667317787225847

Re: [R] cycles in a graphical model

2009-09-16 Thread Chuck Cleland
On 9/16/2009 9:26 AM, shuva gupta wrote: Hi, Is there is any R package or existing codes in R to detect cycles in a graphical model or DAG (Directed Acyclic Graph) ? Thanks. You might try this to search R packages: library(sos) findFn('Directed Acyclic Graph') [[alternative HTML

[R] How to extract a specific substring from a string (regular expressions) ? See details inside

2009-09-16 Thread Giulio Di Giovanni
Hi all, I have thousands of strings like these ones: 1159_1; YP_177963; PPE FAMILY PROTEIN 1100_13; SECRETED L-ALANINE DEHYDROGENASE ALD CAA15575 1141_24; gi;2894249;emb;CAA17111.1; PROBABLE ISOCITRATE DEHYDROGENASE and various others.. I'm interested to extract the code for the

Re: [R] A matrix problem

2009-09-16 Thread David Winsemius
On Sep 16, 2009, at 9:40 AM, Bogaso wrote: Hi all, I have following ch. matrix : mat [,1][,2] [,3][,4] [1,] NA0.0671746073115122 1.15281464953731 0.822277316923348 [2,] 0.113184828073156 -0.0133150789005112

Re: [R] list of symbols to substitution

2009-09-16 Thread Michael Spiegel
Ah whoops (and thank you). I forgot to mention an additional constraint: I'm trying to use exactly one eval statement. Some background information on this constraint. Some of the expressions that are being evaluated may return an error. At the moment, I'm wrapping each of the individual

[R] a sequence that wraps around

2009-09-16 Thread Jack Tanner
I'd like to have something like seq() where I can pass in a length of the desired sequence and a right limit so that the sequence goes up to the limit and then starts again from 1. # works now seq(from=2, length.out=3) [1] 2 3 4 # what I want seq(from=2, length.out=3, rlimit=3) [1] 2 3 1 #

[R] Is there a way to round numbers up or down to the nearest natural looking number?

2009-09-16 Thread Jorgy Porgee
Hi all, Given the following series of numbers: t [1] 21.85000 30.90410 43.71000 61.82234 87.43999 123.67296 [7] 174.91997 247.40249 349.91996 494.91815 700.0 What's the simplest way of formatting them into the nearest natural looking (rounded to nearest multiple of 10) numbers? So:

Re: [R] A matrix problem

2009-09-16 Thread Ted Harding
On 16-Sep-09 13:40:03, Bogaso wrote: Hi all, I have following ch. matrix : mat [,1][,2] [,3][,4] [1,] NA0.0671746073115122 1.15281464953731 0.822277316923348 [2,] 0.113184828073156 -0.0133150789005112

Re: [R] How to extract a specific substring from a string (regular expressions) ? See details inside

2009-09-16 Thread Henrique Dallazuanna
Try this: library(gsubfn) strapply(x, [A-Z]{3}[0-9]+) On Wed, Sep 16, 2009 at 10:53 AM, Giulio Di Giovanni perimessagg...@hotmail.com wrote: Hi all, I have thousands of strings like these ones: 1159_1; YP_177963; PPE FAMILY PROTEIN 1100_13; SECRETED L-ALANINE DEHYDROGENASE ALD

Re: [R] Is there a way to round numbers up or down to the nearest natural looking number?

2009-09-16 Thread Uwe Ligges
round(t, -1) Uwe Ligges Jorgy Porgee wrote: Hi all, Given the following series of numbers: t [1] 21.85000 30.90410 43.71000 61.82234 87.43999 123.67296 [7] 174.91997 247.40249 349.91996 494.91815 700.0 What's the simplest way of formatting them into the nearest natural looking

Re: [R] How to extract a specific substring from a string (regular expressions) ? See details inside

2009-09-16 Thread jim holtman
This should do it for you: pat - .*(\\b[A-Z]..[0-9]+).* grep(pat, x) [1] 1 3 5 sub(pat, '\\1', x) [1] YP_177963 CAA15575CAA17111 On Wed, Sep 16, 2009 at 9:53 AM, Giulio Di Giovanni perimessagg...@hotmail.com wrote: Hi all, I have thousands of strings like these

[R] Memory in R on windows running 64bit XP

2009-09-16 Thread michael watson (IAH-C)
Hi I'm running 32-bit R on Windows XP 64bit and the machine has 16Gb of RAM. The help for memory.limit states: If 32-bit R is run on some 64-bit versions of Windows the maximum value of obtainable memory is just under 4GB. So, using the help which states the size parameter can go up to 4095:

Re: [R] a sequence that wraps around

2009-09-16 Thread Henrique Dallazuanna
Try rep: rep(2:4, lenght.out = 3, times = 10) On Wed, Sep 16, 2009 at 11:08 AM, Jack Tanner i...@hotmail.com wrote: I'd like to have something like seq() where I can pass in a length of the desired sequence and a right limit so that the sequence goes up to the limit and then starts again

Re: [R] How to extract a specific substring from a string (regular expressions) ? See details inside

2009-09-16 Thread David Winsemius
I'm was guessing that the .1 was a part of the protein code for third example and looking at: http://www.plosone.org/article/fetchSingleRepresentation.action?uri=info:doi/10.1371/journal.pone.0003840.s002 I see quite a few protein codes of that form. I am a complete ignoramus with regex

Re: [R] Memory in R on windows running 64bit XP

2009-09-16 Thread Duncan Murdoch
On 9/16/2009 10:16 AM, michael watson (IAH-C) wrote: Hi I'm running 32-bit R on Windows XP 64bit and the machine has 16Gb of RAM. The help for memory.limit states: If 32-bit R is run on some 64-bit versions of Windows the maximum value of obtainable memory is just under 4GB. So, using the

Re: [R] How to extract a specific substring from a string (regular expressions) ? See details inside

2009-09-16 Thread Gabor Grothendieck
Assuming the rule is an upper case alphabetic character followed by two other characters followed by a string of digits then try this: library(gsubfn) strapply(x, [A-Z][^ ][^ ][0-9]+) [[1]] [1] YP_177963 [[2]] [1] CAA15575 [[3]] [1] CAA17111 If you prefer the output as one long vector of

Re: [R] How to extract a specific substring from a string (regular expressions) ? See details inside

2009-09-16 Thread David Winsemius
That did not work on all three: strapply(x, [A-Z]{3}[0-9]+) [[1]] NULL [[2]] [1] CAA15575 [[3]] [1] CAA17111 But adding a _ to the initiation pattern and a period to the termination pattern makes it complete: library(gsubfn) strapply(x, [A-Z_]{3}[0-9.]+) [[1]] [1] YP_177963 [[2]] [1]

Re: [R] wilcox.test p-value = 0

2009-09-16 Thread Bryan Keller
That's right, if the test is exact it is not possible to get a p-value of zero. wilcox.test does not provide an exact p-value in the presence of ties so if there are any ties in your data you are getting a normal approximation. Incidentally, if there are any ties in your data set I would

Re: [R] Memory in R on windows running 64bit XP

2009-09-16 Thread michael watson (IAH-C)
Hi Duncan Many thanks for the reply. Here are the results of the commands: Rprofmem() Error in Rprofmem() : memory profiling is not available on this system memory.size(NA) [1] 3500 memory.size() [1] 16.19 Clearly Rprofmem() is a dead end, though if there is some way of enabling it, I

[R] Can someone please explain why the last tick mark on this chart is not showing?

2009-09-16 Thread Jorgy Porgee
Hi all, I'm trying to log chart but with natural looking tick marks. My specifications are very specific -- it must indicate the lowest number's tick as well as the maximum. I've attached sample code and data for a particular case (and there are a few more like this) where the bottom tickmarks

Re: [R] Can someone please explain why the last tick mark on this chart is not showing?

2009-09-16 Thread David Winsemius
On Sep 16, 2009, at 11:13 AM, Jorgy Porgee wrote: Hi all, I'm trying to log chart but with natural looking tick marks. My specifications are very specific -- it must indicate the lowest number's tick as well as the maximum. I've attached sample code and data for a particular case (and there

Re: [R] Can someone please explain why the last tick mark on this chart is not showing?

2009-09-16 Thread Jorgy Porgee
Hi David, Sorry, forgot to define pxTarget. It can be anything you choose so say pxTarget-1. I've also renamed sample to sampleData. The following cut and paste should work: The last tick mark (5000) is not showing for some reason... :-/ Regards, George sampleData-c(NA, NA, NA, NA, NA,

Re: [R] Can someone please explain why the last tick mark on this chart is not showing?

2009-09-16 Thread David Winsemius
It shows if you lower your minimum a bit by applying a factor of 0.90 to your generation of dataMin. -- David. On Sep 16, 2009, at 11:27 AM, Jorgy Porgee wrote: Hi David, Sorry, forgot to define pxTarget. It can be anything you choose so say pxTarget-1. I've also renamed sample to

[R] lattice: How to display no box but only a y-axis on the left + Thicker lines

2009-09-16 Thread lith
Hi, I have two somewhat embarassing questions about the lattice-related plot functions: 1.) How do I make lattice (e.g. barchart) to not draw a box but only a y-axis on the left hand side so that the plot looks like barplot with default settings? So that the following two code snippets look more

Re: [R] best method to format output of frequency table

2009-09-16 Thread esawdust
Perfect, that works well. Thank you for the suggestion. Henrique Dallazuanna wrote: Try this: as.matrix(table(x)) -- View this message in context: http://www.nabble.com/best-method-to-format-output-of-frequency-table-tp25462448p25472239.html Sent from the R help mailing list

Re: [R] a sequence that wraps around

2009-09-16 Thread Jack Tanner
Henrique Dallazuanna wwwhsd at gmail.com writes: Try rep: rep(2:4, length.out = 3, times = 10) That's close, but it doesn't wrap to start at 1. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] a sequence that wraps around

2009-09-16 Thread Szabolcs Horvát
On 2009.09.16. 16:08, Jack Tanner wrote: I'd like to have something like seq() where I can pass in a length of the desired sequence and a right limit so that the sequence goes up to the limit and then starts again from 1. Disclaimer: total R beginner here (started to learn a 1 day ago), who

Re: [R] Memory in R on windows running 64bit XP

2009-09-16 Thread Duncan Murdoch
On 9/16/2009 10:54 AM, michael watson (IAH-C) wrote: Hi Duncan Many thanks for the reply. Here are the results of the commands: Rprofmem() Error in Rprofmem() : memory profiling is not available on this system memory.size(NA) [1] 3500 memory.size() [1] 16.19 Clearly Rprofmem() is a

Re: [R] a sequence that wraps around

2009-09-16 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jack Tanner Sent: Wednesday, September 16, 2009 7:08 AM To: r-h...@stat.math.ethz.ch Subject: [R] a sequence that wraps around I'd like to have something like seq() where I

Re: [R] Memory in R on windows running 64bit XP

2009-09-16 Thread michael watson (IAH-C)
Fair enough, thanks for your time. I will wait for my Linux PCs! -Original Message- From: Duncan Murdoch [mailto:murd...@stats.uwo.ca] Sent: 16 September 2009 16:42 To: michael watson (IAH-C) Cc: r-help@r-project.org Subject: Re: [R] Memory in R on windows running 64bit XP On 9/16/2009

Re: [R] a sequence that wraps around

2009-09-16 Thread Duncan Murdoch
On 9/16/2009 10:08 AM, Jack Tanner wrote: I'd like to have something like seq() where I can pass in a length of the desired sequence and a right limit so that the sequence goes up to the limit and then starts again from 1. # works now seq(from=2, length.out=3) [1] 2 3 4 # what I want

Re: [R] wilcox.test p-value = 0

2009-09-16 Thread Marc Schwartz
Once one gets past the issue of the p value being extremely small, irrespective of the test being used, the OP has asked the question of how to report it. Most communities will have standards for how to report p values, covering things like how many significant digits and a minimum p value

[R] expression

2009-09-16 Thread Marco Chiapello
/Dear all,/// /I am very thankful, if you could tell what is the right way to write: mtext(paste(expression(R^2),round(marco2[1,i],digits=3), N° of proteins:,marco3[i]),side=4,cex=.6) in this case the output is: R^2 I tried also in this way:

Re: [R] a sequence that wraps around

2009-09-16 Thread Jack Tanner
Szabolcs Horvát szhorvat at gmail.com writes: You could use the modulo operator. # additional examples of what I want seq(from=2, length.out=4, rlimit=3) [1] 2 3 1 2 seq(from=1, length.out=4) %% 3 + 1 Ah, that's so slick. You're off to a great start! Huge thanks to you and everyone

Re: [R] expression

2009-09-16 Thread baptiste auguie
Try this, marco2 = matrix(rnorm(4), nrow=2, ncol=2) marco3 = 2.12 i =1 plot.new() mtext(bquote(R^2*.(round(marco2[1,i],digits=3))* N° of proteins:*.(marco3[i])),side=4,cex=.6) HTH, baptiste 2009/9/16 Marco Chiapello marpe...@gmail.com /Dear all,/// /I am very thankful, if you could tell

Re: [R] How to extract partial predictions, package mgcv

2009-09-16 Thread Staffan Roos
Thanks Simon, I wasn't aware that predict.gam could be used in this situation. I followed you advice and managed to extract the data I needed. For people interested, I add the code with comments I used here: # # Full code for extracting partial

Re: [R] How to extract partial predictions, package mgcv

2009-09-16 Thread David Winsemius
It is nice to see worked examples, but there were some errors that relate to not including dataframe references. I've paste in code that runs without error on my machine: On Sep 16, 2009, at 12:39 PM, Staffan Roos wrote: Thanks Simon, I wasn't aware that predict.gam could be used in this

Re: [R] How to extract partial predictions, package mgcv

2009-09-16 Thread David Winsemius
But removing the extraneous second to last line that says just: lines ... would leave the console looking less puzzling. -- David On Sep 16, 2009, at 1:02 PM, David Winsemius wrote: It is nice to see worked examples, but there were some errors that relate to not including dataframe

Re: [R] comma as decimal separator in xtable

2009-09-16 Thread Jakson A. Aquino
On Wed, Sep 16, 2009 at 09:14:39AM -0300, Henrique Dallazuanna wrote: Try this also; format(coef(summary(lm.D9)), decimal.mark = ',') or using gsub: apply(coef(summary(lm.D9)), 2, gsub, pattern = \\., replacement = ,) using lm.D9 object from ?lm example. Thanks for your suggestion!

[R] Fourier Transform fft help

2009-09-16 Thread delic
I wrote a script that I anticipating seeing a spike at 10Hz with the function 10* sin(2*pi*10*t). I can't figure out why my plots do not show spikes at the frequencies I expect. Am I doing something wrong or is my expectations wrong? require(stats) layout(matrix(c(1,2,3), 3, 1, byrow =

Re: [R] comma as decimal separator in xtable

2009-09-16 Thread Jakson A. Aquino
On Wed, Sep 16, 2009 at 03:29:44PM +0200, David Hajage wrote: But, it seems that dcolumn can change the decimal separator too (see the table on the first page of the pdf document). For example: \documentclass{article} \usepackage{dcolumn} \newcolumntype{d}[1]{D{.}{,}{#1}}

Re: [R] How to extract partial predictions, package mgcv

2009-09-16 Thread Staffan Roos
Hi David, Yes, the strange code lines was clearly a mistake from my side. Sorry. What dataframe references did you add in your code? /Staffan David Winsemius wrote: But removing the extraneous second to last line that says just: lines ... would leave the console looking less

Re: [R] Fourier Transform fft help

2009-09-16 Thread stephen sefick
why not try spectrum (power spectrum) spectrum(y, log=no) the major spike is at 0.1 and 1/0.1 = 10Hz On Wed, Sep 16, 2009 at 12:13 PM, delic kran...@optonline.net wrote: I wrote a script that I anticipating seeing a spike at  10Hz with the function 10* sin(2*pi*10*t). I can't figure out why

[R] Turnpoints

2009-09-16 Thread ogbos okike
Good evening to everybody. I have a data of four columns - three of the columns represent date while the fourth is counts. Setting 4000 as my minimum point/value, I wish to find out the number of counts that are less or equal to 4000 and the dates they occur. I have installed pastecs and have

Re: [R] How to extract partial predictions, package mgcv

2009-09-16 Thread David Winsemius
Your code minus the extraneous lines was: #plot the data plot(pp_s.x0.~x0,type=p,pch=2,cex=0.50) sequence=order(x0) lines(x0[sequence],pp_s.x0.[sequence]) rug(jitter(x0)) My edition was: plot(pp_s.x0.~x0,type=p,pch=2,cex=0.50, data=f) sequence=order(f$x0)

Re: [R] Fourier Transform fft help

2009-09-16 Thread delic
After extensive research I found some information hinting at my freq array being wrong. I thought that the data spanned -F/2 to F/2. It seems that I should only plot the first half of the fft vector? Can anyone confirm or shed some light on this? One other thing I thought the magnitude should be

[R] re-code missing value

2009-09-16 Thread Steve Hong
Dear all, I have partial data set with four colums. First column is site with three factors (i.e., A, B, and C). From second to fourth columns (v1 ~ v3) are my observations. In the observations of the data set, . indicates missing value. I replaced . with NA. To replace . with NA, I used two

Re: [R] How to extract partial predictions, package mgcv

2009-09-16 Thread Staffan Roos
Yes, you're correct David, I used attach(f) earlier. Thanks for clarifying! I should change my own code accordingly. /Staffan David Winsemius wrote: Your code minus the extraneous lines was: #plot the data plot(pp_s.x0.~x0,type=p,pch=2,cex=0.50) sequence=order(x0)

Re: [R] Turnpoints

2009-09-16 Thread Steve Lianoglou
Hi, On Sep 16, 2009, at 1:42 PM, ogbos okike wrote: Good evening to everybody. I have a data of four columns - three of the columns represent date while the fourth is counts. Setting 4000 as my minimum point/value, I wish to find out the number of counts that are less or equal to 4000 and

Re: [R] re-code missing value

2009-09-16 Thread Jorge Ivan Velez
Hi Steve, Here is a suggestion using your original df1: # Create a copy -- you can avoid this newdf1 - df1 # Process newdf1[,2:4] - apply(newdf1[,2:4], 2, function(x) as.numeric(x)) # Removing df1 rm(df1) # Result newdf1 # str() str(newdf1) # 'data.frame': 18 obs. of 4 variables: # $

[R] Getting best three dimentions of data after dimentionality reduction (using kpca)

2009-09-16 Thread Abbas R. Ali
Hi   I am using kernlab package and kpca function for dimensionality reduction of my data. Can any body tell me that how can I get best three dimensions from output of kpca function, which are principal component vector, eignvalues, rotated vector, and original matrix. I want to get back my

Re: [R] Example data for analysis of a highly pseudoreplicate mixed-effects experiment

2009-09-16 Thread Matthias Gralle
There were some wrong NA values in the provided data set, this is now corrected. The data can be read in as small=read.csv(small.csv,colClasses=c(character,rep(integer,2),rep(factor,5))) The high number of residual df can be seen using the nlme package (can it be seen in the lme4 package, too

Re: [R] comma as decimal separator in xtable

2009-09-16 Thread Henrique Dallazuanna
Try this: sapply(x, format, decimal.mark = ',') On Wed, Sep 16, 2009 at 2:06 PM, Jakson A. Aquino jaksonaqu...@gmail.com wrote: On Wed, Sep 16, 2009 at 09:14:39AM -0300, Henrique Dallazuanna wrote: Try this also; format(coef(summary(lm.D9)), decimal.mark = ',') or using gsub:  

Re: [R] Turnpoints

2009-09-16 Thread David Winsemius
On Sep 16, 2009, at 1:42 PM, ogbos okike wrote: Good evening to everybody. I have a data of four columns - three of the columns represent date while the fourth is counts. Setting 4000 as my minimum point/value, I wish to find out the number of counts that are less or equal to 4000 You

Re: [R] comma as decimal separator in xtable

2009-09-16 Thread Jakson A. Aquino
On Wed, Sep 16, 2009 at 03:16:12PM -0300, Henrique Dallazuanna wrote: Try this: sapply(x, format, decimal.mark = ',') Yes, this works as I need, regarding the replacement of dots with commas. Thanks! On Wed, Sep 16, 2009 at 2:06 PM, Jakson A. Aquino jaksonaqu...@gmail.com wrote: On

[R] T-test to check equality, unable to interpret the results.

2009-09-16 Thread Robert Hall
Hi, I have the precision values of a system on two different data sets. The snippets of these results are as shown: sample1: (total 194 samples) 0.600238 0.800119 0.600238 0.200030 0.600238 ... ... sample2: (total 188 samples) 0.8001 0.2000 0.8001 0.

Re: [R] T-test to check equality, unable to interpret the results.

2009-09-16 Thread Erik Iverson
Robert, We unfortunately do not have enough information to help you interpret the results, and this is not really an R question at all, but general statistical advice. You will probably have much better understanding and confidence in your results by consulting a local statistical consultant

Re: [R] T-test to check equality, unable to interpret the results.

2009-09-16 Thread Steve Lianoglou
Hi, I was just going to send this when I saw Erik's post. He's right -- we can't say anything about your data, but we can say something about using a t-test. I'm not a real statistician, so this answer isn't very rigorous, but might be helpful. On Sep 16, 2009, at 2:55 PM, Robert Hall

[R] apply function across two variables by mult factors

2009-09-16 Thread Jon Loehrke
Greetings, I am attempting to run a function, which produces a vector and requires two input variables, across two nested factor levels. I can do this using by(X, list(factor1, factor2), function), however I haven't found a simple way to extract the list output into an organized vector

Re: [R] apply function across two variables by mult factors

2009-09-16 Thread Erik Iverson
Hello, -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jon Loehrke Sent: Wednesday, September 16, 2009 2:23 PM To: r-help@r-project.org Subject: [R] apply function across two variables by mult factors Greetings, I am

Re: [R] apply function across two variables by mult factors

2009-09-16 Thread Erik Iverson
One correction below, ---snip--- # example data frame testDF-data.frame( x=rnorm(12), y=rnorm(12), f1=gl(3,4), f2=gl(2,2,12)) Try this using lapply, split, mapply? Maybe it is in a nicer output object for you? testFun2 - function(x, y) { X - abs(x);

Re: [R] apply function across two variables by mult factors

2009-09-16 Thread Jorge Ivan Velez
Hi Jon, Here is a suggestion: foo - function(x) as.numeric( paste( abs( round( x ) ), collapse = . ) ) testDF$value - apply( testDF[,1:2], 1, foo ) testDF HTH, Jorge On Wed, Sep 16, 2009 at 3:22 PM, Jon Loehrke jloeh...@umassd.edu wrote: Greetings, I am attempting to run a function, which

Re: [R] apply function across two variables by mult factors

2009-09-16 Thread Gabor Grothendieck
Try this: transform(testDF, value = as.numeric(paste(round(abs(x)), round(abs(y)), sep = .))) On Wed, Sep 16, 2009 at 3:22 PM, Jon Loehrke jloeh...@umassd.edu wrote: Greetings, I am attempting to run a function, which produces a vector and requires two input variables, across two nested

Re: [R] T-test to check equality, unable to interpret the results.

2009-09-16 Thread Bert Gunter
I am loathe to expound basic statistics here ... but, at the considerable risk of pedantry, I must note that Steve's reply below contains fundamental errors, which I feel should not be left on this list unremarked: t-tests do **not** test for differences in **sample** means; they test for

  1   2   >