[R] Viewing function code

2009-08-10 Thread Werner W.
Hi, in the quest of learning from others' codes, I am still stumbling over the problem how to view some of the functions. I know about methods() getAnywhere(), showMethods(), getMethods() but I still cannot view every function. How would I look at the code of the merge function? Thanks a

Re: [R] Select subset with specific distribution parameters.

2009-08-10 Thread sedm1000
I'm sorry, an example needed a lot of data, hence I skipped it. I've settled for taking random sets from within a defined range to simulate the potential distributions and to calculate a rough significance value from that... Thanks for your help. -- View this message in context:

[R] plotrix: reverse axis in polar.plot

2009-08-10 Thread Thomas Steiner
Hi, how can I reverse the radius axis of plotrix's polar.plot function? Perhaps this sounds strange, but I use the radians for angles as well: In the center is zenith and the corresponding angle is 90°, not 0. See an example plot at http://www.mysundial.ca/tsp/images/sun_chart_50_solar_polar.jpg

Re: [R] Viewing function code

2009-08-10 Thread Dimitris Rizopoulos
well, you almost have it -- try this: # two methods for the merge generic methods(merge) merge.default merge.data.frame I hope it helps. Best, Dimitris Werner W. wrote: Hi, in the quest of learning from others' codes, I am still stumbling over the problem how to view some of the

Re: [R] Viewing function code

2009-08-10 Thread Werner W.
Brilliant, that works! Thanks a lot for the quick help, Werner Dimitris Rizopoulos-4 wrote: well, you almost have it -- try this: # two methods for the merge generic methods(merge) merge.default merge.data.frame I hope it helps. Best, Dimitris -- View this message

Re: [R] Help with R Function writing for Matrix

2009-08-10 Thread kaixin maleA
Dear all, I have a task to find the first all zero row of a matrix X ( nothing known about X). I need to write a function which returns either the row index of the first all-zero row, or NA if there are no all-zero rows. and I also need to locate all rows which are non-zero (should be a vector of

Re: [R] How '.' is used?

2009-08-10 Thread Michael Dewey
At 17:06 09/08/2009, Peng Yu wrote: Hi, I know '.' is not a separator in R as in C++. I am wondering where it discusses the detailed usage of '.' in R. Can somebody point me a webpage, a manual or a book that discuss this? It has a special meaning in a formula. ?formula tells you more

Re: [R] Help with R Function writing for Matrix

2009-08-10 Thread jim holtman
Try this: x - matrix(1:40,ncol=5) # function to find zero rows f.zero - + function(arr) + { + which(apply(arr, 1, function(z) all(z == 0)))[1] # first one + } # now the non-zero rows f.nonzero - + function(arr) + { + which(apply(arr, 1, function(z) any(z != 0))) + } f.zero(x) [1]

[R] R-squared of a distribution fitting

2009-08-10 Thread Duarte Viana
Hello, I am fitting a parameterized log-normal distribution to a sample distribution (pdf). I am using the function fitdistr in package MASS to calculate the distribution parameters according to the maximum likelihood procedure and test for the goodness of fit using a chi-squared test (as I have

Re: [R] xtable, sweave and resizebox

2009-08-10 Thread Ista Zahn
Hi again, one last annoying thing: how to deal with %, always when I use sweave to get a latex document the % comes as a comment and I cannot have % in my tables, how to sort out this annoying detail? thanks! Regards Welma Hi Welma, You need to escape the % sign, just as you would if you

[R] extraction of elements in a matrice???

2009-08-10 Thread Inchallah Yarab
i have a matrice M and i want to extract only rows where GWP_Max is positif and smaller than 1000 but it is given me this:!!!??? M    Policy.Number   GWP_Max 1    4001023   500 2    4001025   700 3    4001028   600 4    4001062    2335.1 5    611  2000 6   

[R] tolerance intervals

2009-08-10 Thread keith parker
Is anyone aware of R code for calculating sample size in the context of tolerance intervals? Thanks, Keith [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] extraction of elements in a matrice???

2009-08-10 Thread Gavin Simpson
On Mon, 2009-08-10 at 14:13 +, Inchallah Yarab wrote: i have a matrice M and i want to extract only rows where GWP_Max is positif and smaller than 1000 but it is given me this:!!!??? M Policy.Number GWP_Max 1 4001023 500 2 4001025 700 3 4001028 600 4 4001062 2335.1 5 611 2000 6

Re: [R] sweave and R. Searching for a document that will get mestarted

2009-08-10 Thread John Sorkin
Windows XP R 2.8.1 Last week I asked for help getting started with Sweave. It was suggested that I look into LaTeX. I am happy to do so, but as I do this, I need a source that will tell me how to set up and run Sweave. I don't expect to learn how to set up a LaTeX document from this source,

Re: [R] sweave and R. Searching for a document that will get mestarted

2009-08-10 Thread Sarah Goslee
Not to belabor the obvious, but if you do a Google search for Sweave example you will find all kinds of useful information, including this site: http://www.stat.umn.edu/~charlie/Sweave/ containing example Sweave files, including the self-documenting Intro file that seems to be exactly what you are

[R] Matrices

2009-08-10 Thread mmv.listservs
How do you access all the column attributes associated with a column reboot instance? The variables poisson2 ~ a matrix with 10,000 rows and 8 column attributes. Things I tried: This command only returns a vector for one of the column attributes x1_prob -

[R] Need Advice: Considering Converting a Package from S3 to S4

2009-08-10 Thread Bryan Hanson
Hello R Folks... Not a technical question, but I need some advice and perspective. I¹ve got a set of functions I¹m planning to put together into a package. The main hunk of data that gets used by different functions is currently an S3 list. I¹ve been reading about S4 objects, and I see the

[R] install package version compatible with on older version of R

2009-08-10 Thread Renaud Gaujoux
Hi, I'm trying to install Chipster (for microarray analysis: http://chipster.csc.fi/), which expressly relies on R 2.6.1 (for now). So I'd like to install automatically (i.e. using a 'install.packages' like function) the last version of a package compatible with the running R version. For

[R] (sans objet)

2009-08-10 Thread Inchallah Yarab
i have written this in R, data1 - read.csv2(c:/Total1.csv,sep=,) data2 - read.csv2(c:/GWPMax1.csv,sep=,) M - merge(data1, data2, by.x = Policy.Number, by.y = Policy.Number) nrow(data1) [1] 20 nrow(M) [1] 12 NbOfPolicyWithoutGWPMax - nrow(data1)-nrow(M) NbOfPolicyWithoutGWPMax [1] 8

[R] Again: Help with a loop (coefficients with lmList) (now with a good reproducible example)

2009-08-10 Thread Cecilia Carmo
Hi R-helpers: #I start with the reproducible example: firm-sort(rep(1:1000,10),decreasing=F) year-rep(1998:2007,1000) industry-rep(c(rep(1,10),rep(2,10),rep(3,10),rep(4,10),rep(5,10),rep(6,10),rep(7,10),rep(8,10),rep(9,10), rep(10,10)),1000) X1-rnorm(1) X2-rnorm(1,mean=0.5,sd=0.1)

Re: [R] Matrices

2009-08-10 Thread mmv.listservs
yy-poisson2[poisson2$Reboot.Id==Reboot 2,poisson2$Task.Status==F,,drop=FALSE] doesn't work either? Any other ideas? On Mon, Aug 10, 2009 at 11:01 AM, mmv.listservs mmv.listse...@gmail.comwrote: How do you access all the column attributes associated with a column reboot instance? The

[R] Validity check when setting slot

2009-08-10 Thread Renaud Gaujoux
Hi, I'm wondering if the following behaviour is normal: setClass('A', representation(number='numeric'), validity=function(object){ if( obj...@number -1 ) return(Invalid number); TRUE}) [1] A a - new('A') a An object of class “A” Slot number: numeric(0) a...@number - 0 a...@number - -3 a An

[R] Produce single line graph title composed of text and computed values.

2009-08-10 Thread John Sorkin
R 2.81 Windows XP I am trying to produce a title that combines: text, a computed value, text, a computed value The title contains everything I want, but each element of the title is on a separate line, i.e. my title is five lines long. Is there anyway I can force the entire title to be on

Re: [R] Produce single line graph title composed of text and computed values.

2009-08-10 Thread Sarah Goslee
You need to use paste() instead of c(). Sarah On Mon, Aug 10, 2009 at 11:35 AM, John Sorkinjsor...@grecc.umaryland.edu wrote: R 2.81 Windows XP I am trying to produce a title that combines: text, a computed value, text,  a computed value The title contains everything I want, but each

Re: [R] Produce single line graph title composed of text and computed values.

2009-08-10 Thread Erik Iverson
See the ?paste function, instead of the ?c function. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of John Sorkin Sent: Monday, August 10, 2009 10:36 AM To: r-help@r-project.org Subject: [R] Produce single line graph title

Re: [R] sweave and R. Searching for a document that will get mestarted

2009-08-10 Thread Gabor Grothendieck
1. Install R, Adobe Reader (or other pdf reader) and also install MiKTeX. Finally, download this example Sweave input file: http://www.stat.uni-muenchen.de/~leisch/Sweave/example-2.Snw and do this from the Windows cmd console: Rcmd Sweave example-2.Snw pdflatex example-2.tex

Re: [R] Need Advice: Considering Converting a Package from S3 to S4

2009-08-10 Thread Gabor Grothendieck
On Mon, Aug 10, 2009 at 11:03 AM, Bryan Hansonhan...@depauw.edu wrote: itself doesn't take advantage of much, except the ability to define subclasses at a later date (maybe that is sufficient reason though). S3 supports subclasses too. __

Re: [R] Validity check when setting slot

2009-08-10 Thread Martin Maechler
RG == Renaud Gaujoux ren...@mancala.cbio.uct.ac.za on Mon, 10 Aug 2009 17:19:12 +0200 (SAST) writes: RG Hi, RG I'm wondering if the following behaviour is normal: RG setClass('A', representation(number='numeric'), RG validity=function(object){ RG if( obj...@number -1

[R] Saving plots to file

2009-08-10 Thread Sean MacEachern
Appologies if this has been addressed before, but I can't seem to find it in the help archives. I'm looking to do something like the following but it looks like save.plot is deprecated. save.plot(plot(glm1$residuals,gain,main = Hist of residuals and gain),file=Desktop/hist1.png) Thanks in

Re: [R] Saving plots to file

2009-08-10 Thread Cedrick Johnson
Try this: png(file=Desktop/hist1.png) plot(glm1$residuals,gain,main = Hist of residuals and gain) dev.off() -c Sean MacEachern wrote: Appologies if this has been addressed before, but I can't seem to find it in the help archives. I'm looking to do something like the following but it looks

Re: [R] (sans objet)

2009-08-10 Thread Gavin Simpson
On Mon, 2009-08-10 at 15:09 +, Inchallah Yarab wrote: i have written this in R, data1 - read.csv2(c:/Total1.csv,sep=,) data2 - read.csv2(c:/GWPMax1.csv,sep=,) M - merge(data1, data2, by.x = Policy.Number, by.y = Policy.Number) nrow(data1) [1] 20 nrow(M) [1] 12

Re: [R] (sans objet)

2009-08-10 Thread Ben Bolker
something like table(cut(M$GWP_Max,breaks=c(0,1000,3000,1))) Inchallah Yarab wrote: i have written this in R, data1 - read.csv2(c:/Total1.csv,sep=,) data2 - read.csv2(c:/GWPMax1.csv,sep=,) M - merge(data1, data2, by.x = Policy.Number, by.y = Policy.Number) nrow(data1) [1] 20

[R] Re : extraction of elements in a matrice???

2009-08-10 Thread Inchallah Yarab
Thank you Peter it works!!! À : r-help@r-project.org Envoyé le : Lundi, 10 Août 2009, 16h13mn 02s Objet : [R] extraction of elements in a matrice??? i have a matrice M and i want to extract only rows where GWP_Max is positif and smaller than 1000 but it is

[R] RES: Saving plots to file

2009-08-10 Thread Rodrigo Aluizio
You can save plots as specified below. For details see ?png, ?postscrip, ?tiff, ?jpeg, ?bmp. postscript(file = ifelse(onefile, Rplots.ps, Rplot%03d.ps), onefile, family, title, fonts, encoding, bg, fg, width, height, horizontal, pointsize, paper, pagecentre,

Re: [R] Matrices

2009-08-10 Thread Gavin Simpson
On Mon, 2009-08-10 at 11:17 -0400, mmv.listservs wrote: yy-poisson2[poisson2$Reboot.Id==Reboot 2,poisson2$Task.Status==F,,drop=FALSE] The above doesn't make any sense and can't be working or doing what you think it is doing. Lets dissect this command: yy -

[R] strsplit a matrix

2009-08-10 Thread James Perkins
Dear all, I am trying to split a matrix into 2 as efficiently as possible. It is a character matrix: 1 2 3 1 2-271 2-367 1-79 2 2-282 2-378 1-90 3 2-281 2-377 1-89 I want to make 2 matrices from this, as succinctly and efficiently as possible. I've tried such things as

Re: [R] Saving plots to file

2009-08-10 Thread Sean MacEachern
Thank you Cedric. That was a nice straight forward example that works great. Cheers, Sean On 8/10/09 11:45 AM, Cedrick Johnson cedr...@cedrickjohnson.com wrote: Try this: png(file=Desktop/hist1.png) plot(glm1$residuals,gain,main = Hist of residuals and gain) dev.off() -c Sean

Re: [R] strsplit a matrix

2009-08-10 Thread Dimitris Rizopoulos
one way us the following: mat - rbind( c(2-271, 2-367, 1-79), c(2-282, 2-378, 1-90), c(2-281, 2-377, 1-89) ) sp - strsplit(c(mat), -) mat1 - sapply(sp, [, 1) mat2 - sapply(sp, [, 2) dim(mat1) - dim(mat2) - dim(mat) mat1 mat2 I hope it helps. Best, Dimitris James Perkins wrote:

Re: [R] Validity check when setting slot

2009-08-10 Thread Renaud Gaujoux
Hi Martin, Indeed the validObject works, but I was expecting it to be called automatically after a slot assignment. I understand the fact that during their construction, objects' slots are sometime not valid, and thought the check=FALSE was there for such cases. My validity method needs to

Re: [R] Saving plots to file

2009-08-10 Thread Gabor Grothendieck
On Windows versions of R there is savePlot. Don't know if that exists on Mac too. On Mon, Aug 10, 2009 at 12:25 PM, Sean MacEachernsean.mace...@gmail.com wrote: Appologies if this has been addressed before, but I can't seem to find it in the help archives. I'm looking to do something like the

Re: [R] Need Advice: Considering Converting a Package from S3 to S4

2009-08-10 Thread James W. MacDonald
Bryan Hanson wrote: Hello R Folks... Not a technical question, but I need some advice and perspective. I¹ve got a set of functions I¹m planning to put together into a package. The main hunk of data that gets used by different functions is currently an S3 list. I¹ve been reading about S4

Re: [R] RES: Saving plots to file

2009-08-10 Thread Ronggui Huang
Or you can plot first, when you are satisfied with it, copy the plot to another device. for example, X11() plot(rnorm(10)) dev.copy(png) ## copy the plot to an png file. Best 2009/8/11 Rodrigo Aluizio r.alui...@gmail.com: You can save plots as specified below. For details see ?png, ?postscrip,

Re: [R] strsplit a matrix

2009-08-10 Thread Henrique Dallazuanna
Try this: #1 gsub(.*-, , zzz) #2 gsub(-.*, , zzz) On Mon, Aug 10, 2009 at 1:56 PM, James Perkins jperk...@biochem.ucl.ac.ukwrote: Dear all, I am trying to split a matrix into 2 as efficiently as possible. It is a character matrix: 1 2 3 1 2-271 2-367 1-79 2 2-282

Re: [R] Matrices

2009-08-10 Thread mmv.listservs
Gavin and Stefan, Both the subset commands and the flag were exactly what I needed. On another note, I'm dealing with variables that are categorical and have long names like Task XYZ, Task ABC Task CCC When I try to plot against the probability it doesn't show me the Task name anymore. How can I

Re: [R] Simple Question: adding points to a boxplot

2009-08-10 Thread Farley, Robert
I think there's a miss-understanding of my datasets, and why I'm asking this question. I have one dataframe with ~18 observations (actual data) each of ~40 things. I independently made an estimate using a very complex model resulting in a value for each of those 40 things. I created a

Re: [R] Matrices

2009-08-10 Thread mmv.listservs
I should give an example for(p in 1:100) { str - paste(Task, p, sep= ) task_name[p] - str } ## first set the random seed so we get the same results set.seed(123) ## now produce some dummy data dummy - data.frame(A = sample(LETTERS[1:4], 100, replace = TRUE), B =

[R] ordinal response model with spatial autocorrelation

2009-08-10 Thread Thomas Mang
Hi, [note: 4th posting trial - apologize if the other ones would ever show up...] I have a (3-level) ordinal response data set which needs the integration of an spatial autocorrelation structure. What packages / functions are available to fit such a thing ? The heterogeneous,

[R] summary(table)

2009-08-10 Thread mmv.listservs
Hi, Why when I do a summary on a table it cuts off the other variables? It says Other :58 or Other: 120. how can I get the summary for all the variables under ServLoad.Task and Server.Load and Avg. CPU and Max.CPU? Thanks, summary(probF) Reboot.Id ServLoad.Task Server.Load

Re: [R] Matrices

2009-08-10 Thread Gavin Simpson
On Mon, 2009-08-10 at 13:33 -0400, mmv.listservs wrote: Gavin and Stefan, Both the subset commands and the flag were exactly what I needed. On another note, I'm dealing with variables that are categorical and have long names like Task XYZ, Task ABC Task CCC When I try to plot against the

[R] how use cat() function?

2009-08-10 Thread Inchallah Yarab
i  want to print in the console and to have an excel file like this no_GWP    NbOfPolicyClass1[0-1000] NbOfPolicyClass2[1000-3000]    NbOfPolicyClass3[ 3000] No_GWPMax=8NbpolicyClass1=5   NbpolicyClass2=4    NbpolicyClass3 =3  

Re: [R] Matrices

2009-08-10 Thread Gavin Simpson
On Mon, 2009-08-10 at 13:41 -0400, mmv.listservs wrote: I should give an example Thanks for that - I just two seconds ago sent a reply to the list complaining because you didn't provide one. However, the code below doesn't work. for(p in 1:100) { str - paste(Task, p, sep= )

Re: [R] summary(table)

2009-08-10 Thread Erik Iverson
We cannot reproduce your example since we don't have access to probF. It seems probF is not an object of class table, but perhaps of class data.frame. Also, summary is not cutting off the other variables, it is pooling levels of a factor into the Other category. All the levels belong to the

Re: [R] Matrices

2009-08-10 Thread mmv.listservs
Your example works because you have only 5 really long labels. I tried changing 5 to 474 because that is how many I have and the plot looks illegible. Should I increase the margin or the height of the plotting window? Thanks for your help again. ## dummy data set.seed(123) dummy - data.frame(A =

Re: [R] Matrices

2009-08-10 Thread Gavin Simpson
On Mon, 2009-08-10 at 14:02 -0400, mmv.listservs wrote: Your example works because you have only 5 really long labels. I tried changing 5 to 474 because that is how many I have and the plot looks illegible. Should I increase the margin or the height of the plotting window? Thanks for your help

[R] survival:: plotting survfit with two predictors

2009-08-10 Thread Marshall Knoderbane
Hi R-Helpers, I am having difficulty plotting a coxph model with two predictors. My predictors are morder (a factor with five levels where the mean of each level is plotted as a separate line) and tmean (continuous). When I run a model with just morder it is fine and the plot is fine.

Re: [R] how use cat() function?

2009-08-10 Thread John Kane
Output write.xls( x, file =my.file) --- On Mon, 8/10/09, Inchallah Yarab inchallahya...@yahoo.fr wrote: From: Inchallah Yarab inchallahya...@yahoo.fr Subject: [R] how use cat() function? To: r-help@r-project.org Received: Monday, August 10, 2009, 12:06 PM i  want to print in the console

Re: [R] how use cat() function?

2009-08-10 Thread Jean V Adams
I'm not exactly sure how you want the file to look, but try this code and see if it works for you. # since I don't have the data file, I'll just set the values here No_GWPMax - 8 NbpolicyClass1 - 5 NbpolicyClass2 - 4 NbpolicyClass3 - 3 # output1 is the first row of headers Output1 -

[R] logistic regression with repeated measures

2009-08-10 Thread Joel Bried
Hello , I am writing because I would need some advice on the following question. I am working on paternity in a monogamous bird species and I am performing analyses to check whether the probability for a male to be cuckolded (binary variable) depends on his body size, the body size of his

[R] obtain linear regression parameters from qplot

2009-08-10 Thread Jonghoon Choi
Hi, My question is how to get linear regression parameters (e.g. slope, y-intercept, etc.) from the fittings in qplot. My code looks like this, Fig1 = qplot(data=subset(totalD, (Name==increase1), x=Time, y=Intensity, main=Total Data) Fig1 + stat_smooth(method=lm) I can get the linear regression

Re: [R] howto get the number of columns and column names of multiply data frames

2009-08-10 Thread Frank Schäffer
Thanks for your replies. Both, Don and Stevens solutions worked well. Best regards Frank __ 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

Re: [R] Saving plots to file

2009-08-10 Thread Zhiliang Ma
?postscript ?pdf On Mon, Aug 10, 2009 at 9:25 AM, Sean MacEachernsean.mace...@gmail.com wrote: Appologies if this has been addressed before, but I can't seem to find it in the help archives. I'm looking to do something like the following but it looks like save.plot is deprecated.

Re: [R] strsplit a matrix

2009-08-10 Thread Henrique Dallazuanna
Try this: #1 gsub(.*-, , zzz) #2 gsub(-.*, , zzz) #3) gsub(.*-(.*)-.*, \\1, zzz) On Mon, Aug 10, 2009 at 4:20 PM, Jun Shen jun.shen...@gmail.com wrote: Henrique, This is a very nice approach. I wonder what if I have data like 2-172-45 and want to break it down into three parts 2, 172 and

Re: [R] strsplit a matrix

2009-08-10 Thread Jun Shen
Henrique, This is a very nice approach. I wonder what if I have data like 2-172-45 and want to break it down into three parts 2, 172 and 45. How do we use your method to achieve it? Thanks. Jun On Mon, Aug 10, 2009 at 12:34 PM, Henrique Dallazuanna www...@gmail.comwrote: Try this: #1

[R] ggplot: colours to geom_segments

2009-08-10 Thread John Kane
Just as an exercise I am tying to add colours to a geom_segment command. I can get one colour but not a sequence of colours. Can anyone suggest how I can get the green lines in the plot below to be different colours? I thought I could use a palatte of colours but that did not seem to work.

[R] R to MATLAB translation

2009-08-10 Thread apjaworski
Hi, Is there any package out there that might help me with translating R code into MATLAB? Using RSiteSearch I found a bunch of MATLAB stuff but it all seems to go in the opposite direction, i.e., emulating MATLAB functions in R. Thanks in advance, Andy __

[R] question

2009-08-10 Thread Paulina Salazar
hi: I need to work with RMySQL I installs DBI and MySQL but R It gives the following message Error in utils::readRegistry(SOFTWARE\\MySQL AB, hive = HLM, maxdepth = 2) : Registry key 'S' not found Error : .onLoad failed in 'loadNamespace' for 'RMySQL' Error: package/namespace load failed for

[R] Help with the internal functions

2009-08-10 Thread Kaiyu Shen
Hi, folks: I have used R for some time and have not explore deep inside the codes of the packages. Today, I try to modify some code in a package of arrayQuality (I do not think it matters which package it is). There is a function called maQualityPlots and I use fix(maQualityPlots) that I can view

[R] manipulating text to generate different formulas to use in nls()

2009-08-10 Thread Héctor Villalobos
Hello, In doing a series of non-linear estimations of a function which is a sum of a varying number of sinusoids, I would like to autogenerate the arguments needed by nls() depending on that number. For example, when there are two sinusoids: nls( y ~ mu + A1 * cos(2*pi*f1*x - P1) + A2 *

[R] Sorting text docs based on document meta values in tm()

2009-08-10 Thread Kelvin Lam
Hi all, I wonder if there's any way to reshuffle the text collection by the document meta values. For instance, if I have 5 documents that correspond to the following meta data: MetaID Sex Age 0 M38 0 M46 0 F 24 0 F 49 0 F 33 Can I

[R] Bug in seq (or a feature) ?

2009-08-10 Thread Tal Galili
(I use R 2.9.1 with win XP) If I run this code: seq(-0.1,.9, by = .05)[seq(-0.1,.9, by = .05) = 0.5] I get this output: [1] -0.10 -0.05 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 Why is 0.50 not in the results ? (It seems that it gives a slightly bigger number then 0.5 but I don't

Re: [R] how use cat() function?

2009-08-10 Thread Don MacQueen
Here is are some examples that might help. a - 1 b - 2 c - 5 cat( a=,,a, b=,,b, c=,c, \n , sep='', file=output.csv) and don't append unless you are adding more lines to an existing file. Or perhaps you want cat(a,b,c\n,file=output.csv) cat( paste( a,b,c , collapse=,) ,/n ,

[R] matrix power

2009-08-10 Thread cindy Guo
Hi, All, If I have a symmetric matrix, how can I get the negative square root of the matrx, ie. X^(-1/2) ? Thanks, Cindy [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Bug in seq (or a feature) ?

2009-08-10 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Tal Galili Sent: Monday, August 10, 2009 2:14 PM To: r-help@r-project.org Subject: [R] Bug in seq (or a feature) ? (I use R 2.9.1 with win XP) If I run this code:

Re: [R] Help with the internal functions

2009-08-10 Thread Duncan Murdoch
Kaiyu Shen wrote: Hi, folks: I have used R for some time and have not explore deep inside the codes of the packages. Today, I try to modify some code in a package of arrayQuality (I do not think it matters which package it is). There is a function called maQualityPlots and I use

[R] building a package

2009-08-10 Thread Erin Hodgess
Dear R People: I'm trying to build a package and am stuck on the last part; I keep getting there is no library. Here are my statements: e...@erin-laptop:~/Desktop/R-2.9.1/bin$ R CMD check RcmdrPlugin.qual * checking for working pdflatex ... OK * using log directory

Re: [R] Bug in seq (or a feature) ?

2009-08-10 Thread Duncan Murdoch
Tal Galili wrote: (I use R 2.9.1 with win XP) If I run this code: seq(-0.1,.9, by = .05)[seq(-0.1,.9, by = .05) = 0.5] I get this output: [1] -0.10 -0.05 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 Why is 0.50 not in the results ? (It seems that it gives a slightly bigger number then 0.5

Re: [R] Bug in seq (or a feature) ?

2009-08-10 Thread Erik Iverson
General floating point arithmetic issue here: See FAQ 7.31 http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Tal Galili Sent:

[R] Speeding up a bootstrap routine

2009-08-10 Thread babelproofreader
I have written the R code below to perform White's Data Mining Reality Check (DMRC) but as it stands at the moment it is painfully slow. It is written as a function as I call it many times from a script file with different data input, and the output is sunk() to a text file. Could anyone suggest

[R] problem selecting rows meeting a criterion

2009-08-10 Thread Jim Bouldin
When I try to select only those rows from the following data frame, called data, in which X Y X Y V3 2 2 1 8.062258 3 3 1 2.236068 4 4 1 6.324555 5 5 1 5.00 6 1 2 8.062258 8 3 2 9.486833 9 4 2 2.236068 10 5 2 5.656854 11 1 3 2.236068 12 2 3 9.486833 14 4 3 8.062258 15 5 3

Re: [R] matrix power

2009-08-10 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of cindy Guo Sent: Monday, August 10, 2009 2:32 PM To: r-help@r-project.org Subject: [R] matrix power Hi, All, If I have a symmetric matrix, how can I get the negative square

Re: [R] matrix power

2009-08-10 Thread Ted Harding
On 10-Aug-09 21:31:30, cindy Guo wrote: Hi, All, If I have a symmetric matrix, how can I get the negative square root of the matrx, ie. X^(-1/2) ? Thanks, Cindy X - matrix(c(2,1,1,2),nrow=2) X # [,1] [,2] # [1,]21 # [2,]12 E - eigen(X) V - E$values Q -

[R] Example scripts for R Manual

2009-08-10 Thread Peng Yu
Hi, I am wondering if some experienced users would help put the ready-to-run code of the examples in the manuals. It would help new users learn R faster by putting all the examples in an ready-to-run R script file. Can somebody help do so sometime and post the code along with the pdf manuals?

Re: [R] building a package

2009-08-10 Thread Barry Rowlingson
On Mon, Aug 10, 2009 at 10:24 PM, Erin Hodgesserinm.hodg...@gmail.com wrote: Dear R People: I'm trying to build a package and am stuck on the last part; I keep getting there is no library. You seem to have more than one version of R on the go - the one in your system $PATH:

Re: [R] create separate plots by factors

2009-08-10 Thread David M Smith
If you want to use foreach to do the looping, you can use the isplit function to create an iterator returning blocks of data, each block being the data for one site: require(foreach) site.data - read.table(isplit-data.txt,header=T) # data copied from email sites -

Re: [R] Need Advice: Considering Converting a Package from S3 to S4

2009-08-10 Thread Ben Bolker
library(fortunes) fortune(S4) Sean Davis: It got me going quickly with S4 methods, which it seems to me are the way to go in most cases. Rolf Turner: If you want to simultaneously handcuff yourself, strap yourself into a strait jacket, and tie yourself in knots, and moreover write code which is

Re: [R] problem selecting rows meeting a criterion

2009-08-10 Thread John Kane
What's wrong with it? It looks okay to me. If you use subset(data, data$X data$Y)you get the same results. Any chance you're reading the row.numbers as values? BTW data is a reserved word in R and it is good practice not to use it as a variable name. My Results X Y V3 3 3 1

Re: [R] matrix power

2009-08-10 Thread cindy Guo
Hi, Ted, Thanks for the sample code. It is exactly what I want. But can I ask another question? The matrix for which I want the negative square root is a covariance matrix. I suppose it should be positive definite, so I can do 1/sqrt(V) as you wrote. But the covariance matrix I got in R using the

[R] NotePad++ Syntax file

2009-08-10 Thread Farley, Robert
Does anyone have an R Syntax Highlighting file {userDefineLang.xml} for NotePad++?? I've started one, but I'm not so happy with it. Robert Farley Metro 1 Gateway Plaza Mail Stop 99-23-7 Los Angeles, CA 90012-2952 Voice: (213)922-2532 Fax:(213)922-2868 www.Metro.net

[R] Matrix addition and multiplication

2009-08-10 Thread Marlin Keith Cox
I posted this earlier, but am not certain that it was in fact posted, so I will try again. Hi, I have an equation Xcp and would like to look at errors affecting it. I am applying errors of -.58 to .1 to R and -.45 to .47 to Xc. I would like to look at all combinations. I set up a matrix

Re: [R] matrix power

2009-08-10 Thread Ted Harding
On 10-Aug-09 22:36:03, cindy Guo wrote: Hi, Ted, Thanks for the sample code. It is exactly what I want. But can I ask another question? The matrix for which I want the negative square root is a covariance matrix. I suppose it should be positive definite, so I can do 1/sqrt(V) as you wrote.

Re: [R] NotePad++ Syntax file

2009-08-10 Thread John Kane
No but have you had a look at Tinn-R http://www.sciviews.org/Tinn-R/. --- On Mon, 8/10/09, Farley, Robert farl...@metro.net wrote: From: Farley, Robert farl...@metro.net Subject: [R] NotePad++ Syntax file To: 'r-help@r-project.org' r-help@r-project.org Received: Monday, August 10, 2009,

Re: [R] NotePad++ Syntax file

2009-08-10 Thread [Ricardo Rodriguez] Your XEN ICT Team
John Kane wrote: No but have you had a look at Tinn-R http://www.sciviews.org/Tinn-R/. Any similar option for Mac OS X? Please, accept my excuses for cross posting, but I think this message could/should also be addressed to the R-SigMAC list. Thanks! Best, Ricardo -- Ricardo Rodríguez

Re: [R] NotePad++ Syntax file

2009-08-10 Thread Linlin Yan
I think NppToR may be a good choice. http://sourceforge.net/projects/npptor/ On Tue, Aug 11, 2009 at 6:37 AM, Farley, Robertfarl...@metro.net wrote: Does anyone have an R Syntax Highlighting file {userDefineLang.xml} for NotePad++??  I've started one, but I'm not so happy with it.

Re: [R] NotePad++ Syntax file

2009-08-10 Thread Farley, Robert
I'm using Notepad++ because it has Hex editing, Column editing, and Syntax highlighting for many languages, including awk, Batch Files, and Python built in, and I've added User Syntaxes for M2 macros, and R. I tried to find the Docs for TINN-R, but I don't see support for Hex, column, or other

[R] Statistician Needed

2009-08-10 Thread Noah Silverman
Hello, I've come up with some challenges with my process that are a bit too complicated for the mailing list. Is there anyone out there, preferably a real statistician, who is willing to consult with me via phone/email for a few hours. I'm happy to pay you for your time. Thanks, -Noah

Re: [R] matrix power

2009-08-10 Thread cindy Guo
Hi, Ted, Now I understand the problem. Thank you for the explanation. It's very helpful. I appreciate it. Cindy On Mon, Aug 10, 2009 at 3:58 PM, Ted Harding ted.hard...@manchester.ac.ukwrote: On 10-Aug-09 22:36:03, cindy Guo wrote: Hi, Ted, Thanks for the sample code. It is exactly what I

Re: [R] matrix power

2009-08-10 Thread Gabor Grothendieck
If its not important which of many solutions you use then the generalized inverse can be used, say. Just use 0 for each small eigenvalue and 1/sqrt(x) for the others. On Mon, Aug 10, 2009 at 6:36 PM, cindy Guocindy.g...@gmail.com wrote: Hi, Ted, Thanks for the sample code. It is exactly what

Re: [R] R to MATLAB translation

2009-08-10 Thread cls59
apjaworski wrote: Hi, Is there any package out there that might help me with translating R code into MATLAB? Using RSiteSearch I found a bunch of MATLAB stuff but it all seems to go in the opposite direction, i.e., emulating MATLAB functions in R. Thanks in advance, Andy

Re: [R] problem selecting rows meeting a criterion

2009-08-10 Thread Jim Bouldin
What's wrong is I'm trying to select only those rows in which X Y, but I'm getting rows in which Y X and losing some in which X Y. The row numbers are not being read as values. Very confusing. Jim What's wrong with it? It looks okay to me. If you use subset(data, data$X data$Y)you get

Re: [R] NotePad++ Syntax file

2009-08-10 Thread Michael Bibo
Farley, Robert FarleyR at metro.net writes: Does anyone have an R Syntax Highlighting file {userDefineLang.xml} for NotePad++?? I've started one, but I'm not so happy with it. Robert Farley Another vote for NppToR. Also note the author's comments about the future inclusion of R as a

  1   2   >