Re: [R] Replacing a string

2012-11-04 Thread Allie818
Thanks so much Arun! It's the second case. Being able to extract is really powerful too. Thank you for sharing that as well! Sent from my iPad On Nov 4, 2012, at 12:00 AM, "arun kirshna [via R]" wrote: > HI, > > I am not sure how you want your output. > Is it something like: > "WEBSITEWE

[R] Replacing a string

2012-11-04 Thread Allie818
Hi, I have what I hope is a simple text processing question in R. I want to replace every instance of http:\\XXX.com with "WEBSITE" When I try sub('(^http://)(.com$)', 'WEBSITE', );, it only substitutes http:// and .com so it looks like WEBSITEXXXWEBSITE How do I get it to match the pattern "

[R] Color barplots with a conditional?

2011-09-14 Thread Allie818
I've made a barplot that has several bars. I'd like the bars to be colored according to the type of category they are in. Is there a way to put a conditional into the color parameter in barplot? i.e. if data$category[i] == 1, color the bar red Do I need to generate the coloring sequence before the

[R] Getting p-value from summary output

2011-02-10 Thread Allie818
I can get this summary of a model that I am running: summary(myprobit) Call: glm(formula = Response_Slot ~ trial_no, family = binomial(link = "probit"), data = neg_data, na.action = na.pass) Deviance Residuals: Min 1Q Median 3Q Max -0.9528 -0.8934 -0.8418 1.44

[R] Read data in R

2010-08-23 Thread Allie818
I have a txt file with column data separated by commas. Subject,Sessionblock,LotteryImg,SubjectResp,Pictime,Bidtime,Voltage,ForcedAns 10816,Session1,75_C2.jpg,No,7095,9548,Mid,Yes 10816,Session1,25_C1.jpg,No,16629,18130,Low,Yes 10816,Session1,5_C1.jpg,No,23217,24276,Low,Yes 10816,Session1,75_C1.j