Re: [R] (no subject)

2011-10-21 Thread Daniel Nordlund
I believe you could also set your subscription to NOMAIL and then read the posts from the R-help archive. This would also allow you to post to R-help since you are still subscribed. Hope this is helpful, Dan Daniel Nordlund Bothell, WA USA > -Original Message- > From: r-hel

Re: [R] symmetric matrix multiplication

2011-10-23 Thread Daniel Nordlund
t; [1] 0 > > C = t(A)%*%B%*%A > > (max(abs(C - t(C > [1] 3.552714e-15 > > Any help on the matter would be very much appreciated. > > Welcome to the world of floating-point calculation on finite precision computers. You need to read R FAQ 7.31. Your maximum difference

Re: [R] Syntax Help for xyplot()

2011-10-24 Thread Daniel Nordlund
site sampdate TDS Cond SO4 p4 p5 p6 p7 BC-0.5 1996-06-02 530 NA 194 NA NA NA NA if you have other lines for site/sampdate BC-0.5 / 1996-06-02 then you would use the quant values to fill in for Cond and the other paramenters. Then your xyplot code should work. Someone else will need

Re: [R] Performing a non parametric Friedman Test

2011-10-25 Thread Daniel Malter
There is a friedman.test() function. Any reason you want to do it by hand? If so, you can do: #Simulated data matrix x<-matrix(rnorm(9),3,3,byrow=T) x #Rank matrix r<-matrix(rank(x),dim(x)) HTH, Daniel JohnnyJames wrote: > > My data loo

Re: [R] Contrasts with an interaction. How does one specify the dummy variables for the interaction

2011-10-28 Thread Daniel Malter
;-factor(column) contrasts(row)<-contr.treatment(levels(row)) contrasts(column)<-contr.treatment(levels(column)) # Works for Terps fit.terp<-glm(counts ~ row + column + row*column, family=poisson(link="log")) summary(fit.terp) HTH, Daniel Malter University of Maryland, College Park

Re: [R] Error in optim

2011-10-28 Thread Daniel Malter
in your data (100) when it should be of length (1), i.e., the sum of the former. If you define log.lik as the appropriate sum, you should be successful. HTH. Daniel djbanana wrote: > > I am trying to run this code and obtain the MLEs for my parameters. > However I am getting this error a

Re: [R] Matching

2011-10-29 Thread Daniel Malter
we can copy paste to the R-prompt). Moreover, chances are that when you try to reproduce the error with simulated code, you will figure out what your mistake is. Best, Daniel shish matt wrote: > > I have a spatial weight file in csv that I want as listw object in R. > The file has the

Re: [R] Sampling with conditions

2011-11-07 Thread Daniel Nordlund
,nrow=5, ncol=10) repeat{ c1 <- sample(0:10, 4, replace=TRUE) if(sum(c1) <= 10) break } n[,1] <- c(c1,10-sum(c1)) n Hope this is helpful, Dan Daniel Nordlund Bothell, WA USA __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/l

Re: [R] Interpreting Multiple Linear Regression Summary

2011-11-09 Thread Daniel Nordlund
lar results. > > Puzzled, > > Rich > Rich, I don't see a 'data=' parameter in your call to lm(). How does lm() know where to find the variables referenced in the model parameter? If that is not the problem, then we need to see str() output for the data frame th

Re: [R] Interpreting Multiple Linear Regression Summary

2011-11-09 Thread Daniel Nordlund
t there was 'nothing to model.' If that were the case, you would have gotten non-significant parameter estimates, not NA's. I would guess that there is something problematic with the how the data frame is structured relative to what lm() is expecting. So, I would not give up l

Re: [R] problems reading a large dta dataset in R

2012-03-05 Thread Daniel Nordlund
f. > You are correct, R can handle files that size with no problem (given sufficient memory). You say you can't provide a working example. Well, it will be difficult for anyone to give you a working solution. We don't have access to the file you are trying to read so we can'

Re: [R] GPS handling libraries or (String manipulation)

2012-03-07 Thread Daniel Nordlund
47.513 in the string above just over 47 and one-half minutes? In the calculation above, the .513 minutes is being treated as 513 seconds (I know that is what the OP asked for). Shouldn't the calculation actually be something like this c(1, 1/60) %*% strapply(x, "\\d+.?\\d+", as.numer

Re: [R] gsub: replacing double backslashes with single backslash

2012-03-07 Thread Daniel Nordlund
ring that actually has two consecutive backslashes, which print() will display as four consecutive backslashes. If you are talking about a variable, tmp, that actually has two backslashes in it, then it will display like this > tmp [1] "C:" > print(tmp) [1] "C:\\

Re: [R] Siegel-Tukey test for equal variability (code)

2012-03-09 Thread Daniel Malter
#The code of rank 1 in the previous post should have read #rank1<-apply(iterator1,1,function(x) x+base1) #corrected code below siegel.tukey=function(x,y,id.col=TRUE,adjust.median=F,rnd=-1,alternative="two.sided",mu=0,paired=FALSE,exact=FALSE,correct=TRUE,conf.int=FALSE,conf.level=0.95){ if(id.col=

[R] suggestions for debugging problem with a package

2012-03-12 Thread Daniel Nordlund
because R itself stops working. I downloaded R-2.14.2patched and experienced the same problem.Any suggestions about how to debug this problem? Thanks, Dan Daniel Nordlund Bothell, WA USA __ R-help@r-project.org mailing list https://stat.

Re: [R] Re : Elegant Code

2012-03-16 Thread Daniel Nordlund
<- rpois(50,theta4) > > b5 <- rigamma(50,1,1) > theta5 <- rgamma(50,0.5,(1/b5)) > sim5 <- rpois(50,theta5) > > > > par(mfrow=c(1,5)) > boxplot(sim1) > boxplot(sim2) > boxplot(sim3) > boxplot(sim4) > boxplot(sim5); > > Thanks, > Raphael &

Re: [R] Extracting numbers from a character variable of different types

2012-03-18 Thread Daniel Malter
months<-gsub('[[:alpha:]]|[[:punct:]]|0','',x[grep("/M|/m",x)]) #months months Convert the resulting character vectors into numeric vectors by as.numeric(as.character(years)) , for example. HTH, Daniel -- View this message in conte

Re: [R] Remove leading and trailing white spaces

2012-03-20 Thread Daniel Malter
This just saved me a lot of time. Thank you! Daniel -- View this message in context: http://r.789695.n4.nabble.com/Remove-leading-and-trailing-white-spaces-tp907851p4489725.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r

[R] Export Created Variables to SPSS/.csv

2012-03-26 Thread Strassburger, Daniel
t the variables I've created within R into an SPSS-usable file. Thanks for your help! -Daniel [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] A introductory question about Zips law (Newbie to statistics)

2012-03-31 Thread Daniel Nordlund
statistical consulting. However, you might want to read up on Zipf's Law (for example, the link below which gives an answer to your question), and then come back and ask an R related programming question. http://en.wikipedia.org/wiki/Zipf%27s_law Dan Daniel Nordlund Bothell, WA

[R] Question on Counting Factors

2012-04-11 Thread Daniel Gabrieli
Hi, I hope this is not too trivial, but I've had this recurring problem and I think there is super easy solution, just not sure what it is. Please see short example below.  I would like to get the frequency (counts) of all the variables in a single column (that is easy), but I would also like to r

Re: [R] 2 sample wilcox.test != kruskal.test

2012-01-11 Thread Daniel Nordlund
gt; > You don't provide context, so I don't know what results you can't reproduce. But you need to reread the help page for the kruskal.test and look at the examples give. If x and y are the results for two independent groups, then the call to the kruskal.test should be e

Re: [R] New to R, Curious about Project Idea

2012-01-11 Thread Daniel Nordlund
, greatly appreciated. > > Thanks, > > Phil > Not my area of expertise, but if you go to your favorite CRAN mirror and look at the task views, you will find info on spatial analysis. Also, Googling 'R GIS' brings up a "ton" of hits. Good luck, Dan Dani

Re: [R] Reading in tab (and space) delimited data within a scriptXXXX

2012-01-19 Thread Daniel Nordlund
; ', na.strings='-99', row.names='OBSNO') Something may have become corrupted on your system. Try restarting R and re-running the code. If that doesn't solve the problem, then you may need to show us exactly the code you are executing, and provide releva

Re: [R] Incorrect DateTime using ISOdatetime in R

2012-01-20 Thread Daniel Nordlund
gt; in > my R books - no luck so far. Maybe I'm missunderstanding the entire > ISOdatetime function? > Julia, are the times from your GPS really GMT times, or are they your local time (it looks like you are in Germany)? It looks lik

[R] question on model.matrix

2012-01-29 Thread Daniel Negusse
reciate if you can explain it in the simplest way you can. i > am a pure molecular biologist and trying to learn this new monster called R. > :-) > > thanks, > > daniel [[alternative HTML version deleted]] __ R-help@r-pr

[R] need some help with model.matrix

2012-01-30 Thread Daniel Negusse
E help? thanks, daniel [[alternative HTML version deleted]] __ 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 provide commented, m

[R] Easier way to do this?

2012-01-31 Thread Daniel Negusse
can someone tell me if there is an easier way to do this in R - create a design matrix? thanks. —> design <- model.matrix(~ -1+factor(c(1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5))) # Creates an appropriate design matrix can someone tell me

Re: [R] R's memory capabilities

2012-02-06 Thread Daniel Nordlund
. > > Thanks a lot > > Alex > maybe look at ?as.vector. But it is really hard to know without knowing what you expect your "vector to look like or what transforms you will be doing. Hope this is helpful, Dan Daniel Nordlund Bothell, WA USA __

[R] How do I get the CEM (coarsened exact matching) package to run?

2012-02-06 Thread Daniel Malter
ile = stderr()).Internal(printDeferredWarnings())} invisible(structure(msg, class = "try-error", condition = e))}) 19: try(gsub("\\s+", " ", paste(capture.output(print(args(cem))), collapse = "")), silent = TRUE) Possible actions: 1: abort

Re: [R] Getting codebook data into R

2012-02-09 Thread Daniel Nordlund
ebook$width[i]) if(codebook$skip[i] > 0) read.col <- c(read.col,-codebook$skip[i]) } ## recode type values to R classes codebook$Rtype <- ifelse(codebook$type %in% c('int','float'),'numeric', 'character') ## now read in the data fwfdata <- re

Re: [R] Getting codebook data into R

2012-02-11 Thread Daniel Nordlund
n the codebook page http://www.cdc.gov/nchs/nsfg/nsfg_2006_2010_puf.htm#codebooks hope this is helpful, Dan Daniel Nordlund Bothell, WA USA __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] R

2012-02-19 Thread Daniel Nordlund
> HTH, > -steve > > -- > Steve Lianoglou > Graduate Student: Computational Systems Biology > | Memorial Sloan-Kettering Cancer Center > | Weill Medical College of Cornell University > Contact Info: http://cbio.mskcc.org/~lianos/contact Daniel Nordlund Bothell, WA U

Re: [R] Case weighting

2012-02-23 Thread Daniel Nordlund
) > > rep(data.recieved[x,1], times=data.recieved[x,2] )) ) ) > > [1] No No No No No No No No No No Yes Yes Yes > > Levels: Yes No > > > > > > > >>> > >>> par(mfrow=c(1,2)); > >>> plot(data.recieved$**kindergarten_a

Re: [R] from data.frame to Venn diagram

2012-02-27 Thread Daniel Nordlund
, C2=C2), "c:/tmp/Venn_2set_simple.tiff") If that is not what you want, then you will need to provide an example of what you want your output to be. Hope this is helpful, Dan Daniel Nordlund Bothell, WA USA __ R-help@r-project.org mailing

Re: [R] Siegel-Tukey test for equal variability (code)

2012-02-28 Thread Daniel Malter
The previously posted code contains bugs. The code below should work: x: a vector of data y: Group indicator (if id.col=TRUE); data of the second group (if id.col=FALSE). If y is the group indicator it MUST take 0 or 1 to indicate the groups, and x must contain the data for both groups. id.col:

[R] Consolidate column contents of equally "named" columns

2012-04-28 Thread Daniel Malter
uot;,NA,NA,2) d<-data.frame(x1,y1,x2,y2,x3,y3) d # d looks like: x1 y1 x2 y2 x3 y3 1xyxyxy 213 3 21 432 >From this, I want to create the table or data frame x y 1 3 2 1 3 2 I would appreciate your help. Daniel

Re: [R] generate random numbers for lotteries

2012-04-29 Thread Daniel Nordlund
if(N) ) > > Mike > I don't know what the OP is really trying to accomplish yet, and I am not motivated (yet) to try to figure it out. However, all this "flooring" and "ceiling) and "rounding" is not necessary for generating uniform random integers.

Re: [R] Help with writing data to csv

2012-05-12 Thread Daniel Nordlund
ou need to use write.table() directly. That being said, what was the result of the output of the very first command that you said you used? write.csv(practice, file.choose(new=T), quote=F, row.names=F) I used the built-in data frame, cars, instead of your file practice and it worked just fine in producing a comma separated value file. Dan Daniel Nordlund Bothell, WA USA __ 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 provide commented, minimal, self-contained, reproducible code.

[R] vuong/clarke tests for relogit

2012-05-15 Thread Daniel McDowell
Does anyone know a package that will conduct Vuong and Clarke tests to compare non-nested rare-events logit ("relogit") models via Zelig? I know the pscl package can conduct a Vuong test, however, it doesn't seem to work with relogit. I haven't been able to find a package that can implement the Cla

[R] double buffering in windows() not working

2012-05-15 Thread Daniel Carr
I have doubled buffered animations that I show in class. They used to work but now flash. The default windows() option is buffered = TRUE. Just in case, I tried using windows( buffered = TRUE) but this made no difference. I am not sure when the change occurred. An older R2.11 version in one cla

Re: [R] Emacs Bundle...

2008-05-25 Thread Daniel Nordlund
arch for: emacs ess windows > > 2nd hit, 4th bullet from the end. > > -- For emacs-ess on windows here is a recent post from Vincent Goulet that provided me with a very simple install on both WinXP and Vista. http://finzi.psych.upenn.edu/R/Rhelp02a/archive/125362.html Hope

[R] how to bind lists recursively

2008-05-27 Thread Daniel Yang
so that the last element would be the newly added one while the previous elements all remain the same? Thanks! Daniel __ 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.

Re: [R] "rbinom" : Does randomness preclude precision?

2008-05-28 Thread Daniel Nordlund
e for sum(rbinom(100, 1, p=.15)) So, you can randomly arrange a certain percentage of ones in a sequence, but you should not expect to see that exact percentage in any subset of the sequence. One other example, if you flip a fair coin 100 times, do you expect to get exactly 50 heads? Hop

[R] Ancova: formula with a common intercept

2008-06-02 Thread Daniel Brewer
0.059190.55646 0.1060.916 p53plus 0.229770.55646 0.4130.682 Time:p53plus 0.118870.02524 4.709 4.62e-05 *** But I do not think that is doing what I want. Many thanks -- ****** Daniel Brewer, Ph.D. Inst

[R] Improving data processing efficiency

2008-06-05 Thread Daniel Folkinshteyn
Hi everyone! I have a question about data processing efficiency. My data are as follows: I have a data set on quarterly institutional ownership of equities; some of them have had recent IPOs, some have not (I have a binary flag set). The total dataset size is 700k+ rows. My goal is this: For

Re: [R] how to get the distribution curve from a data set?

2008-06-05 Thread Daniel Folkinshteyn
would a density plot do? try plot(density(x)) if you are specifically after the histogram tops rather than a density estimate, then get the hist object with plot=F, then look at the counts attribute: histobj = hist(x, freq="TRUE", breaks=1000, plot=F) plot(histobj$counts) hope this helps. o

Re: [R] Improving data processing efficiency

2008-06-05 Thread Daniel Folkinshteyn
oosen said the following: Maybe you should provide a minimal, working code with data, so that we all can give it a try. In the mean time: take a look at the Rprof function to see where your code can be improved. Good luck Bart Daniel Folkinshteyn-2 wrote: Hi everyone! I have a question

Re: [R] [Possible SPAM] Reading selected lines in an .html file

2008-06-05 Thread Daniel Folkinshteyn
i know this is an R mailing list :) but... i'll recommend you try python with the beautifulsoup module - makes html processing a cinch. another thing to note is that wunderground provides very handy RSS feeds for every location, so rather than parsing the html page (with it's associated bundle

Re: [R] write.table() error

2008-06-05 Thread Daniel Folkinshteyn
looks like you don't have permission to write a file to C:\ try writing to some other directory where you have write access (e.g., your user's home dir, or your "my documents", or something like that). on 06/05/2008 11:57 PM Megh Dal said the following: Hi, I got following error in write.tab

Re: [R] problems with reading the data and merge

2008-06-05 Thread Daniel Folkinshteyn
the '00' entries may be in a numeric column, so it gets typecast to a number, and of course 00 == 0, numerically speaking, so they get 'condensed'. to be sure you read everything "as is", specify "colClasses='character'. : data<-read.table("data.txt",sep='\t', header=T, colClasses='character')

Re: [R] Multiple comment.char under read.table

2008-06-06 Thread Daniel Folkinshteyn
according to the helpfile, comment only takes one character, so you'll have to do some 'magic' :) i'd suggest to first run mydata through sed, and replace one of the comment chars with another, then run read.table with the one comment char that remains. sed -e 's/^\^/!/' mydata.txt > mydata2

Re: [R] simple data question

2008-06-06 Thread Daniel Folkinshteyn
should work - don't even have to put them in quotes, if your field separator is not space. why don't you just try it and see what comes out? :) on 06/06/2008 08:43 AM stephen sefick said the following: if I wanted to use a name for a column with two words say Dick Cheney and George Bush can I p

Re: [R] Merging two dataframes

2008-06-06 Thread Daniel Folkinshteyn
try this: FullData <- merge(ETC, SURVEY, by.x = "ord", by.y = "uid", all.x = T, all.y = F) on 06/06/2008 07:30 AM Michael Pearmain said the following: Hi All, Newbie question for you all but i have been looking at the archieves and the help dtuff to get a rough idea of what i want to do I wo

Re: [R] request: a class having max frequency

2008-06-06 Thread Daniel Folkinshteyn
names(f)[which.max(f)] on 06/06/2008 09:14 AM Muhammad Azam said the following: Dear R users I have a very basic question. I tried but could not find the required result. using dat <- pima f <- table(dat[,9]) f 0 1 500 268 i want to find that class say "0" having maximum frequency i.e

Re: [R] Merging two dataframes

2008-06-06 Thread Daniel Folkinshteyn
than by.y and by.x? I think when i was playing around i tried the all. command in that setup as well Mike On Fri, Jun 6, 2008 at 2:07 PM, Daniel Folkinshteyn <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote: try this: FullData <- merge(ETC, SURVEY, by.x = &

Re: [R] Improving data processing efficiency

2008-06-06 Thread Daniel Folkinshteyn
Anybody have any thoughts on this? Please? :) on 06/05/2008 02:09 PM Daniel Folkinshteyn said the following: Hi everyone! I have a question about data processing efficiency. My data are as follows: I have a data set on quarterly institutional ownership of equities; some of them have had

Re: [R] Improving data processing efficiency

2008-06-06 Thread Daniel Folkinshteyn
i did! what did i miss? on 06/06/2008 11:45 AM Gabor Grothendieck said the following: Try reading the posting guide before posting. On Fri, Jun 6, 2008 at 11:12 AM, Daniel Folkinshteyn <[EMAIL PROTECTED]> wrote: Anybody have any thoughts on this? Please? :) on 06/05/2008 02:09 PM

Re: [R] Store filename

2008-06-06 Thread Daniel Folkinshteyn
well, where are you getting the filename in the first place? are you looping over a list of filenames that comes from somewhere? generally, for concatenating strings, look at function 'paste': write.table(myoutput, paste(myfilename,"_out.txt", sep=''),sep="\t") on 06/06/2008 11:51 AM DAVID ARTE

Re: [R] Improving data processing efficiency

2008-06-06 Thread Daniel Folkinshteyn
008 at 12:03 PM, Daniel Folkinshteyn <[EMAIL PROTECTED]> wrote: i did! what did i miss? on 06/06/2008 11:45 AM Gabor Grothendieck said the following: Try reading the posting guide before posting. On Fri, Jun 6, 2008 at 11:12 AM, Daniel Folkinshteyn <[EMAIL PROTECTED]> wrote: Anybod

Re: [R] Improving data processing efficiency

2008-06-06 Thread Daniel Folkinshteyn
[EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and "A Guide for the Unwilling S User") Daniel Folkinshteyn wrote: Anybody have any thoughts on this? Please? :) on 06/05/2008 02:09 PM Daniel Folkinshteyn said the following: Hi everyone! I have a que

Re: [R] reorder breaking by half

2008-06-06 Thread Daniel Folkinshteyn
ci = rainbow(7)[c(4:7, 1:3)] on 06/06/2008 01:02 PM avilella said the following: Hi, I want to reorder the colors given by rainbow(7) so that the last half move to the first 4. For example: ci=rainbow(7) ci [1] "#FFFF" "#FFDB00FF" "#49FF00FF" "#00FF92FF" "#0092" "#4900" [7] "#FF

Re: [R] Improving data processing efficiency

2008-06-06 Thread Daniel Folkinshteyn
just in case, uploaded it to the server, you can get the zip file i mentioned here: http://astro.temple.edu/~dfolkins/helplistfiles.zip on 06/06/2008 01:25 PM Daniel Folkinshteyn said the following: i thought since the function code (which i provided in full) was pretty short, it would be

Re: [R] Improving data processing efficiency

2008-06-06 Thread Daniel Folkinshteyn
== end function code=== on 06/06/2008 01:35 PM Gabor Grothendieck said the following: I think the posting guide may not be clear enough and have suggested that it be clarified. Hopefully this better communicates what is required and why in a shorter amount of space: https://stat.ethz.c

Re: [R] Improving data processing efficiency

2008-06-06 Thread Daniel Folkinshteyn
d not far from optimal. If you pick the possibly too small route, then increasing the size in largish junks is much better than adding a row at a time. Pat Daniel Folkinshteyn wrote: thanks for the tip! i'll try that and see how big of a difference that makes... if i am not sure what exactl

Re: [R] editing a data.frame

2008-06-06 Thread Daniel Folkinshteyn
works for me: > sub('1.00', '1', '1.00E-20') [1] "1E-20" remember, according to ?sub, it's sub(pattern, repl, string) try doing it step by step. first, see what yr1bp$TreeTag[1501] is. then, if it's the right data item, see what the output of sub("1.00", "1", yr1bp$TreeTag[1501]) is. that'll l

Re: [R] R + Linux

2008-06-06 Thread Daniel Folkinshteyn
another vote for ubuntu here - works for me, and quite trouble-free. add the r-project repositories, and you're sure to always have the latest, too. (if you don't care for the latest R, you can of course also just get R from the distro's repos as well) on 06/06/2008 05:22 PM Abhijit Dasgupta s

Re: [R] Improving data processing efficiency

2008-06-06 Thread Daniel Folkinshteyn
Burns said the following: That is going to be situation dependent, but if you have a reasonable upper bound, then that will be much easier and not far from optimal. If you pick the possibly too small route, then increasing the size in largish junks is much better than adding a row at a time. Pat D

Re: [R] Improving data processing efficiency

2008-06-06 Thread Daniel Folkinshteyn
t those columns, convert them to a matrix, do all the matching, and then based on some sort of row index retrieve all of the associated columns. -Don At 2:09 PM -0400 6/5/08, Daniel Folkinshteyn wrote: Hi everyone! I have a question about data processing efficiency. My data are as follows: I

Re: [R] Improving data processing efficiency

2008-06-06 Thread Daniel Folkinshteyn
on 06/06/2008 06:55 PM hadley wickham said the following: Why not try profiling? The profr package provides an alternative display that I find more helpful than the default tools: install.packages("profr") library(profr) p <- profr(fcn_create_nonissuing_match_by_quarterssinceissue(...)) plot(p)

Re: [R] Improving data processing efficiency

2008-06-06 Thread Daniel Folkinshteyn
install.packages("profr") library(profr) p <- profr(fcn_create_nonissuing_match_by_quarterssinceissue(...)) plot(p) That should at least help you see where the slow bits are. Hadley so profiling reveals that '[.data.frame' and '[[.data.frame' and '[' are the biggest timesuckers... i suppose

[R] parsing - input buffer overflow

2008-06-13 Thread Daniel Malter
[1]][1:n])==FALSE)) But again, if the text is large, I cannot assign it to x. I'd be grateful for any suggestions. Cheers, Daniel - cuncta stricte discussurus __ R-help@r-project.org mailing list https://stat.ethz.ch/mai

[R] R as chart engine in web-service

2008-06-15 Thread Daniel Cegielka
Hi R-users I think about some web service with stock charts and I plan use python as web framework with R as mathematical and chart engine. I use rpy to connect R with python. It works good. Is it good idea to use R as chart engine? Maybe it's better (faster) to use c/c++ plugin? D

Re: [R] R as chart engine in web-service

2008-06-16 Thread Daniel Cegielka
ge but I haven't tested this yet. R engine is very universal and this is the strong of R choice in this kind of web service... then begin write new (faster?) c/c++ plugin. What you think? daniel cegielka -Original Message- From: jim holtman [mailto:[EMAIL PROTECTED] Sent: Monday,

[R] Inserting a jpeg into an existing widget

2008-06-16 Thread Daniel Zamykal
Does anyone know how to insert a jpeg image into a widget. This is a portion of the code I have used to create the widget. I would like to insert an image in the bottom corner. Cheers tt<-tktoplevel() fontHeading2 <- tkfont.create(family="arial",size=16, slant="italic") fontHeading3 <- tkfont

[R] Capturing coxph warnings and errors

2008-06-17 Thread Daniel Brewer
value etc are set to NA. 2) Suppress the Error and Warning messages What is the best way to do this? Thanks -- ** Daniel Brewer, Ph.D. Institute of Cancer Research Molecular Carcinogenesis Email: [EMAIL PROTECTED

Re: [R] PCA analysis

2008-06-17 Thread Daniel Malter
know whether your problem is solved. Cheers, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Monna Nygård Gesendet: Tuesday, June 17, 2008 5:04 AM An: r-help@r

Re: [R] Capturing coxph warnings and errors

2008-06-18 Thread Daniel Brewer
> Terry Therneau > (author of coxph) > > -- ****** Daniel Brewer, Ph.D. Institute of Cancer Research Molecular Carcinogenesis Email: [EMAIL PROTECTED] ** The Institute of

Re: [R] How can I execute a .R/script file

2008-06-19 Thread Daniel Folkinshteyn
source('yourscript.R') on 06/19/2008 03:11 PM [EMAIL PROTECTED] said the following: Dear R-Users, I've written a number of functions in a .R/script file. I would like to call those functions from another script file. How can I execute all the code in a script file so that the functions are av

Re: [R] PCA analysis

2008-06-19 Thread Daniel Malter
ors > y=x+e ##create Ys > > ###plot > plot(y~x,pch=NA) ##plot Ys against Xs but suppress all symbols (i.e. > plot invisibly) > text(y~x,labels=round(x),pch=NULL) ##use values of X (rounded to its integer > value) as symbols for the X-Y plot > > ###End of example >

Re: [R] I can't see plots

2008-06-22 Thread Daniel Cegielka
Maybe this help you http://www.rforge.net/Cairo/index.html http://www.rosuda.org/R/GDD/ daniel cegielka -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of milton ruser Sent: Sunday, June 22, 2008 5:56 PM To: Josep Lluís Figueras Cc: r-help@r-project.org

Re: [R] problem in R for Linear mixed model~

2008-06-22 Thread Daniel Malter
Hi, random=~1|B/C C is nested in B ##Example data=Oats regress=lme(yield~nitro*Variety,data=Oats,random=~1|Block/Variety) ##i.e. variety is nested in block summary(regress) ##End of example Best, Daniel - cuncta stricte discussurus

Re: [R] Need ideas on how to show spikes in my data and how to code it in R

2008-06-23 Thread Daniel Folkinshteyn
on 06/23/2008 03:40 PM Thomas Frööjd said the following: 1. Shift the mean and std on the reference dataset to the mean and std of my clinic birth weight data. to shift the mean by any distance, just add or subtract that distance from each observation (e.g., to move mean from m1 to m2, t

Re: [R] insert new columns to a matrix

2008-06-24 Thread Daniel Folkinshteyn
just cbind the cols in the appropriate order: m.2 = cbind( m.1[,1:5], yourthreecolumns, m.1[,6:ncol(m.1)] ) on 06/24/2008 07:02 AM Daren Tan said the following: Instead of prepend or append new columns to a matrix, how to insert them to a matrix ? For example, I would like to insert 3 new column

Re: [R] Need ideas on how to show spikes in my data and how to code it in R

2008-06-25 Thread Daniel Folkinshteyn
I don't understand this. Why not just get hist() to plot on the density scale, thereby making its output commensurate with the output of density()? The hist() function will plot on the density scale if you ask it to. Set freq=FALSE (or prob=TRUE) in the call to hist. ehrm

Re: [R] running R-code outside of R

2008-06-25 Thread Daniel Folkinshteyn
If I analyze a client's data using an R script I created then I can charge the client a $20,000 consulting fee, but, if I let the client push the button to execute the R script and charge him 10 cents for the privilege then I can be sued for violating the GPL? Or are my I think you cannot be su

Re: [R] create new column with colnames resulting from paste()

2008-06-26 Thread Daniel Folkinshteyn
no need for a for loop - we can vectorize this: > dt <- data.frame(a = c(1, 2, 3), b = c(3, 2, 2), c = c(1, 3, 5)) > dt a b c 1 1 3 1 2 2 2 3 3 3 2 5 > dt[,paste("test", 1:2, sep="")] = rep(1:2, each=3) > dt a b c test1 test2 1 1 3 1 1 2 2 2 2 3 1 2 3 3 2 5 1 2 on 06

Re: [R] Data matrix of all possible response patterns

2008-06-26 Thread Daniel Folkinshteyn
this is probably a cludge, and there may be a "neater" way to do this, but... here's one: > a = 0:1 > for (i in 1:9){ a= merge(unname(a), 0:1) } > a = t(a) after the for loop, 'a' will contain a 1024 row by 10 col dataframe. putting it through a transpose, gives you the 10 rows by 1024 cols ma

Re: [R] Problems exporting graphs

2008-06-26 Thread Daniel Folkinshteyn
not sure why it doesn't work, but try the following: first, plot to a regular window, then run: > dev.copy(device=png, file="yourfilename.png") > dev.off() see if that produces a file you want. another note: what do you mean you can't just "copy and paste the graph" in ubuntu? doesn't pressing

Re: [R] matching problem

2008-06-27 Thread Daniel Folkinshteyn
this should do what you want: > myexstrings = c("*AAA.AA","BBB BB","*.CCC.","**dd- d") > a = gsub("^\\W*","", myexstrings,perl=T) > b = gsub("\\W.*", "", a, perl=T) > b [1] "AAA" "BBB" "CCC" "dd" first one, removes any non-word characters from the beginning (as you already figured out) second o

Re: [R] R help

2008-06-27 Thread Daniel Folkinshteyn
try this: firstgenes = lapply(geneset, function(x){return(x[1,1])}) firstgenes = do.call(rbind(firstgenes)) on 06/27/2008 10:33 AM Rajasekaramya said the following: Hi, I have a problem in assessing the list element. i have list called geneset it contains the following elements

Re: [R] R help

2008-06-27 Thread Daniel Folkinshteyn
oh, unlist - very nice function, thanks :) on 06/27/2008 11:23 AM Jorge Ivan Velez said the following: Hi Ramya, Try something like this: as.character(unlist(lapply(geneset,function(x) x[1]))) HTH, Jorge On Fri, Jun 27, 2008 at 10:33 AM, Rajasekaramya <[EMAIL PROTECTED]> wrote: Hi, I h

Re: [R] Recoding

2008-06-27 Thread Daniel Folkinshteyn
if there's nothing specific for it, you could probably do it with merge? on 06/27/2008 02:41 PM Agustin Lobo said the following: Hi! Given a vector (or a factor within a df),i.e. v1 <- c(1,1,1,2,3,4,1,10,3) and a dictionary cbind(c(1,2,3),c(1001,1002,1003)) is there a function (on the same lin

Re: [R] Need ideas on how to show spikes in my data and how to code it in R

2008-06-27 Thread Daniel Folkinshteyn
togram but since the audience is not very statistically experienced I would prefer to do it this way. Anyone have an idea? Thanks again for your help. Thomas Fröjd On Wed, Jun 25, 2008 at 6:16 PM, Daniel Folkinshteyn <[EMAIL PROTECTED]> wrote: I don't understand this. Why not

[R] function to export data

2008-06-29 Thread Daniel Pires
ta in it. Can anyone give me some hints on what I’m missing here? I would be very grateful for that. Thanks. Daniel Pires Daniel Pires Faculdade de Ciências da Universidade de Lisboa Dep. Biologia Animal Ed. C2, piso 2 Campo Grande 1749-016 Lisboa Portu

Re: [R] help

2008-06-29 Thread Daniel Malter
Assuming that you have installed and loaded the mclust library, type ?Mclust in the R-prompt. An example is provided there with the popular iris dataset. It seems to be as simple as Mclust(yourdata), where "yourdata" contains the dataset (data columns of your dataset) on which you want to perform c

Re: [R] PCA : Error in eigen(cv,

2008-06-30 Thread Daniel Malter
(importance[2,1,]) ####End of example Best, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Tanya Yatsunenko Gesendet: Monday, June 30, 2008 10:09 PM An: r-help@

Re: [R] PCA : Error in eigen(cv,

2008-07-01 Thread Daniel Malter
o the bootstrapped data, you would have to store the data in an array as well. Cheers, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Tanya Yatsunenko Gesendet: Tuesday,

[R] extracting values from a "by" function

2008-07-05 Thread Daniel Stahl
Hello, I am trying to extract t and pvalues from a 1000 ttests using the by-function but everythinhg I tried did not work. Unfortunately googling "by" is not very helpful. Any help will be very appreciated. Cheers, Danile Stall *creating a data set library(MASS) dataset <- mvrnorm(160, mu, Sig

[R] Problem solved: extracting values from a "by" function

2008-07-05 Thread Daniel Stahl
Hi I just discovered the answer thanks to a previous thread from Peter Daalgart The command is: sapply(test, "[[", "statistic") Cheers, Daniel - Original Message - To: r-help@r-project.org Subject: extracting values from a "by" function Date: Sun, 6 Jul 2

<    5   6   7   8   9   10   11   12   13   14   >