Re: [R] strings

2013-05-23 Thread arun
iam Dunlap To: arun ; R help Cc: Sent: Thursday, May 23, 2013 3:18 PM Subject: RE: [R] strings You recommended   > library(sqldf)   > sqldf('SELECT * FROM dat1 EXCEPT SELECT * FROM dat2') Using nothing but the core R packages setdiff() returns the difference between two s

Re: [R] strings

2013-05-23 Thread William Dunlap
wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of arun > Sent: Thursday, May 23, 2013 12:05 PM > To: R help > Subject: Re: [R] strings > > Hi, > Try: > > dat1<-

Re: [R] strings

2013-05-23 Thread MacQueen, Don
See the setdiff() function -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 5/23/13 11:04 AM, "Robin Mjelle" wrote: >I have two files containing words. I want to print the are in file 1 but >NOT in file 2. >How do I go abo

Re: [R] strings

2013-05-23 Thread arun
Hi, Try: dat1<- structure(list(V2 = c("ALKBH1", "ALKBH2", "ALKBH3", "ANKRD17", "APEX1", "APEX2", "APTX", "ASF1A", "ASTE1", "ATM", "ATR", "ATRIP", "ATRX", "ATXN3", "BCCIP", "BLM", "BRCA1", "BRCA2")), .Names = "V2", class = "data.frame", row.names = c(NA, 18L)) dat2<- structure(list(V2 = c("AL

[R] strings

2013-05-23 Thread Robin Mjelle
I have two files containing words. I want to print the are in file 1 but NOT in file 2. How do I go about? file 1: ABL1 1 ALKBH1 2 ALKBH2 3 ALKBH3 4ANKRD17 5 APEX1 6 APEX2 7 APTX 8 ASF1A 9 ASTE1 10 ATM 11 ATR 12 ATRIP 13 ATRX 14 A

Re: [R] strings concatenation and organization (fast)

2012-06-15 Thread Rui Barradas
Hello, I didn't know rep_vec couldn't be modified, I thought vec was the main vector. Revised. vec = c("1","2","3","-","-","-","4","5","6","1","2","3","-","-","-") rep_vec = rep(vec,times=20) nms = c("A","B","C","D") rv <- sapply(split(rep_vec, cumsum(rep(c(1, 0, 0), length(rep_vec)/3))), pas

Re: [R] strings concatenation and organization (fast)

2012-06-15 Thread Ben quant
I'm checking out Phil's solution...so far so good. Thanks! Yes, 25 not 5 rows, sorry about that. Rui - I can't modify rep_vec...that's just sample data. I have to start with rep_vec and go from there. have a good weekend all... Ben On Fri, Jun 15, 2012 at 2:51 PM, Rui Barradas wrote: > Hello

Re: [R] strings concatenation and organization (fast)

2012-06-15 Thread Rui Barradas
Hello, Try vec = c("1","2","3","-","-","-","4","5","6","1","2","3","-","-","-") nms = c("A","B","C","D") rep_vec <- rep(sapply(split(vec, cumsum(rep(c(1, 0, 0), 5))), paste, collapse=""), 4) mat <- matrix(rep_vec, nrow=5, byrow=TRUE, dimnames=list(NULL,nms)) mat Hope this helps, Rui Barrad

Re: [R] strings concatenation and organization (fast)

2012-06-15 Thread Phil Spector
Ben - There are most likely faster ways, but matrix(apply(matrix(rep_vec,ncol=3,byrow=TRUE),1,paste,collapse=''), ncol=4,byrow=TRUE,dimnames=list(NULL,nms)) seems reasonably fast. (Do you really mean 4 columns and *5* rows? With rep_vec = rep(vec,times=20), I get 25 rows.)

[R] strings concatenation and organization (fast)

2012-06-15 Thread Ben quant
Hello, What is the fastest way to do this? I has to be done quite a few times. Basically I have sets of 3 numbers (as characters) and sets of 3 dashes and I have to store them in named columns. The order of the sets and the column name they fall under is important. The actual numbers and the patte

Re: [R] Strings from different locale

2011-05-26 Thread sunny
Phil Spector wrote: > > Steven - > Does typing > > Sys.setlocale('LC_ALL','C') > > before the offending command suppress the message? > > - Phil Spector >Statistical Computing Facility >

Re: [R] Strings from different locale

2010-11-02 Thread Phil Spector
Steven - Does typing Sys.setlocale('LC_ALL','C') before the offending command suppress the message? - Phil Spector Statistical Computing Facility Department of Statistics

[R] Strings from different locale

2010-11-01 Thread steven mosher
I'm doing some test processing of a cvs file that appears to use a different locale from my machine. I get the following warning: input string 1 is invalid in this locale My locale is US. Is this simply a matter of changing my locale to 'all; locales? I don't know what locale the string is in,

Re: [R] strings plots

2010-02-01 Thread A Z
HI thank you very much for the advice the result, in R console, is more or less what I tried to do but I'm not able to modify, in the right way, my script: ## read the data devinp <- read.csv(textConnection(dev_input),header=FALSE,row.names=NULL) dev_inp <- as.vector(devinp, mode="integer") ## plo

Re: [R] strings plots

2010-02-01 Thread A Z
HI thank you very much for the advice the result, in R console, is more or less what I tried to do but I'm not able to modify, in the right way, my script: -- ## read the data devinp <- read.csv(textConnection(dev_input),header=FALSE,row.names=NULL) dev_inp <- as.vector(devinp, mode="integer")

Re: [R] strings plots

2010-02-01 Thread Jim Lemon
On 02/01/2010 08:50 PM, A Z wrote: Hi all ! I'm new in this list and newbie about R I'm trying to use R scripts (as in the attached file) for creating some distributions plots of data retrieved by a workflow(with Rserve, to be precise). I was able to do it (even if not in a beatiful way, I hav

[R] strings plots

2010-02-01 Thread A Z
Hi all ! I'm new in this list and newbie about R I'm trying to use R scripts (as in the attached file) for creating some distributions plots of data retrieved by a workflow(with Rserve, to be precise). I was able to do it (even if not in a beatiful way, I have to improve it especially about lab