[R] Fast reading of hex data?

2012-05-08 Thread Fang
Hi all, Basically, I have data in the format of (up to 1 gig in size) text files containing stuff like: F34060F81000F28055F8A000F2E05EF8F000F34 (...) The data is basically strings denoting hex values (9 = 9, A = 10, B = 11, ...) organised in fixed, small blocks. What I want to do is to read in a

Re: [R] How to plot PCA output?

2012-05-08 Thread Fang
I think the question on your mind should be: 'what do I want to do with this plot'? Just producing output from the PCA is easy - plotting the output$sd is probably quite informative. From the sounds of it, though, you want to do clustering with the PCA component loadings? (Since that's mostly what

[R] [R-pkgs] Announcing XGR

2016-12-15 Thread Hai Fang
ts web app, XGR is able to provide a user-friendly tool for exploring genomic relations at the gene, SNP and genomic region level. Best regards, Dr Hai Fang Wellcome Trust Centre for Human Genetics University of Oxford Roosevelt Drive Headington Oxford OX3 7BN [[alternative HTML versi

[R] Want help on data resampling!

2009-11-18 Thread ke fang
Dear all. I have a data matrix that each row containing a specific individual's information including individual observation and properties. I'm trying to use R to create some bootstrap samples with this data matrix. I have tried the boot() function in boot package, but it seems that this fu

[R] Binary operators in packages and documentation?

2009-11-25 Thread Zhou Fang
the NAMESPACE file, right? The question I was wondering was what the appropriate way to document this operator is. i.e. What should I put in the \usage section, etc? 'Writing R Extensions' doesn't seem to see much about this, but maybe I'm m

[R] Replace is leaking?

2009-05-27 Thread Zhou Fang
ested in a R workspace to reproduce this, email me. This is running in R 2.9. Zhou Fang __ 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 provi

Re: [R] Replace is leaking?

2009-05-27 Thread Zhou Fang
Oh hang on, I've figured it out. Rounding error, doh. Somewhere along the line I got lazy and took the weighted average of two values that are equal. as.integer truncates, so, yeah. Never mind. Zhou Fang __ R-help@r-project.org mailing list

[R] Scaled MPSE as a test for regressors?

2009-03-23 Thread Zhou Fang
to me. You get a number between zero and one out of it, with 1 the solution for constant fits. Anyone seen anything like this, or know anything about properties? Has it got a name? Zhou Fang __ R-help@r-project.org mailing list https://stat.ethz.

[R] [R-pkgs] Package 'dnet' for omics data integrative analysis

2014-05-26 Thread Hai Fang
oduce them individual topics in the form of FAQs (http://dnet.r-forge.r-project.org/faqs.html). Enjoy it! Hai Fang, Ph.D. >From Prof. Gough's Group (http://bioinformatics.bris.ac.uk) Department of Computer Science Univeristy of Bristol Bristol, United Kingdom hf...@cs.bris.ac.uk http:/

[R] How to make LN(x) transformation in R?

2013-09-27 Thread Xiao Fang
Dear R colleagues, I am a newbie to R. I can not figure out how to compute Ln(x) value in R. My question may be so easy for you but I will really appreciate if you can help me. Thanks so much for your time! Kathy [[alternative HTML version deleted]]

[R] how to convert a set of strings to a list of unique numeric id?

2010-06-20 Thread G FANG
Hi, I have been a matlab user and is learning R. I want to convert a large list of strings to a list of unique numeric ids to reduce storage space. For example, there is a string list (there are duplicates) ABC ACCDEDF ACCGEDF ACCGEGF . ACCDEDF ACCGEGF and I want to have a correspondi

[R] how to efficiently compute set unique?

2010-06-21 Thread G FANG
Hi, I want to get the unique set from a large numeric k by 1 vector, k is in tens of millions when I used the matlab function unique, it takes less than 10 secs but when I tried to use the unique in R with similar CPU and memory, it is not done in minutes I am wondering, am I using the function

Re: [R] how to efficiently compute set unique?

2010-06-22 Thread G FANG
> On Jun 21, 2010, at 9:18 PM, Duncan Murdoch wrote: >> >>> On 21/06/2010 9:06 PM, G FANG wrote: >>>> >>>> Hi, >>>> >>>> I want to get the unique set from a large numeric k by 1 vector, k is >>>> in tens of millions >&

[R] how to group a large list of strings into categories based on string similarity?

2010-06-23 Thread G FANG
Hi, I want to group a large list (20 million) of strings into categories based on string similarity? The specific problem is: given a list of DNA sequence as below ACTCCCGCCGTTCGCGCGCAGCATGATCCTG ACTCCCGCCGTTCGCGCGC CAGGATCATGCTGCGCGCGAACGGCGGGAGT CAGGATCATGCTGCGCGCGAANN CAGG

Re: [R] how to group a large list of strings into categories based on string similarity?

2010-06-26 Thread G FANG
7;s, i.e. without considering N, which strings are the same. But actually, the match I planned is position-to-position match, i.e. 1st and 2nd strings are the same except for the N's So, the expected output is 1 1 2 2 3 2 4 Please advice. Thanks! --gang On Wed, Jun 23, 2010 at 7:55 PM, Ma

[R] Get the indices of non-zero entries of a sparse matrix in R

2010-07-06 Thread G FANG
Hi, I am trying to get the indices of non-zero entries of a sparse matrix in R sr d 1 1089 3772 1 2 1109 190 1 3 1109 2460 1 4 1109 3071 1 5 1109 3618 1 6 1109 38 1 I found that the following can create a sparse matrix, library(Matrix) Y <- sparseMatrix(s,r,x=d) but have not idea a

[R] what does SEXP in R internals stand for

2010-11-13 Thread John Fang
Hi all, Is there any one that would give an explanation on the abbreviation SEXP used in R internals to represent a pointer to a data structure? Thanks! Best wishes, John [[alternative HTML version deleted]] __ R-help@r-project.org mailing li

Re: [R] what does SEXP in R internals stand for

2010-11-13 Thread John Fang
Thank you! Best wishes, John 2010/11/13 Alexx Hardt > Am 13.11.2010 14:50, schrieb John Fang: > > Hi all, >> >> Is there any one that would give an explanation on the abbreviation SEXP >> used in R internals to represent a pointer to a data structure? >> &

[R] msvcr80.dll is missing

2011-04-27 Thread Fang, Yongxiang
Dear All, I run R on a windows 7 machine and it has been worked very well. I installed Graphvis 2.20.3 and Rgraphviz. recently, however, I cannot load the Rgraphviz package and error message popped up The message shown on the pop up window with the title: R Consol: Rgui.exe - Sysytem error Th

[R] setMethod does not work in Window 7??

2010-06-03 Thread Fang, Jianwen
I am developing a S4 class but have had trouble to make setMethod work in Window 7. I tested an example found in the setMethod manual: > require(graphics) > setMethod("plot", signature(x="track", y="missing"), + function(x, y, ...) plot(slot(x, "x"), slot(x, "y"), ...) + ) It gave

[R] Spatstat - envelope, Thomas process and Cramer-von Mises

2011-02-14 Thread Jeff Fang
Hi all, I am using "spatstat" to investigate the spatial structure of some plant populations, and I want to detect these patters with IPP and a Thomas process based on pair-correlation function. I know the function "pcfinhom" is available to characterize the IPP, but I have no idea about how to us

[R] How to detect the spatial point pattern with Thomas process based on pcf

2011-02-19 Thread Jeff Fang
Hi all, I am using "spatstat" to investigate the spatial structure of some plant populations, but I have no idea about detecting the spatial point pattern with Thomas process based on pcf. Additionally, generating simulation envelope using this null model is another problem for me. I am not very f

[R] Which function in R package "Spatstat" can help me to get the Cramer-von Mises statistic

2011-02-22 Thread Jeff Fang
Hi all, When I detect the spatial point pattern, I want to use the Cramer-von Mises statistic to assess the curve-wise significance of deviations from null hypotheses. Who can tell me which function in R package "Spatstat" can do this work? Thanks a lot Jeff [[alternative HTML version

[R] Problem in simulating envelopes with R package "Spatstat"

2011-02-27 Thread Jeff Fang
Hi all, While useing the R package "Spatstat" to detect the spatial point pattern of my data, I met a problem. When I computes simulation envelopes with a fitted point process model: Poisson cluster (Thomas) process (kappa=2.751010e-05; sigma=5.634274e+01; mu=4.943639e+02), I cannot get the high

[R] Question about Chi-squared test

2011-03-04 Thread Jeff Fang
Hi all, I know Chi-squared test can be done with the frequency data by R function "chisq.test()", but I am not sure if it can be applied to the percentage data ? The example of my data is as follow: # KSL MHL MWS CLGC

[R] Question in Chi-squared test, can I do it with percentage data?

2011-03-04 Thread Jeff Fang
Hi all, I know Chi-squared test can be done with the frequency data by R function "chisq.test()", but I am not sure if it can be applied to the percentage data ? The example of my data is as follow: # KSL MHL MWS CLGC

Re: [R] What is the most cost effective hardware for R?

2012-05-08 Thread Zhou Fang
How many data points do you have? -- View this message in context: http://r.789695.n4.nabble.com/What-is-the-most-cost-effective-hardware-for-R-tp4617155p4617187.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mail

[R] Seek() on windows - safe use cases?

2012-05-08 Thread Zhou Fang
So, I'm maintaining some else's code, which is as always, a fun thing. One feature of this code is the use of the 'seek' command. In ?seek: We have found so many errors in the Windows implementation of file positioning that users are advised to use it only at their own risk, and

Re: [R] registry vulnerabilities in R

2012-05-10 Thread Zhou Fang
What about using a Portable Apps style packaging of R? That might solve some of the issues. -- View this message in context: http://r.789695.n4.nabble.com/registry-vulnerabilities-in-R-tp4619217p4623388.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] Remove a number from a vector

2012-05-11 Thread Zhou Fang
Better yet, remove the which altogether, and it'll run a slight bit faster and maybe look a little neater. x <- x[x!="bobo"] -- View this message in context: http://r.789695.n4.nabble.com/Remove-a-number-from-a-vector-tp851865p4626413.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] “For” calculation is so slow

2012-05-22 Thread Zhou Fang
For loops are really, really slow in R. In general, you want to avoid them like the plague. If you absolutely must insist on using them in large, computationally intense and complex code, consider implementing the relevant parts in C, say, and calling that from R. Staying within R, you can probabl

Re: [R] “For” calculation is so slow

2012-05-22 Thread Zhou Fang
I'm not sure what you are trying to prove with that example - the loopless versions are massively faster, no? I don't disagree that loops are sometimes unavoidable, and I suppose sometimes loops can be faster when the non-loop version e.g. breaks your memory budget, or performs tons of needless co

Re: [R] Could "incomplete final line found" be more serious than a warning?

2012-05-22 Thread Zhou Fang
If you look at the new file in raw mode, you'll see that it's chock full of ASCII nuls, while the old file has none. This is probably what's giving you the problems, because R does not allow strings containing embedded nul characters. (I believe this is because Nul in strings is pretty dangerous in

[R] Looping over subsets

2008-01-19 Thread Z. Fang
subset size is likely small, though), so things like combn don't seem to be a good solution. The biggest concern is keeping memory usage sane, but processing time is also fairly important. Any ideas? Zhou Fang __ R-help@r-project.org mailing

[R] Inserting blank lines into a file

2008-10-22 Thread Zhou Fang
Hi, Should be a quickie: I want to make a datafile in R for plotting in gnuplot (which has friendlier 3D plotting options, as far as I can tell). So, I want to create a file with contents along the lines of #File begins 0 0 10 0 13 10 0.2 2 10 1 0 10.12 1 1 5 1 2 10 2 0 10 2 1 1 2 2 10 It's p

[R] Loading workspaces from the command line

2009-01-12 Thread Zhou Fang
ates), but I'm wondering if there's a better way. Zhou Fang __ 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 comm

Re: [R] Loading workspaces from the command line

2009-01-12 Thread Zhou Fang
te: > See ?load > > On Mon, Jan 12, 2009 at 10:12 AM, Zhou Fang wrote: >> >> Hi, >> >> Is there any way to load workspaces (e.g. stuff from save.image) from >> the command line? I'm on Linux, and would find this very helpful. >> >> I'm gue

Re: [R] Loading workspaces from the command line

2009-01-12 Thread Zhou Fang
; > -- David Winsemius > > On Jan 12, 2009, at 7:24 AM, Zhou Fang wrote: > >> That's not really what I meant by 'command line'. I meant, well, >> loading from e.g. a bash shell, not from within an interactive R >> session itself. >> >>

Re: [R] Loading workspaces from the command line

2009-01-12 Thread Zhou Fang
t you wish to work on and start R normally. > No code is needed. > > On Mon, Jan 12, 2009 at 10:04 AM, Zhou Fang wrote: >> Ok, looks like I can do what I want with --args, commandArgs() and an >> appropiate .First. >> >> Thanks, >> >> Zhou >> >

[R] Pausing processing into an interactive session

2009-01-26 Thread Zhou Fang
Hi all, As a possibly silly request, is it possible to interactively pause a R-calculation and do a browser(), say, without browser or other debug handlers being explicitly included in the code? Imagine the following situation: You write up a big calculation for R to calculate. We are talking ho

Re: [R] How to compare two regression line slopes

2009-01-27 Thread Zhou Fang
raphs. The downside is that you might get lured into complacency... Zhou Fang PS: Your model equation isn't right. In both, we are also allowing the intercept to vary between groups. So really you want y = c + D.b0 + b1.x + D.b2.x __ R-help@r-proj

Re: [R] How to compare two regression line slopes

2009-01-27 Thread Zhou Fang
raphs. The downside is that you might get lured into complacency... Zhou Fang PS: Your model equation isn't right. In both, we are also allowing the intercept to vary between groups. So really you want y = c + D.b0 + b1.x + D.b2.x __ R-help@r-proj

Re: [R] for/if loop

2009-01-28 Thread Zhou Fang
What are you trying to do with > for (pp in 1:pp+1){ ? Also, note that 1:rr+1 and 1:(rr+1) mean different things. Zhou __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-proj

[R] Finding a basis in a set of vectors

2009-02-06 Thread Zhou Fang
have the QR decomposition of the original X 'for free'. I know that it's possible to do this directly by looping over the columns and adding them, but at the very least, a solution without horrible slow loops would be nice. Any ideas welc

Re: [R] Finding a basis in a set of vectors

2009-02-06 Thread Zhou Fang
Ah ha, that does work. What do you mean it isn't robust, though? I mean, obviously linear dependency structures in general are not stable under small perturbations...? Or is it that it's platform dependent? Zhou On Fri, Feb 6, 2009 at 2:28 PM, Peter Dalgaard wrote: > Zhou Fang

[R] Fast ave for sorted data?

2009-02-15 Thread Zhou Fang
very slow, and certainly not suited to my problem, where Y changes and X stays the same and I need to repeatedly recalculate the averaging of Y. Ave also does not take take advantage of the sorting of the data. So, is there an alternative? (Presumeably avoiding loops.) Thanks,

Re: [R] Fast ave for sorted data?

2009-02-15 Thread Zhou Fang
Thanks! That does exactly what I want. (Heck, maybe this should be included as a default sorted alternative to ave.) I was thinking of doing it another way using cumsums, but maybe this method is faster. Zhou __ R-help@r-project.org mailing list https:

[R] Bias correction for random forests?

2009-03-11 Thread Zhou Fang
n' actually does? Or what the justification for it is? Or when it would be necessary? Is there a paper I can look at? And is the feature likely to emerge from 'experimental' any time soon? Zhou Fang __ R-help@r-project.org mailin

[R] How to find "p"(proportion) in binomial(n, p)?

2007-09-20 Thread fang liu
Hi, I got a problem. I am trying to find "p" in binomial. X~bin(n, p) I want to find value "p", so that Pr(X <= k) <= alpha. Here, n, k are known. Thank you for helping me with this! Catherine _ [[replacing trailing spam]] ___

Re: [R] Time series graphs, question about using zoo

2007-09-20 Thread fang liu
Hi, Can you tell me what is the meaning for "tail, 1" in "aggregate"? I also want to get some similar graph, but the data is not time series data. Suppose here is my data one, I want a graph with x-axis is just the index(1:9). The graph plot all the variable A, B,C,D. So there should be 4 lines f

[R] Question on Binom.Confint

2018-09-13 Thread Guo, Fang (Associate)
Hi, I have a question with the function Binom.Confint(x,n,"method"=lrt). For likelihood ratio test, I'd like to ask how you define the upper limit when the frequency of successes is zero. Thanks! Fang Guo Associate CORNERSTONE RESEARCH 699 Boylston Street, 5th Floor Boston

Re: [R] [FORGED] Question on Binom.Confint

2018-09-14 Thread Guo, Fang (Associate)
It's method="lrt" and I used the "binom" package. -Original Message- From: Rolf Turner [mailto:r.tur...@auckland.ac.nz] Sent: Thursday, September 13, 2018 10:02 PM To: Guo, Fang (Associate) Cc: r-help@R-project.org Subject: Re: [FORGED] [R] Question on Binom.C

Re: [R] Question on Binom.Confint

2018-09-14 Thread Guo, Fang (Associate)
I used library(binom). -Original Message- From: Bert Gunter [mailto:bgunter.4...@gmail.com] Sent: Thursday, September 13, 2018 10:04 PM To: Guo, Fang (Associate) Cc: r-help-requ...@r-project.org; R-help Subject: Re: [R] Question on Binom.Confint In what package? Binomial confidence

Re: [R] Question on Binom.Confint

2018-09-14 Thread Guo, Fang (Associate)
I did use library(binom). However, I was able to use the method "lrt" which is short for likelihood ratio test. -Original Message- From: Jim Lemon [mailto:drjimle...@gmail.com] Sent: Thursday, September 13, 2018 11:50 PM To: Guo, Fang (Associate) ; r-help mailing list Subje

[R] extract day or month as in Splus

2009-10-23 Thread Fang (Betty) Yang
Dear all, I am writing to ask for help to find R code to do the same thing as the following Splus code: dates <- c("02/27/1992", "02/27/1992", "01/14/1992", "02/28/1992", "02/01/1992") timeDate(as.character(dates),in.format="%m/%d/%Y","%a") [1] Thu Thu Tue Fri Sat Could anyone give me

[R] problems with read.csv

2009-11-02 Thread Fang (Betty) Yang
Dear all, I'd like to ask help on R code to get the same results as the following Splus code: >indata<-importData("/home/data_new.csv") >indata[1:5,4] [1] 0930 1601 1006 1032 1020 I tried the following R code: > indata<-read.csv("/home/data_new.csv") > indata[1:5,4] [1] 9

[R] keep empty subsets using aggregate

2009-11-24 Thread Fang (Betty) Yang
Dear all, I am struggling with a small problem. By using aggregate, the empty subsets are removed. I need each empty subset to be 0. Any suggestions will be appreciated. Code: edref = aggregate(rep(1,times=dim(eds)[1]),list(eds[,11], eds[,7], eds[,27]), sum) Thanks in advance,

[R] sum a particular column by group

2010-02-05 Thread Fang (Betty) Yang
Dear all, I have a table like this: > eds R.ID Region Gender Agegr Time nvisits 11 A F 60--64 1:00 1 22 OF 55--591:20 1 33 OF 55--59 3:45 3 44 S

Re: [R] sum a particular column by group

2010-02-05 Thread Fang (Betty) Yang
Thanks for your help. Finally, I got it. From: Dennis Murphy [mailto:djmu...@gmail.com] Sent: Friday, February 05, 2010 12:20 PM To: Fang (Betty) Yang Cc: r-help@r-project.org Subject: Re: [R] sum a particular column by group Hi: This is not an elegant solution by any means, but it gets

[R] using Statistics::R

2010-12-11 Thread Yi-Fang Liu
Hi,ALL I want to use R in Perl, the Statistics::R module is great but I meet the problem: I don`g know how to pass one array from Perl to R, can anyone show me? Any suggestion will be appreciate~ Thank you! [[alternative HTML version deleted]] __