Re: [R] re ading tokens

2009-11-03 Thread Dieter Menne
j daniel wrote: I am not familiar with processing text in R. Can someone tell me how to read each line of words as separate elements in a list? FE, I would like to turn: word1 word2 word3 word2 word4 into a list of length two with three character elements in the first list and

Re: [R] fill map with gradient: package?

2009-11-03 Thread Thomas Steiner
Hi, I'd like to fill an existing svg (or png) map with gradient colors. In detail: The file http://commons.wikimedia.org/wiki/File:Karte_%C3%96sterreich_Bundesl%C3%A4nder.svg should be filled with the population density data from this table:

[R] Graph to show very few classes has maximum best performers

2009-11-03 Thread Sunita22
Hello I need help for the following: my data is class no. best performers 101 10 102 21 103 1 104 3 105 5 106 190 ... ... ... ... ... ... ... ... ... ... I

[R] R2WinBUGS and R-2.10.0: The school example not running

2009-11-03 Thread Luwis Tapiwa Diya
Dear R users I have been encountering an error (in the Winbugs window: Blackbox - index out of range . ). So to me it seems R2WinBUGS is not linking up well with the new R version since the same model runs well under r-2.9.2. So is my assumption correct or am I doing something wrong. The data

Re: [R] why is adnonis function called adonis {packageveg an}

2009-11-03 Thread Jari Oksanen
stvienna wiener stvienna at gmail.com writes: I used google and looked at the documentation to find out why the ADONIS function is called adonis (in the vegan package). Because it is ANOSIM resurrected? The background is that vegan already had function anosim() which should come from

Re: [R] Plots with k-means

2009-11-03 Thread eduardo san miguel
Hello Iuri, Code sent is a sample with basic functionality from the package I´m due to send to CRAN. Final package allows inteactivity (dragging and selecting points, zooming in/out fisheye effect, ...) and full exploration of the hyperbolic-alike space simulated. Example sent just give you a

Re: [R] RMySQL and Stored procedures

2009-11-03 Thread Dieter Menne
Orvalho Augusto wrote: Can someone provide me a good way to circumvent the lack of calling Stored Procedures from RMySQL? I can not rewrite those stored procedures on R because there a lot more folks here that only understands SQL. The stored procedure returns a resultset. Use

[R] bargraph.ci - CI and color question.

2009-11-03 Thread Michael Just
Hello, When using bargraph.CI in package sciplot can the bars for each group be different colors? How do I select the color for each group? When I use this instead of the default (SD vs SE): bargraph.CI(x.factor = dose, response = len, data = ToothGrowth, ci.fun= function(x)

Re: [R] How to exclude certain columns by column names?

2009-11-03 Thread Paul Hiemstra
Linlin Yan wrote: Try this: x[, colnames(x) != 'a'] And more general: x[, !colnames(x) %in% c('a','b')] Paul [1] 3 4 On Tue, Nov 3, 2009 at 9:31 AM, Peng Yu pengyu...@gmail.com wrote: I can exclude columns by column number using '-'. But I wondering if there is an easy way to

[R] D'agostino-Pearson K2 omnibus test.

2009-11-03 Thread James Allsopp
Hi, Is there an implementation of the D'agostino K2 omnibus test in an R package. I've found the D test in the fBasics package, but this doesn't give the same answer as my algorithm. I've already coded a version of the K2 and need to check the results. I have a set of spectra with gaussian

[R] lmer and estimable

2009-11-03 Thread Park-Ng, Zaneta
Hi everyone, I'm using lmer and estimable (from packages lme4 and gmodels respectively) and have the disconcerting happening that when I run exactly the same code, I get different results! In checking this out by running the code 50x, it seems to be that answers may be randomly deviating

Re: [R] How to exclude certain columns by column names?

2009-11-03 Thread Henrique Dallazuanna
Try this; x[,setdiff(colnames(x), 'a')] On Mon, Nov 2, 2009 at 11:31 PM, Peng Yu pengyu...@gmail.com wrote: I can exclude columns by column number using '-'. But I wondering if there is an easy way to exclude some columns by column names. x=cbind(c(1,2),c(3,4)) x     [,1] [,2] [1,]    1  

Re: [R] Run R code by Vim-R-plugin (How do I to run two or more programs at the same time)?

2009-11-03 Thread Jakson A. Aquino
On Tue, Nov 03, 2009 at 04:59:30PM +0800, Pan, Jia-chiun/潘家群 wrote: I use R on Ubuntu 9.04 by Vim editor with vim-R-plugin. I want to use Vim to run two R programs A.R and B.R. At beginning, I sent A.R to R prompt by pressing \rf and F5 on my keyboard, and it works well. Meanwhile, I want to

Re: [R] Regular expression substitution ...

2009-11-03 Thread Uwe Ligges
Sander Timmer wrote: It's a bit strange: sub(/pc, '\\%', x) [1] % sub(/pc, '%', x) [1] \\% Also with fixed I'm not able to get a single \ as return value. Well, you get the printed representation (i.e. the quoted backslash - quoted with anotern backslash). Use cat(sub(/pc,

Re: [R] R2WinBUGS and R-2.10.0: The school example not running

2009-11-03 Thread Uwe Ligges
Hi, I got another report about and will investigate shortly. uwe Luwis Tapiwa Diya wrote: Dear R users I have been encountering an error (in the Winbugs window: Blackbox - index out of range . ). So to me it seems R2WinBUGS is not linking up well with the new R version since the same

Re: [R] [R-SIG-Finance] Additive decomposition method

2009-11-03 Thread FMH
Hi, Thank you for the function. I was trying to use the decompose function, but the program cannot run as there were several missing values in my data frame. Could someone advice me the way to handle on this matter? Thanks F __

Re: [R] re ading tokens

2009-11-03 Thread Gabor Grothendieck
On Tue, Nov 3, 2009 at 3:02 AM, Dieter Menne dieter.me...@menne-biomed.de wrote: j daniel wrote: I am not familiar with processing text in R.  Can someone tell me how to read each line of words as separate elements in a list? FE, I would like to turn: word1 word2 word3 word2 word4

Re: [R] package(vars) and generalized impulse response functions

2009-11-03 Thread Vimal B
Hi, I was wondering whether the package(vars) can estimate generalized impulse response functions for VARs / VECMs. The general option on package(vars) available is:- suppose I want to give a shock to 'a' and observe the response of 'b', then irf(x, impulse=a, response=b, n.ahead=10,

[R] Plotting an interaction with error bars

2009-11-03 Thread Dror D Lev
Hello. I need to plot a two-way interaction (5 levels X 3) with error bars. The x.factor will be the five-levels var and the trace.factor will be the three level var. I was able to find functions that draw error bars, but still couldn't find a way to draw an interaction plot that looks like what

Re: [R] OpenOffice Calc ODBC equivalent

2009-11-03 Thread Marc Schwartz
On Nov 2, 2009, at 10:10 PM, Kenneth Roy Cabrera Torres wrote: Hi R users: I am using RODBC to create some new .xls files each with several sheets (about 100) with sqlSave() from a data.frame inside R without any problem, but on windows XP platform. I would like to know if it is posible to

[R] tapply function

2009-11-03 Thread FMH
Hi, I tried to use tapply function to find the mean of the data in each group as the following command, but the result are NA, as there are several missing values in each group. tapply(data,group,mean) Could someone please advice me the way to  ignore the missing data in order for the

Re: [R] hierarchical clustering with Jaccard index

2009-11-03 Thread Don McKenzie
Try Jaccard. :-) karuna m wrote: hi, I want to do hierarchical clustering with Jaccord index. I tried to do with vegan package for finding index and hierarchical clustering with hclust function. While doing clustering it is showing an error message as invalid distance method. I would be

Re: [R] tapply function

2009-11-03 Thread Sundar Dorai-Raj
you must have missing values in data. Try tapply(data, group, mean, na.rm = TRUE) If that's not the case, read the bottom of this email about the posting guide. HTH, --sundar On Tue, Nov 3, 2009 at 5:28 AM, FMH kagba2...@yahoo.com wrote: Hi, I tried to use tapply function to find the mean

[R] fitting a confined mixture model

2009-11-03 Thread Giovanni Luca Ciampaglia
Hello all, I would like to fit a mixture model whose components are normal distributions confined in a closed interval. Since there are already several packages for EM, I would like to extend one of these instead of writing a new script from scratch. What would be the best way to customize

[R] Exact String Compare in R?

2009-11-03 Thread bamsel
Dear R users: Here's a barebones example of what I can't make work. As you can see, regexpr() does not perform an exact string match, which only occurs in row 1 of these data frames. Instead, as it's supposed to do, it finds b in bb and c in cc. Does anybody know what function I can use such

[R] fixed color scale for a series of contour plots

2009-11-03 Thread Marion Dumas
Hello, I am having trouble figuring out how to create a color scale that will be consistent across multiple contour plots. What I would like is to plot a series of contour or image plots for different subsets of a data set but make sure that the color key stays fixed so that the plots are

[R] R2WinBUGS not working?

2009-11-03 Thread Paul Heinrich Dietrich
This weekend I noticed that my R2WinBUGS connection was no longer working on my Windows computer at work AND my Ubuntu linux computer at home. As soon as WinBUGS opens, the message reads Index Out Of Range. I have un-installed and re-installed R on both computers and the problem remains the

[R] Re trieve scores using a cov matrix in factanal

2009-11-03 Thread apointet
Hi My goal is to do a weighted (by population) factor analysis (of votes) using R. For that I prepared the weigthed cov matrix, which matrix I pass in the factanal function. I'm facing troubles in calculating the scores of a factor analysis using as entry a cov matrix as Factanal is not able to

[R] random text added to names (bug with 2.10.0?)

2009-11-03 Thread Johann Hibschman
I'm using 2.10.0 on Linux (64 bit), and I just noticed that random numbers are occasionally added to the text of names in vectors. It's happened to me in two separate, long-running R sessions, but I can't find a way to reproduce it in a smaller setting. The code I'm using is diag.gam.2 -

Re: [R] Exact String Compare in R?

2009-11-03 Thread Gábor Csárdi
On Tue, Nov 3, 2009 at 2:41 PM, bamsel benam...@gmail.com wrote: Dear R users: Here's a barebones example of what I can't make work. As you can see, regexpr() does not perform an exact string match, which only occurs in row 1 of these data frames. Instead, as it's supposed to do, it finds b

Re: [R] fixed color scale for a series of contour plots

2009-11-03 Thread Meyners, Michael, LAUSANNE, AppliedMathematics
You don't tell us which function you use, but fixing the zlim argument in image or related functions should do the trick. M. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Marion Dumas Sent: Dienstag, 3. November 2009 14:38

[R] Odp: Exact String Compare in R?

2009-11-03 Thread Petr PIKAL
Hi what about D2[,1] %in% D1[,1] Regards Petr r-help-boun...@r-project.org napsal dne 03.11.2009 14:41:02: Dear R users: Here's a barebones example of what I can't make work. As you can see, regexpr() does not perform an exact string match, which only occurs in row 1 of these data

Re: [R] bargraph.ci - CI and color question.

2009-11-03 Thread David Winsemius
On Nov 3, 2009, at 4:51 AM, Michael Just wrote: Hello, When using bargraph.CI in package sciplot can the bars for each group be different colors? Yes. ?bargraph.CI How do I select the color for each group? Read the help page. Fifth argument down. When I use this instead of the

Re: [R] package lme4

2009-11-03 Thread wenjun zheng
Thanks,Douglas, It really helps me a lot, but is there any other way if I want to show whether a random effect is significant in text file, like P value or other index. Thanks very much again. Wenjun. 2009/11/2 Douglas Bates ba...@stat.wisc.edu On Sun, Nov 1, 2009 at 9:01 AM, wenjun zheng

[R] Scanning grep through huge files

2009-11-03 Thread Johannes Graumann
Hi, I'm dealing which huge files I would like to index. On a linux system grep -buo PATTERN FILENAME hands me the byte offsets for PATTERN very quickly and I am looking to emulate that speed and ease with native R tools - for portability and elegance. gregexpr should be able to do that but I

Re: [R] 1 dimensional optimization with local minima

2009-11-03 Thread Ravi Varadhan
Hi, One approach is to use the `multiStart' function in my BB package. You have to provide a matrix of starting values for this. Here is a simple, one-dimensional optimization problem with multiple peaks and valleys. I show how to find all the peaks in the bounded interval [0, 1]. myfn -

[R] 1 dimensional optimization with local minima

2009-11-03 Thread Prof. John C Nash
Most methods for optimization in R seek local minima, though there are some -- mainly for 1 dimensions, that attempt to find the global minimum stochastically (optim method SANN, DEoptim). SANN does, I believe, handle 1 dimension, but does not have a convergence test, but runs a fixed number of

[R] how to display a string containing greek chrs and variables

2009-11-03 Thread J . delasHeras
I'm trying something that I thought would be pretty simple, but it's proving quite frustrating... I want to display, for instance, the correlation coefficient rho in a graph. I can do something like: text(x, y, paste(rho =, cor)) where cor would be my previously calculated correlation

Re: [R] Scanning grep through huge files

2009-11-03 Thread Duncan Murdoch
On 11/3/2009 9:29 AM, Johannes Graumann wrote: Hi, I'm dealing which huge files I would like to index. On a linux system grep -buo PATTERN FILENAME hands me the byte offsets for PATTERN very quickly and I am looking to emulate that speed and ease with native R tools - for portability and

Re: [R] bargraph.ci - CI and color question.

2009-11-03 Thread Manuel Morales
On Tue, 2009-11-03 at 03:51 -0600, Michael Just wrote: Hello, When using bargraph.CI in package sciplot can the bars for each group be different colors? How do I select the color for each group? With the option err.col bargraph.CI(dose, len, group = supp, data =ToothGrowth,

Re: [R] how to display a string containing greek chrs and variables

2009-11-03 Thread baptiste auguie
Hi, try this, plot.new() x=0.8 text(0.5, 0.5, bquote(rho == .(x))) HTH, baptiste 2009/11/3 j.delashe...@ed.ac.uk: I'm trying something that I thought would be pretty simple, but it's proving quite frustrating... I want to display, for instance, the correlation coefficient rho in a

[R] Change negative values in column

2009-11-03 Thread Joel Fürstenberg-Hägg
Hi all, I'm trying to write a script that changes all negative values in a data frame column to a small positive value, based on the the minimum value of the column. However, I get the following error: Error in if (x[i] 0) { : argument is of length zero As well, I would minimum

Re: [R] package lme4

2009-11-03 Thread wenjun zheng
May be I can calculate p value by t testing approximately: 1-qnorm(Variance/Std.Dev.) But which function can help me to extract Variance and Std.Dev values from the results below: print(fm2 - lmer(Yield ~ 1 + (1|Stand) + (1|Variety) + (1|Variety:Stand),Rice)) Linear mixed model fit by REML

Re: [R] mac question

2009-11-03 Thread Steve Lianoglou
Hi, On Nov 3, 2009, at 2:41 AM, Antje wrote: Hi there, currently, I've updated R on my Mac (OS X) to version 2.10. I was wondering if I have to install all additional packages again??? In Windows, I just needed to copy the library folder of the old installation but how does it work with

[R] RandomForest PMML

2009-11-03 Thread NCS
I cannot seem to write a randomforest model in PMML - either through calling PMML(model) or through Rattle. It appears that it is not yet supported. Randomsurvivalforest is, but not randomforest. Any ideas on possible workarounds for this? Thanks ncs

Re: [R] about the cox result

2009-11-03 Thread Yihui Xie
coef(summary(fit_cox)) should give you what you wanted. Regards, Yihui -- Yihui Xie xieyi...@gmail.com Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames, IA On Tue, Nov 3, 2009 at 12:31 AM, 孟欣 lm_meng...@163.com wrote: Hi all:

[R] Calculate Averages for time data

2009-11-03 Thread Sunita22
Hello I have time data which is in hh:mm:ss format and I need to calculate averages for this data. I tried converting the data as integer so that I could calculate the average, but it doesn't serve the purpose. I tried using Chron package also. But I am stuck up as to how to deal with the time

Re: [R] Calculate Averages for time data

2009-11-03 Thread Gabor Grothendieck
Next time please provide sample input. library(chron) # input ch - c(02:24:00, 04:48:00, 07:12:00, 09:36:00, 12:00:00, 14:24:00, 16:48:00, 19:12:00, 21:36:00) # convert to times tt - times(ch) # calculate mean mean(tt) On Tue, Nov 3, 2009 at 10:35 AM, Sunita22 sunita...@gmail.com wrote:

Re: [R] Change negative values in column

2009-11-03 Thread Steve Lianoglou
Hi, On Nov 3, 2009, at 9:56 AM, Joel Fürstenberg-Hägg wrote: Hi all, I'm trying to write a script that changes all negative values in a data frame column to a small positive value, based on the the minimum value of the column. However, I get the following error: Error in if (x[i] 0) {

Re: [R] R2WinBUGS not working?

2009-11-03 Thread Uwe Ligges
Paul Heinrich Dietrich wrote: This weekend I noticed that my R2WinBUGS connection was no longer working on my Windows computer at work AND my Ubuntu linux computer at home. As soon as WinBUGS opens, the message reads Index Out Of Range. I have un-installed Yes, thanks, problem known for

Re: [R] Calculate Averages for time data

2009-11-03 Thread Sunita Patil
Thank you so much it did solve my purpose. Regards Our Thoughts have the Power to Change our Destiny. Sunita On Tue, Nov 3, 2009 at 9:15 PM, Gabor Grothendieck ggrothendi...@gmail.comwrote: Next time please provide sample input. library(chron) # input ch - c(02:24:00, 04:48:00,

[R] How to display full name for the coefficients/factors in summary()?

2009-11-03 Thread Jen-Chien Chang
Hi, I am wondering if there is a way to display the full anme of the regression coeffients/factors in the summary? Suppose I have a bogus data set using weekday as factor which has 7 levels such as: mydata - sample(364) wk - rep(1:7, 52) weekday -

Re: [R] bargraph.ci - CI and color question.

2009-11-03 Thread Michael Just
Hello, Thanks for the responses. Yes, I did try to use ?bargraph.CI for the colors. When I said bars, I meant the main bars on the graph not the error bars. However, this col=c(color, color) is what I was needed and while it didn't find in the ?bargraph.ci help, I suspect its a more

Re: [R] how to display a string containing greek chrs and variables

2009-11-03 Thread J . delasHeras
Quoting baptiste auguie baptiste.aug...@googlemail.com: Hi, try this, plot.new() x=0.8 text(0.5, 0.5, bquote(rho == .(x))) HTH, baptiste Aha! That does exactly what i wanted! Thanks! Jose -- The University of Edinburgh is a charitable body, registered in Scotland, with registration

Re: [R] Change negative values in column

2009-11-03 Thread Steve Lianoglou
Hi Joel, On Nov 3, 2009, at 11:30 AM, Joel Fürstenberg-Hägg wrote: However, I get the following error: Error in if (x[i] 0) { : argument is of length zero This is telling you that x[i] is a zero length object, so you're indexing is wrong Doesn't x[i] means index i in vector x?

[R] Invitation to connect on LinkedIn

2009-11-03 Thread Konrad Banachewicz
LinkedIn Konrad Banachewicz requested to add you as a connection on LinkedIn: -- Arnaud, I'd like to add you to my professional network on LinkedIn. - Konrad Accept invitation from Konrad Banachewicz

Re: [R] How to display full name for the coefficients/factors in summary()?

2009-11-03 Thread Kingsford Jones
By default orthogonal polynomial contrasts are used for ordered factors. Drop the 'ordered = TRUE' and you will get treatment contrasts. hth, Kingsford Jones On Tue, Nov 3, 2009 at 8:52 AM, Jen-Chien Chang jcch...@andrew.cmu.edu wrote: Hi, I am wondering if there is a way to display the full

Re: [R] about the cox result

2009-11-03 Thread Terry Therneau
To extract various portions of the coxph standard printout, look at summary.coxph help('summary.coxph') fit - coxph(... sfit - summary(fit) Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] how to display a string containing greek chrs and variables

2009-11-03 Thread Peter Ehlers
j.delashe...@ed.ac.uk wrote: Quoting baptiste auguie baptiste.aug...@googlemail.com: Hi, try this, plot.new() x=0.8 text(0.5, 0.5, bquote(rho == .(x))) HTH, baptiste Aha! That does exactly what i wanted! Thanks! Jose But does it do what it should? It's customary to use rho for a

[R] creating mulptiple new variables from one data.frame according to columns and rows in that frame

2009-11-03 Thread Hayes, Daniel
Dear R-helpers, I have a data.frame (bcpe.lat.m) containing 13 countries, ages 0-50yrs per month, and the corresponding musigma (see below). *I would like to limit the age range to include all 12 months for the 1st 5 years and only whole years for all ages thereafter for each of the

[R] Issue with %in% - not matching identical rows in data frames

2009-11-03 Thread Kaushik Krishnan
Hi folks I have two data frames. I know that the nth (let's say the 7th) row in the first data frame (sequence) is there in the second (today.sequence). When I try to check that by doing 'sequence[7,] %in% today.sequence', I get all FALSE when it should be all TRUE. I'm certain I'm making some

[R] Stacked barplot: specifying individual bar hue/luminance

2009-11-03 Thread chaski01
Hi all, I'm trying to generate barplots from simple but long (~10-row) data files, in which each bar will comprise two stacked 'sub-bars'. All the upper sub-bars will have the same hue, and all the lower bars will, likewise, have another uniform hue. However, I wish to specify the

[R] R 2.10.0: Error in gsub/calloc

2009-11-03 Thread richard . liu
I'm running R 2.10.0 under Mac OS X 10.5.8; however, I don't think this is a Mac-specific problem. I have a very large (158,908 possible sentences, ca. 58 MB) plain text document d which I am trying to tokenize: t - strapply(d, \\w+, perl = T). I am encountering the following error: Error in

[R] Stacked barplot: specifying individual bar hue/luminance

2009-11-03 Thread chaski01
Hi all, I'm trying to generate barplots from simple but long (~10-row) data files, in which each bar will comprise two stacked 'sub-bars'. All the upper sub-bars will have the same hue, and all the lower bars will, likewise, have another uniform hue. However, I wish to specify the

Re: [R] Issue with %in% - not matching identical rows in data frames

2009-11-03 Thread Sundar Dorai-Raj
?%in% says x and table must be vectors. You supplied data.frames. So %in% is coercing your today.sequence to a vector using as.character(today.sequence) Perhaps you should paste the columns together first: x - do.call(paste, c(sequence, sep = ::)) table - do.call(paste, c(today.sequence, sep =

Re: [R] AR Simulation with non-normal innovations - Correct

2009-11-03 Thread Ricardo Gonçalves Silva
Thanks Andreas. This is just the start point I was needing. Best, Rick From: Andreas Hary Sent: Tuesday, November 03, 2009 7:19 AM To: Ricardo Gonçalves Silva Subject: Re: [R] AR Simulation with non-normal innovations - Correct Have a look at function arima.sim. It allows you to specify a

Re: [R] reference on p.adjust()

2009-11-03 Thread Uwe Ligges
Peng Yu wrote: I'm wondering if there is a textbook that summarize the methods on adjusting p-values for multiple comparisons. Most of the references on p.adjust() are over 10 years old. Being 10 years old does not mean the calculus behind those methods has changed. I feel it would be

Re: [R] reference on p.adjust()

2009-11-03 Thread Peng Yu
2009/11/3 Uwe Ligges lig...@statistik.tu-dortmund.de: Peng Yu wrote: I'm wondering if there is a textbook that summarize the methods on adjusting p-values for multiple comparisons. Most of the references on p.adjust() are over 10 years old. Being 10 years old does not mean the calculus

Re: [R] R 2.10.0: Error in gsub/calloc

2009-11-03 Thread Uwe Ligges
richard@pueo-owl.ch wrote: I'm running R 2.10.0 under Mac OS X 10.5.8; however, I don't think this is a Mac-specific problem. I have a very large (158,908 possible sentences, ca. 58 MB) plain text document d which I am trying to tokenize: t - strapply(d, \\w+, perl = T). I am

[R] Help with R and Webserver (SOAP)

2009-11-03 Thread Ravi Chandra
Hello all... We are trying to use the analytical power of R in a Web based environment, and are seeking the optimal ways of accomplishing the same. We need R to accept requests from clients, perform analysis on the data as required by the users and return the results ( formatted text, graphs,

Re: [R] Create Artificial Binary Matrix based on probability

2009-11-03 Thread Erik Iverson
Try matrix(rbinom(100, 1, prob = 0.048), nrow = 10) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of bikemike42 Sent: Tuesday, November 03, 2009 11:49 AM To: r-help@r-project.org Subject: [R] Create Artificial Binary Matrix

Re: [R] Re place only first NA in column

2009-11-03 Thread Erik Iverson
Mike, Is this what you're trying to do, it avoids the awkward use of a while loop, taking advantage of the ability to vectorize R functions. fun - function() { z - matrix(rbinom(832, 1, prob = 0.048), nrow = 32) sum(rowSums(z) == 0) } a - as.matrix(replicate(1000, fun()))

Re: [R] reference on p.adjust()

2009-11-03 Thread Uwe Ligges
Peng Yu wrote: 2009/11/3 Uwe Ligges lig...@statistik.tu-dortmund.de: Peng Yu wrote: I'm wondering if there is a textbook that summarize the methods on adjusting p-values for multiple comparisons. Most of the references on p.adjust() are over 10 years old. Being 10 years old does not mean

Re: [R] R 2.10.0: Error in gsub/calloc

2009-11-03 Thread Kenneth Roy Cabrera Torres
Try the patch version... Maybe is the same problem I had with large database when using gsub() HTH El mar, 03-11-2009 a las 20:31 +0100, Richard R. Liu escribió: I apologize for not being clear. d is a character vector of length 158908. Each element in the vector has been designated by

Re: [R] Weird operator behaviour

2009-11-03 Thread Erik Iverson
Argument recycling is coming into play here with !=. I am guessing you want ! fish$Species %in% c(CRA, PHC) ? Best Regards, Erik Iverson -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of jimdare Sent: Tuesday, November 03,

Re: [R] Weird operator behaviour

2009-11-03 Thread Peter Alspach
Tena koe James Have you tried something like !fish$Species%in%c('CRA','PHC')? HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of jimdare Sent: Wednesday, 4 November 2009 11:02 a.m. To:

Re: [R] Re place only first NA in column

2009-11-03 Thread Steve Lianoglou
Hi, On Nov 3, 2009, at 3:58 PM, bikemike42 wrote: Dear All, I am trying to fill in a blank vector (a) with one value at a time, with the value of the number of rows in a randomized dataset with rowSums=0. Below is the code I've got so far, but what I want to be as the last line is

Re: [R] help with SSOAP (can't find working examples)

2009-11-03 Thread Steffen Neumann
Hi, I can confirm this, just today I tried to write a web service client. Affected are both SSOAP-0.5-4 and SSOAP_0.4-6. I can't access anonymous CVS atm. to check for recent fixes. I am unable to map the error message to any of the items in http://www.omegahat.org/SSOAP/Todo.html , is this

Re: [R] Create Artificial Binary Matrix based on probability

2009-11-03 Thread Mike Treglia
Thanks a lot Erik and Tony! Both of your suggestions accomplish what I need. Cheers, Mike Erik Iverson wrote: Try matrix(rbinom(100, 1, prob = 0.048), nrow = 10) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of bikemike42

Re: [R] Issue with %in% - not matching identical rows in data frames

2009-11-03 Thread Charles C. Berry
Kaushik, The documentation doesn't quite tell (me, anyway) how the function behaves when 'target' is a list (or data.frame). You'll need to dig into match.c or experiment with match() or %in% to see what it is actually doing. But it looks like it is matching whole columns of the data.frame

[R] Create Artificial Binary Matrix based on probability

2009-11-03 Thread bikemike42
Dear All, I am trying to create an artificial binary matrix such that each cell has a probability of 0.048 of having a 1. So far the closest I've come is us by using a random poisson distribution with a mean of 0.048, but I can't figure out how to limit the max value to 1. Otherwise that would

[R] Create Artificial Binary Matrix based on probability

2009-11-03 Thread bikemike42
Dear All, I am trying to create an artificial binary matrix such that each cell has a probability of 0.048 of having a 1. So far the closest I've come is us by using a random poisson distribution with a mean of 0.048, but I can't figure out how to limit the max value to 1. Otherwise that would

[R] Passing Command to Optim in factanal

2009-11-03 Thread Ali Torkamani
Hi, I am currently trying to execute the following command: f-factanal(factors=k$Components$nparallel,covmat=m,n.obs=2287,rotation=varimax,control=list(opt=list(method=c(BFGS but keep getting the error: L-BFGS-B needs finite values of 'fn' I can't figure out what I am doing wrong here, why

[R] Re place only first NA in column

2009-11-03 Thread bikemike42
Dear All, I am trying to fill in a blank vector (a) with one value at a time, with the value of the number of rows in a randomized dataset with rowSums=0. Below is the code I've got so far, but what I want to be as the last line is a[1st NA,]=nz such that this will run until all of my NAs are

[R] ROC

2009-11-03 Thread carol white
My question would be related more to time-dependent ROC (survivalROC package): I would like to know how true positives (TP) and false positives (FP) are related to the order of survival times and diagnostic markers. That is, having the a set of TP and FP, each of them is calculated from which

Re: [R] OpenOffice Calc ODBC equivalent (SOLVED)

2009-11-03 Thread Kenneth Roy Cabrera Torres
Thank you Dr. Schwartz: I did not read this post before, See this post from late 2007: http://tolstoy.newcastle.edu.au/R/e3/help/07/12/6478.html As far as I know, nothing has changed vis-a-via ODBC connectivity TO OpenOffice files. You can use ODBC FROM OpenOffice to connect to

Re: [R] Re place only first NA in column

2009-11-03 Thread Mike Treglia
Erik and Steve, Thanks again for your help, both solutions do exactly what I need. Cheers, Mike Steve Lianoglou wrote: Hi, On Nov 3, 2009, at 3:58 PM, bikemike42 wrote: Dear All, I am trying to fill in a blank vector (a) with one value at a time, with the value of the number of rows in a

Re: [R] package lme4

2009-11-03 Thread Douglas Bates
On Tue, Nov 3, 2009 at 9:11 AM, wenjun zheng wjzhen...@gmail.com wrote: May be I can calculate p value by t testing approximately:  1-qnorm(Variance/Std.Dev.) That would be a z test, not a t test, wouldn't it? And it would only be meaningful if the distribution of the estimator is

Re: [R] how to display a string containing greek chrs and variables

2009-11-03 Thread J . delasHeras
Quoting Peter Ehlers ehl...@ucalgary.ca: j.delashe...@ed.ac.uk wrote: Quoting baptiste auguie baptiste.aug...@googlemail.com: Hi, try this, plot.new() x=0.8 text(0.5, 0.5, bquote(rho == .(x))) HTH, baptiste Aha! That does exactly what i wanted! Thanks! Jose But does it do what it

Re: [R] one long column of data - three small columns

2009-11-03 Thread Peter Alspach
Tena koe ?matrix The exact syntax will depend on the class of your 'column of data'. If it is a dataframe, for example, then try matrix(yourData[,1], 3, 3) HTH ... Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On

Re: [R] how to display a string containing greek chrs and variables

2009-11-03 Thread Peter Ehlers
j.delashe...@ed.ac.uk wrote: Quoting Peter Ehlers ehl...@ucalgary.ca: j.delashe...@ed.ac.uk wrote: Quoting baptiste auguie baptiste.aug...@googlemail.com: Hi, try this, plot.new() x=0.8 text(0.5, 0.5, bquote(rho == .(x))) HTH, baptiste Aha! That does exactly what i wanted! Thanks!

Re: [R] one long column of data - three small columns

2009-11-03 Thread Jorge Ivan Velez
Hi french, Here is a suggestion: x - c(2, 3, 4, 2, 1, 6, 6, 4, 7) matrix(x, ncol = 3) # [,1] [,2] [,3] # [1,]226 # [2,]314 # [3,]467 with x the column of data you have. HTH, Jorge On Tue, Nov 3, 2009 at 2:05 PM, frenchcr wrote: say i have a column

[R] Weird operator behaviour

2009-11-03 Thread jimdare
Hi, I have a dataset called 'fish'. fish$Species returns extract 1. When I use fish$Species != c(CRA,PHC), i.e. I want all species except CRA and PHC, I get extract 2 which is blatantly wrong. Can anyone see what I'm doing wrong? Regards, James EXTRACT 1 fish$Species [1] ALB ALB ALB

[R] Setting column widths in heatmap

2009-11-03 Thread Ken Termiso
Hello, I cannot figure out how to set the column widths (either relative or absolute) for the heatmap function - the full manual hints that layout and lcm will control this, but I haven't had any luck. This is in R 2.9.2 compiled for either FC10 or SUSE11.1 (x86_64)... and am sending the

Re: [R] reshaping pairs of columns

2009-11-03 Thread jim holtman
Try this: require(reshape) # melt the data x - melt(maps, id='point') # split out the labels labels - do.call(rbind, strsplit(sub((.*)(.), \\1 \\2, x$variable), ' ')) x$source - labels[, 2] x$variable - labels[, 1] cast(x, point + source ~ variable) point sourcelat long 1 1

Re: [R] one long column of data - three small columns

2009-11-03 Thread frenchcr
frenchcr wrote: say i have a column of data like this... 2 3 4 2 1 6 6 4 7 and i want it in three columns like this 226 314 467 ...so i can make a contour plot. How do i do this? ok, so matrix(x, 3, 3) works. what if i have a b c a c a c and want a b c a

[R] Two questions about cloud().

2009-11-03 Thread Rolf Turner
(1) Is there a (simple) way of getting cloud() to do *both* type=p and type=h? I.e. of getting it to plot the points as points *and* drop a perpendicular line to the underlying plane? (2) Is there a way of telling cloud() to drop its lines to the floor of the bounding box, rather than to the

Re: [R] Weird operator behaviour

2009-11-03 Thread Jorge Ivan Velez
Hi Jim, Take a look at ?%in%, especially its first example. HTH, Jorge On Tue, Nov 3, 2009 at 5:02 PM, jimdare wrote: Hi, I have a dataset called 'fish'. fish$Species returns extract 1. When I use fish$Species != c(CRA,PHC), i.e. I want all species except CRA and PHC, I get extract

Re: [R] Create Artificial Binary Matrix based on probability

2009-11-03 Thread Tony Plate
x - matrix(sample(0:1, 1200, replace=T, prob=c(0.952, 0.048)), ncol=30) table(x) x 01 1131 69 x - matrix(sample(0:1, 1200, replace=T, prob=c(0.952, 0.048)), ncol=30) table(x) x 01 1151 49 bikemike42 wrote: Dear All, I am trying to create an artificial binary matrix

Re: [R] avoiding loop

2009-11-03 Thread parkbomee
Thanks for your help. Date: Mon, 2 Nov 2009 18:50:42 -0500 Subject: Re: [R] avoiding loop From: jholt...@gmail.com To: bbom...@hotmail.com CC: mtmor...@fhcrc.org; r-help@r-project.org The first thing I would suggest is convert your dataframes to matrices so that you are not having to

  1   2   >