Re: [R] cross-validation in plsr package

2010-02-22 Thread Bjørn-Helge Mevik
Peter Tillmann peter.tillm...@t-online.de writes: can anyone give an example how to use cross-validation in the plsr package. There are examples in the references cited on http://mevik.net/work/software/pls.html I miss to find the number of factors proposed by cross-validation as optimum.

[R] RExcel + RCOM + Linux

2010-02-22 Thread Philipp Rappold
Dear all, does anyone know if it is possible to connect a Windows RExcel instance to a linux R instance? Within Rexcel, I find the option Remote Server Address, but I wonder what the installation procedure on my linux (ubuntu) R looks like (if possible at all)? Thanks Philipp

Re: [R] Error of Stepwise Regression with number of rows in use has changed: remove missing values?

2010-02-22 Thread Kum-Hoe Hwang
This solution such as data-na.omit(original database) before you run step() or stepAIC() has some limitations, I think. I reduced the number of data lines, and it enhance R square value. If you have some tips or advices for another solution, I welcome. Kum Urban and Regional Planning, GRI On

Re: [R] cross-validation in plsr package

2010-02-22 Thread Peter Tillmann
Kjaere Bjørn-Helge, can anyone give an example how to use cross-validation in the plsr package. There are examples in the references cited on http://mevik.net/work/software/pls.html I miss to find the number of factors proposed by cross-validation as optimum. The

[R] Odp: new to R Project

2010-02-22 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 22.02.2010 08:49:01: hi everyone, i am new to R project can anyone please help me by providing documents If you already succeeded to install R it has installed into some directory. Use means of your operating system (maybe Windows?) to find

Re: [R] how to generate graph from dataframe?

2010-02-22 Thread Paul Hiemstra
chinna wrote: I connected to database and i am accessing the tables but i dont know how to generate graphs from the database tables. can anyone please help me i am new to R project Hi, Take a look at the plot() command. Or you can have a look at the lattice or ggplot2 packages. The

[R] plotrix 2.8-3

2010-02-22 Thread Jim Lemon
Hi all, I'm announcing this version of plotrix because I have made a couple of changes that will affect users. Although the function that used to be known as hierobarp is fairly new, there may be some users who are surprised when they find that it has changed its name to barNest. I will

[R] Single character input without Enter

2010-02-22 Thread Dieter Menne
How do I wait for a single character input without terminating Enter? Following Brian Ripley on http://markmail.org/message/ptmbkhdfnpnf5zcd In general R does not have a character-by-character interface with a keyboard. Dieter __

[R] bug in R 2.10.1 html help

2010-02-22 Thread Tristan Allouis
I'm running R 2.10.1 on a GNU/Linux Debian Squeeze (testing) I type : help.start() I get : starting httpd help server ... Terminé. Si 'xdg-open' est déjà lancé, il ne sera pas relancé, et vous devez passer à sa fenêtre. Sinon, soyez patient... I think the translation is : If

[R] how do I calculate means or cov matrix for multivariate groups

2010-02-22 Thread mirauta
Hello, Having the matrix d d value value2 class 1 1 1 x 2 2 2 x 3 3 3 x 4 4 2 x 5 5 1 y 6 11 3 y 7 12 4 z 8 13 5 z 9 14 6 z 1015 7 z I want to calculate the

Re: [R] plotrix 2.8-3

2010-02-22 Thread Tal Galili
Hi Jim, I just went thorough the demo(plotrix) , what amazing work you have done there, thank you! Tal Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) |

Re: [R] how do I calculate means or cov matrix for multivariate groups

2010-02-22 Thread Dennis Murphy
Hi: Here are three ways, but there are others: # (1) # package doBy: library(doBy) summaryBy(value + value2 ~ class, data = df) class value.mean value2.mean 1 x2.5 2.0 2 y8.0 2.0 3 z 13.5 5.5 # (2) aggregate(): with(df,

[R] rownames cannot allocate vector of size

2010-02-22 Thread Larson, TR
Hi, On R 2.10.1 for Windows, when I do the following to duplicate the structure of a large numeric matrix called matrix1: matrix2 - matrix(0,nrow=nrow(matrix1),ncol=ncol(matrix1)) and then rownames(matrix2) - rownames(matrix1) I get a cannot allocate vector of size xxMb error but if I

Re: [R] rownames cannot allocate vector of size

2010-02-22 Thread Benilton Carvalho
assigning rownames (after the object is created) triggers a copy of the object... if you assign the rownames at creation time, no extra copies... b On Mon, Feb 22, 2010 at 9:46 AM, Larson, TR t...@york.ac.uk wrote: Hi, On R 2.10.1 for Windows, when I do the following to duplicate the

Re: [R] (Somewhat) broken EPS files produced

2010-02-22 Thread Paul Hiemstra
Hi Wartan, Not really an answer to your specific problem, but you could try to use pdf instead of eps, in combination ofcourse with pdflatex. I've never had problems with pdf nad Sweave. If you need to use eps, than my reply is of no help to you :). cheers, Paul Wartan Hachaturow wrote:

Re: [R] how do I calculate means or cov matrix for multivariate groups

2010-02-22 Thread mirauta
Thanks, These functions solve 1 problem ( the mean). I tried to use them also for the cov matrix but I didn't succed. Is there any way to calculate the cov matrix for groups? -- View this message in context:

[R] Generating reports from database

2010-02-22 Thread chinna
MY REQUIREMENT: I have a database and i want to connect to the database through R Project and using the tables from the database i need to generate the reports. can anyone plese tell me whether this is possible with R project or not. Thanks in advance Chinna. -- View this message in context:

Re: [R] Generating reports from database

2010-02-22 Thread Cedrick W. Johnson
List Requirements: PLEASE do read the posting guide [1]http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. With that said.. We need a *bit* more information What database are you connecting to? MySQL? MSSQL? Are you

Re: [R] Generating reports from database

2010-02-22 Thread chinna
we r using teradata database and through R Project we have to access tables from teradata database and we need to generate graphs using that dataand also we need forecasted results of that data ...can please tell me the possible ways. Thanks in advance Regards Chinna -- View this

[R] cmdscale error message - k' must be in {1, 2, .. n - 1}

2010-02-22 Thread Sigbert Klinke
Hi, I got the error message: Error in cmdscale(1 - similarity, k = 1) : 'k' must be in {1, 2, .. n - 1} It turned out that similarity was just a scalar and therefore n-1 = 0 :( Maybe the error message could be improved. Bset Sigbert __

Re: [R] BMDP and SAS (was R in clinical trials)

2010-02-22 Thread Heinz Tuechler
Once I suggested to BMDP to introduce a module-statement that would direct the syntax to the specified module (1L, 2L, ...), so that all syntax could reside in one job, but they did not like that idea. Heinz At 14:55 19.02.2010, Terry Therneau wrote: I used both BMDP and SAS in my earlier

Re: [R] Post-Hoc tests for Friedman Test?

2010-02-22 Thread Tal Galili
Hello David, I wanted to thank you for pointing to this code for performing posthoc friedman test. I just used this example to create a function to perform this test (and also added some illustrative flexible plots to the mix), here:

Re: [R] how do I calculate means or cov matrix for multivariate groups

2010-02-22 Thread Henrique Dallazuanna
Try this: lapply(list(mean, cov), by, data = d[,1:2], INDICES = d[,'class']) On Mon, Feb 22, 2010 at 6:13 AM, mirauta bmira...@yahoo.com wrote: Hello, Having the matrix d d   value value2 class 1      1      1     x 2      2      2     x 3      3      3     x 4      4      2     x 5  

[R] change email subscription

2010-02-22 Thread Wendy Qiao
Dear R team, As this is a university email address with very small inbox limit, can I please change my R email subscription to another email address instead of this one? My new email address is wendy2.q...@gmail.com. I have change my email in my profile, but seems that does not change my

[R] Raster table: how separate lines with the same value (count 1)

2010-02-22 Thread Simone R. Freitas
Dear all, I intend to do some statistics with my raster table, like correlations or regression analysis. For that, I need that each pixel be in one line, that is, there is no count 1. So, all columns should have the same number of lines, when I compare (combine) rasters. I'd like to know if

Re: [R] tests for measures of influence in regression

2010-02-22 Thread Viechtbauer Wolfgang (STAT)
I don't think this information can be found in the documentation, but you can always just check the actual influence.measures() and print.infl() code to find out. Most importantly, influence.measures() incldues the following code: function (model) { is.influential - function(infmat, n) {

Re: [R] new to R Project

2010-02-22 Thread Dr. David Kirkby
chinna wrote: hi everyone, i am new to R project can anyone please help me by providing documents my goal is using R i have to connect to the database and i have to generate reports. Thanks in advance chinna. R is a complex program. If you can't work out how to find the documentation, I

Re: [R] (Somewhat) broken EPS files produced

2010-02-22 Thread Marc Schwartz
On Feb 21, 2010, at 10:48 PM, Wartan Hachaturow wrote: Hello. I'm writing some simple text using sweave, and faced a strange problem with eps files produced for my plots (one example attached). Individual eps files are interpreted by ghostscript just fine, and show up without errors. But

[R] R language syntax highlighting file of VIM

2010-02-22 Thread zhuojun chen
I sent an email to current maintainer Vaidotas Zemlys 2 weeks ago but no response yet. Here is a mod, it's an unfinished version. Please have a look, thanks. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] Alternatives to linear regression with multiple variables

2010-02-22 Thread Guy Green
I wonder if someone can give some pointers on alternatives to linear regression (e.g. Loess) when dealing with multiple variables. Taking any simple table with three variables, you can very easily get the intercept and coefficients with: summary(lm(read_table)) For obvious reasons, the

Re: [R] new to R Project

2010-02-22 Thread Ivan Calandra
Hi! You should first go to the home page of the R project and read the manuals available there (and there are a lot). When you'll understand how R works, read the posting guide and ask specific questions. I don't think you'll get answers if you have such imprecise questions. Ivan Le 2/22/2010

[R] Fortune candidate! Re: new to R Project

2010-02-22 Thread Detlef Steuer
One vote goes to Dave's answer! You made (saved) my day detlef On Mon, 22 Feb 2010 13:07:23 + Dr. David Kirkby david.kir...@onetel.net wrote: chinna wrote: hi everyone, i am new to R project can anyone please help me by providing documents my goal is using R i have to connect

Re: [R] odfWeave - merged table cells, and adding information like totals and p-values

2010-02-22 Thread Max Kuhn
The devel version of odfWeave has some multicolumn capabilities. these were added by Patrick Lenon and Zekai Otles recently, but I have not had a chance to test it out. You can go to: https://r-forge.r-project.org/projects/odfweave/ and download the version there if you want to evaluate the

Re: [R] cross-validation in plsr package

2010-02-22 Thread Max Kuhn
The cross-validation in the pls package does not propose a number of factors as optimum, you have to select this yourself.  (The reason for this is that there is AFAIK no theoretically founded and widely accepted way of doing this automatically.  I'd be happy to learn otherwise.) The caret

Re: [R] Fortune candidate! Re: new to R Project

2010-02-22 Thread Achim Zeileis
Thanks for the pointer, Detlef, added to the devel-version on R-Forge. Z On Mon, 22 Feb 2010, Detlef Steuer wrote: One vote goes to Dave's answer! You made (saved) my day detlef On Mon, 22 Feb 2010 13:07:23 + Dr. David Kirkby david.kir...@onetel.net wrote: chinna wrote: hi everyone,

Re: [R] Generating reports from database

2010-02-22 Thread Bart Joosen
Chinna, I found that there are ODBC drivers for the teradatabase available, so with the use of RODBC you should be able to connect to your database. This will allow you to extract your data into an R dataframe, and make reports of it. But you noticed in another thread that you are an R

[R] Rounding like in finances

2010-02-22 Thread Oliver
Hello, I need to have a kaufmaennisches Runden function. Is there already something like that? It means: rounding up the 5, instead of rounding it down. So, 245.455 would give 245.46 I found no option for this. Maybe there is a package for it? Oliver

Re: [R] Rounding like in finances

2010-02-22 Thread Henrique Dallazuanna
round(245.455, 2) ? On Mon, Feb 22, 2010 at 11:06 AM, Oliver oli...@first.in-berlin.de wrote: Hello, I need to have a kaufmaennisches Runden function. Is there already something like that? It means: rounding up the 5, instead of rounding it down. So, 245.455 would give 245.46 I found

[R] Extract information from S4 object

2010-02-22 Thread Jay
The function prediction() returns this: Formal class 'performance' [package ROCR] with 6 slots ..@ x.name : chr Cutoff ..@ y.name : chr Accuracy ..@ alpha.name : chr none ..@ x.values:List of 1 .. ..$ : Named num [1:89933] Inf 2.23 2.22 2.17 2.16 ... .. .. ..- attr(*,

Re: [R] Raster table: how separate lines with the same value (count 1)

2010-02-22 Thread David Winsemius
On Feb 22, 2010, at 6:40 AM, Simone R. Freitas wrote: Dear all, I intend to do some statistics with my raster table, like correlations or regression analysis. For that, I need that each pixel be in one line, that is, there is no count 1. So, all columns should have the same number of

Re: [R] machine precision problem

2010-02-22 Thread David Winsemius
On Feb 21, 2010, at 1:37 PM, wendy wrote: Dear all, I am analysising a set of gene expression data using multiplicative Gaussian Kernel function. I calculated the kernels between two gene sets with 2 genes for each set. The kernels are less than 1, therefore the product of the

[R] Normality in split-plot design

2010-02-22 Thread Silvano
Hi, I would like to test the normality of errors in an split-plot design using R. I used the following program: anava = aov(ganhos ~ Blocos + Trat*Supl + Error(Blocos/Trat)) summary(anava) bartlett.test(ganhos, Trat) bartlett.test(ganhos, Supl) How can I test the normality of the errors?

Re: [R] Extract information from S4 object

2010-02-22 Thread Henrique Dallazuanna
Try this: names(o...@x.values) On Mon, Feb 22, 2010 at 11:05 AM, Jay josip.2...@gmail.com wrote: The function prediction() returns this: Formal class 'performance' [package ROCR] with 6 slots  ..@ x.name      : chr Cutoff  ..@ y.name      : chr Accuracy  ..@ alpha.name  : chr none  ..@

Re: [R] Rounding like in finances

2010-02-22 Thread Oliver
Oh strange... round(108.275 , 2) [1] 108.28 round(208.275 , 2) [1] 208.28 round(308.275 , 2) [1] 308.27 looks not like what one should expect... R version 2.9.2 (2009-08-24) Ciao, Oliver __ R-help@r-project.org mailing list

Re: [R] Extract information from S4 object

2010-02-22 Thread David Winsemius
On Feb 22, 2010, at 8:05 AM, Jay wrote: The function prediction() returns this: Formal class 'performance' [package ROCR] with 6 slots ..@ x.name : chr Cutoff ..@ y.name : chr Accuracy ..@ alpha.name : chr none ..@ x.values:List of 1 .. ..$ : Named num [1:89933] Inf 2.23

Re: [R] Rounding like in finances

2010-02-22 Thread Duncan Murdoch
On 22/02/2010 9:06 AM, Oliver wrote: Hello, I need to have a kaufmaennisches Runden function. Is there already something like that? It means: rounding up the 5, instead of rounding it down. So, 245.455 would give 245.46 I found no option for this. Maybe there is a package for it? This is

Re: [R] Rounding like in finances

2010-02-22 Thread Ivan Calandra
same result with R2.10.1 on Windows... Le 2/22/2010 15:34, Oliver a écrit : Oh strange... round(108.275 , 2) [1] 108.28 round(208.275 , 2) [1] 208.28 round(308.275 , 2) [1] 308.27 looks not like what one should expect... R version 2.9.2

Re: [R] change email subscription

2010-02-22 Thread Steve Lianoglou
Hi, On Mon, Feb 22, 2010 at 7:27 AM, Wendy Qiao wendy.q...@utoronto.ca wrote: Dear R team, As this is a university email address with very small inbox limit, can I please change my R email subscription to another email address instead of this  one? My new email address is

Re: [R] Rounding like in finances

2010-02-22 Thread Oliver
Hello, which packages are you talking about? And... are thoise packages using integer-based calculations? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] svm

2010-02-22 Thread Steve Lianoglou
Hi Amy, On Sat, Feb 20, 2010 at 9:29 PM, Amy Hessen amy_4_5...@hotmail.com wrote: Hi , Could you please help me in this question:? After trying this code: library(e1071)  mydata - as.matrix(read.delim(iris.txt))  train.x - mydata[,-1]  train.y - mydata[,1]  mymodel - svm(train.x,

[R] Count between interval

2010-02-22 Thread Bosken
Hi all, I take a simple dataset like this: -1.3 1 -1.5 -1 1.5 -2.5 3 -0.5 Now I want to count how many values there are between -2 and 2. The answer here would be 6. Can anyone do this with R? Thank you in advance. Gr. Bosken -- View this message in context:

Re: [R] Accessing values of a matrix

2010-02-22 Thread statquant
Hello Sarah, thanks for answering For example if I have the following example test - as.data.frame(matrix(c(1,2,3,4, 11,12,13,14, a,b,b,c), nrow = 3, ncol=3,dimnames = list(c(r1,r2,r3,r4),NULL)) V1 V2 V3 r1 1 11 a r2 2 12 b r3 3 13 b r4 4 14 c it is easy to select test -

[R] How to run the VECM BEKK model in R?

2010-02-22 Thread 曾振兴
Dear all, I want to run the VECM BEKK model, but I cannot find the corresponding package to run this model. Anybody can help? Thanks a lot Ted -- View this message in context: http://n4.nabble.com/How-to-run-the-VECM-BEKK-model-in-R-tp1564555p1564555.html Sent from the R help mailing list

Re: [R] plot is not keeping the order of variable

2010-02-22 Thread Peter Dalgaard
Dieter Menne wrote: Peter Dalgaard wrote: d - data.frame(f=c(rare, medium,well-done)) #To get the cast in order of appearance, this can be used: d$f - factor(d$f, levels=unique(d$f)) d$f [1] rare mediumwell-done Levels: rare medium well-done .. which caused some

Re: [R] tests for measures of influence in regression

2010-02-22 Thread Frank Tamborello
Thank you, Wolfgang! Now that I know what the function does I can at least search some literature to learn about those criteria. Thanks, Frank Tamborello On Feb 22, 2010, at 7:00 AM, Viechtbauer Wolfgang (STAT) wrote: I don't think this information can be found in the documentation, but

Re: [R] Accessing values of a matrix

2010-02-22 Thread David Winsemius
On Feb 22, 2010, at 8:45 AM, statquant wrote: Hello Sarah, thanks for answering For example if I have the following example test - as.data.frame(matrix(c(1,2,3,4, 11,12,13,14, a,b,b,c), nrow = 3, ncol=3,dimnames = list(c(r1,r2,r3,r4),NULL)) This is a malformed example. Should be: test

Re: [R] R language syntax highlighting file of VIM

2010-02-22 Thread Gabor Grothendieck
Your attachment did not get though. Here is what did: https://stat.ethz.ch/pipermail/r-help/2010-February/229132.html On Mon, Feb 22, 2010 at 8:11 AM, zhuojun chen uifid...@gmail.com wrote: I sent an email to current maintainer Vaidotas Zemlys 2 weeks ago but no response yet. Here is a mod,

Re: [R] Count between interval

2010-02-22 Thread Eik Vettorazzi
Hi, ab-read.table(header=F,file=textConnection(-1.3 1 -1.5 -1 1.5 -2.5 3 -0.5)) length(which(ab =-2 ab=2)) Bosken schrieb: Hi all, I take a simple dataset like this: -1.3 1 -1.5 -1 1.5 -2.5 3 -0.5 Now I want to count how many values there are between -2 and 2. The answer here would be 6.

Re: [R] Rounding like in finances

2010-02-22 Thread Duncan Murdoch
On 22/02/2010 9:57 AM, Oliver wrote: Hello, which packages are you talking about? And... are thoise packages using integer-based calculations? I don't use this, but the ones I'd look in would be: MASS (function rational()) rcdd Rmpfr You can use RSiteSearch(rational) to look for more.

Re: [R] how to make R plot under Linux

2010-02-22 Thread xin wei
thank you for reply. I just type: hist(x) from SSH terminal, expecting a histogram to pop up like what i got under windows.instead I got the following error msg: Error in X11(d$display, d$width, d$height, d$pointsize, d$gamma, d$colortype, : unable to start device X11cairo In addition:

Re: [R] how to make R plot under Linux

2010-02-22 Thread K. Elo
Hi! 22.02.2010 17:45, xin wei wrote: thank you for reply. I just type: hist(x) from SSH terminal, expecting a histogram to pop up like what i got under windows.instead I got the following error msg: Error in X11(d$display, d$width, d$height, d$pointsize, d$gamma, d$colortype, :

Re: [R] how to make R plot under Linux

2010-02-22 Thread Kevin E. Thorpe
xin wei wrote: thank you for reply. I just type: hist(x) from SSH terminal, expecting a histogram to pop up like what i got under windows.instead I got the following error msg: Error in X11(d$display, d$width, d$height, d$pointsize, d$gamma, d$colortype, : unable to start device

Re: [R] tiff() and antialias option

2010-02-22 Thread Andrew Yee
Uwe, you're right, it turns out that cairo hadn't been previously installed on the system. Andrew 2010/2/19 Uwe Ligges lig...@statistik.tu-dortmund.de On 19.02.2010 17:44, Andrew Yee wrote: I was wondering if someone could help with the antialias option in tiff(). I'm running R 2.9.2 on

Re: [R] SEM error

2010-02-22 Thread Uwe Ligges
On 20.02.2010 08:51, Dan Edgcumbe wrote: I'm trying to do some confirmatory factor analysis on some data. My SEM model solves in 22 iterations, but when I try to look at the modification indices, using mod.indices, I get the following error message: Error in solve.default(hessian) : system

Re: [R] Rounding like in finances

2010-02-22 Thread Oliver
Duncan Murdoch murdoch at stats.uwo.ca writes: [...] MASS (function rational()) rcdd Rmpfr [...] OK, I will look for those packages. Maybe they will help. Thank you. __ R-help@r-project.org mailing list

Re: [R] Count between interval

2010-02-22 Thread Jorge Ivan Velez
Hi, Here is a suggeston: x - c(-1.3, 1, -1.5, -1, 1.5, -2.5, 3, -0.5) sum(x =-2 x=2) [1] 6 HTH, Jorge On Mon, Feb 22, 2010 at 9:49 AM, Bosken wrote: Hi all, I take a simple dataset like this: -1.3 1 -1.5 -1 1.5 -2.5 3 -0.5 Now I want to count how many values there are

Re: [R] change email subscription

2010-02-22 Thread Uwe Ligges
See the footer of your message. Uwe Ligges On 22.02.2010 13:27, Wendy Qiao wrote: Dear R team, As this is a university email address with very small inbox limit, can I please change my R email subscription to another email address instead of this one? My new email address is

Re: [R] Error with KNN

2010-02-22 Thread Uwe Ligges
On 20.02.2010 19:10, Nancy Adam wrote: Hi all I receive this error message: “Error in mymodel$MSE : $ operator is invalid for atomic vectors” When I use KNN. This is the code: library(e1071) train- rbind(iris3[,,1], iris3[,,2], iris3[,,3]) cl- factor(c(rep(s,50), rep(c,50), rep(v,50)))

[R] gsub patterns from vector elements w/out loop?

2010-02-22 Thread Marianne Promberger
Dear list, I have two vectors: x - c(one,two) y - paste(rep(x,2),blah) I want to replace all occurrences of each element of x in y with something else, so that y looks like this: y [1] something else blah something else blah something else blah [4] something else blah I can do this using a

Re: [R] replicate matrix

2010-02-22 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of wendy Sent: Saturday, February 20, 2010 6:58 PM To: r-help@r-project.org Subject: [R] replicate matrix Hi all, I have a matrix, for example [,1] [,2] [1,] 13

Re: [R] gsub patterns from vector elements w/out loop?

2010-02-22 Thread Benilton Carvalho
gsub(one|two, something else, y) ? On Mon, Feb 22, 2010 at 4:25 PM, Marianne Promberger marianne.promber...@kcl.ac.uk wrote: Dear list, I have two vectors: x - c(one,two) y - paste(rep(x,2),blah) I want to replace all occurrences of each element of x in y with something else, so that y

Re: [R] gsub patterns from vector elements w/out loop?

2010-02-22 Thread Marc Schwartz
On Feb 22, 2010, at 10:25 AM, Marianne Promberger wrote: Dear list, I have two vectors: x - c(one,two) y - paste(rep(x,2),blah) I want to replace all occurrences of each element of x in y with something else, so that y looks like this: y [1] something else blah something else

Re: [R] Count between interval

2010-02-22 Thread Peter Ehlers
And as long as the interval is symmetric about zero: sum(abs(x) = 2) [1] 6 -Peter Ehlers On 2010-02-22 9:18, Jorge Ivan Velez wrote: Hi, Here is a suggeston: x- c(-1.3, 1, -1.5, -1, 1.5, -2.5, 3, -0.5) sum(x=-2 x=2) [1] 6 HTH, Jorge On Mon, Feb 22, 2010 at 9:49 AM, Bosken wrote:

Re: [R] gsub patterns from vector elements w/out loop?

2010-02-22 Thread Marianne Promberger
gsub(paste(x, collapse = |), something else, y) [1] something else blah something else blah something else blah [4] something else blah Many thanks! I didn't know about collapse. Should have thought about reading up in ?paste ... Thanks Marianne -- Marianne Promberger PhD, King's

Re: [R] SEM error

2010-02-22 Thread Jarrett Byrnes
I have often found this to happen if the scale of one variable is orders of magnitude different than the scale of other variables. Have you tried inspecting the covariance matrix and log transforming any such variables? On Feb 22, 2010, at 8:14 AM, Uwe Ligges wrote: On 20.02.2010

[R] adding infrequent date labels to x-axis

2010-02-22 Thread emorway
I'm sure there is a clever way to do the following, but I've been unable to find it on this forum or by writing my own functions. I have 8 years worth of weekly data but would like to restrict the labels on the x-axis to months only. I've included the first year's worth of data below. My line

[R] Re : how to plot select points in preexisting persp plot

2010-02-22 Thread Preeti Iyer
Hello, I am trying to plot selected data points to a preexisting persp plot that satisfies a condition. I used the following statement - text(coords[,1], coords[,2], names(act[which(act 8.75)]), cex=0.7) But I get all the points labeled, instead of the points that satisfy the condition

Re: [R] Accessing values of a matrix

2010-02-22 Thread statquant
OKKK Thanks a lot for letting me know the subset function Cheers -- View this message in context: http://n4.nabble.com/Accessing-values-of-a-matrix-tp1561932p1564724.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Extract information from S4 object

2010-02-22 Thread Jay
Tahnk you. But, when I try the command you both suggested I get a NULL as the results. names(object1 @ x.values) NULL Where did I go wrong? On Feb 22, 4:34 pm, David Winsemius dwinsem...@comcast.net wrote: On Feb 22, 2010, at 8:05 AM, Jay wrote: The function prediction() returns this:

[R] counting repeating sequence lengths in a vector

2010-02-22 Thread Larson, TR
Hello, I have a very long (~50,000) sequence of repeating numbers. The first 100 are: [1] 0 0 0 0 0 0 0 0 0 0 0 429 [13] 429 429 429 429 429 429 429 858 858 858 858 858 [25] 858 1287 1287 1287 1287 1287 1716

Re: [R] counting repeating sequence lengths in a vector

2010-02-22 Thread Henrique Dallazuanna
Try this: rle(x)$length On Mon, Feb 22, 2010 at 2:27 PM, Larson, TR t...@york.ac.uk wrote: Hello, I have a very long (~50,000) sequence of repeating numbers.  The first 100 are: [1]     0     0     0     0     0     0     0     0     0     0     0   429  [13]   429   429   429   429   429

Re: [R] [BioC] Empirical Pvalue

2010-02-22 Thread Hervé Pagès
Hi Mohamed, Please read the posting guides for both, the R-help and BioC mailing lists, so you learn the basics of how to ask questions on these lists (and software related mailing lists in general). Following those guides will greatly increase the chance that someone will actually be willing

Re: [R] Re : how to plot select points in preexisting persp plot

2010-02-22 Thread Hrishi Mittal
Preeti, Could you please post a sample of your data and all the code? It is hard to answer your question without knowing what coords and act are - Try http://prettygraph.com Pretty Graph , the easiest way to make R-powered graphs on the web. -- View this message in context:

[R] Bootstrap Multivariate Times Series Forecast

2010-02-22 Thread Ricardo Gonçalves Silva
Dear Users, Consider a multivariate time series model: a_1*y(t)-...-a_k*y(t-k)=b+[c_1*z(t)-...-c_j*z(t-j)] i.e., a simple multivariate time series model with one exogenous variable. I would like to know what package can I use to do the following, using R: 1) Select k and j jointly; 2) Estimate

Re: [R] adding infrequent date labels to x-axis

2010-02-22 Thread emorway
Hello Hrishi, The command you suggested plotted the years on the x-axis only. It was the same exact plot as the one I included in the original post. Respectfully, Eric -- View this message in context: http://n4.nabble.com/adding-infrequent-date-labels-to-x-axis-tp1564804p1564875.html Sent

Re: [R] adding infrequent date labels to x-axis

2010-02-22 Thread Hrishi Mittal
Hi emorway, It seems to me that all you need is one command: plot(as.Date(cropped.cast1$date,%Y-%m-%d),cropped.cast1$Frac_ET_Satsfd_mean) - Try http://prettygraph.com Pretty Graph , the easiest way to make R-powered graphs on the web. -- View this message in context:

Re: [R] how to make R plot under Linux

2010-02-22 Thread xin wei
hi, Kevin and K.Elo: thank you for the suggestion. Can you be more specific on these? (like how exactly get into x-switch or man ssh). I am totally ignorant about linux and SSH:( Memory limitation forces me to switch from windows to Linux cluster. Xin -- View this message in

Re: [R] SEM error

2010-02-22 Thread John Fox
Dear Jarret, Uwe, and Dan, Sorry -- I missed the initial question. What's a bit odd here is that the singularity occurs only in the computation of the modification indices. It might help to look at the conditioning of the covariance matrix of the parameter estimates (i.e., the eigenvalues or

Re: [R] gsub patterns from vector elements w/out loop?

2010-02-22 Thread Christian Raschke
Marianne, The function substring2 from the Hmisc packages works nicely for me to do this (without explicit gsub, though): x- c(one,two) y- paste(rep(x,2),blah) y [1] one blah two blah one blah two blah substring2(y,x)- something else y [1] something else blah something else blah something

Re: [R] how to make R plot under Linux

2010-02-22 Thread Vojtěch Zeisek
Dne Po 22. února 2010 18:53:55 xin wei napsal(a): hi, Kevin and K.Elo: thank you for the suggestion. Can you be more specific on these? (like how exactly get into x-switch or man ssh). I am totally ignorant about linux Hello, in Linux You can plot as in Windows, for example using hist(x). But

Re: [R] how to make R plot under Linux

2010-02-22 Thread K. Elo
Hi! 22.02.2010 19:53, xin wei wrote: hi, Kevin and K.Elo: thank you for the suggestion. Can you be more specific on these? (like how exactly get into x-switch or man ssh). I am totally ignorant about linux and SSH:( Memory limitation forces me to switch from windows to Linux

Re: [R] Alternatives to linear regression with multiple variables

2010-02-22 Thread Liaw, Andy
You can try the locfit package, which I believe can handle up to 5 variables. E.g., R library(locfit) Loading required package: akima Loading required package: lattice locfit 1.5-6 2010-01-20 R x - matrix(runif(1000 * 3), 1000, 3) R y - rnorm(1000) R mydata - data.frame(x, y) R str(mydata)

Re: [R] how to make R plot under Linux

2010-02-22 Thread Kevin E. Thorpe
K. Elo wrote: Hi! 22.02.2010 19:53, xin wei wrote: hi, Kevin and K.Elo: thank you for the suggestion. Can you be more specific on these? (like how exactly get into x-switch or man ssh). I am totally ignorant about linux and SSH:( Memory limitation forces me to switch from windows to

Re: [R] adding infrequent date labels to x-axis

2010-02-22 Thread Hrishi Mittal
Hi emorway, You are right. I tried the command only with one year's data, in which case it plots month names as labels. But for multiple years, the labels become years. I found this old post useful - http://n4.nabble.com/Month-tick-marks-on-a-plot-td879121.html#a879121. Picking the code from the

Re: [R] adding infrequent date labels to x-axis

2010-02-22 Thread emorway
Hello Hrishi, That worked great, and in the process I learned some new ways of going about writing R code. Thank you very much for helping me out! Eric -- View this message in context: http://n4.nabble.com/adding-infrequent-date-labels-to-x-axis-tp1564804p1564943.html Sent from the R help

Re: [R] gsub patterns from vector elements w/out loop?

2010-02-22 Thread Gabor Grothendieck
Here are a few possibilities using gsubfn in the gsubfn package x - c(one,two) y - paste(rep(x,2),blah) library(gsubfn) # 1 gsubfn(\\w+, w ~ if (w %in% x) something else else w, y) # 2 gsubfn(\\w+, list(one = something else, two = something else), y) # 3 L - sapply(x, function(...) something

Re: [R] how to make R plot under Linux

2010-02-22 Thread Zhuanshi He
Hi, You just need to install X11 windows software on windows, such as xming, and start xming before ssh -X use...@remotehost Hope this helps. On 2/22/10, xin wei xin...@stat.psu.edu wrote: thank you for reply. I just type: hist(x) from SSH terminal, expecting a histogram to pop up like

[R] First Appearance of value in splitted matrix

2010-02-22 Thread jorgusch
Hello, I have a large matrix (foo), I have to split by weeks and in which measures start at different points of time. Now I am looking for the number of the week, in which a specific value appears. I do not need the date or any other information from a row, but (due to structure of result

[R] Goodness of fit test for count data

2010-02-22 Thread pinusan
Dear all, I am trying to test goodness of fit. I assume that a data follow Poisson or Negative binomial distribution. I can test the goodness of fit in case of no truncated data. However, I could not find any good function or packages when a data is truncated. For example, a frequency table

[R] useR! 2010, Submission/early registration deadline: March 1

2010-02-22 Thread Katharine Mullen
Dear R-help members, This message is to remind you that the submission deadline for abstracts for the R User Conference, useR! 2010, is one week away: Submission deadline: Monday, March 1, 2010 The deadline for early registration is also Monday, March 1, 2010. I encourage you all to

  1   2   >