similar to: vectorising ifelse()

Displaying 20 results from an estimated 800 matches similar to: "vectorising ifelse()"

2006 Oct 13
2
bug: Editing function formals deletes the environment
First, here's the specific bug I have. Later I'll say why I care. > ls(zappo) Error in try(name) : object "zappo" not found # good. > f = function(zappo) { function(y) zappo + y } > g = f(1) > g(1) [1] 2 > formals(g) $y > formals(g)$y > formals(g)$y = 2 > g function (y = 2) zappo + y > g(1) Error in g(1) : object "zappo" not found
2009 Nov 10
1
when vectorising does not work: silent function fail?
Dear All, I'm using apply to do some genetic association analysis along a chromosome, with many thousands markers. For each marker the analysis is the same, so I was planning to use apply(chrom, 2, somefunction) In the specific case I do: my.results = apply(chr, 2, function(x){anova(lrm( cpstc.f ~ x + time.cpstc + age + sex + mri))[1,3]}) This is all good and well in theory, but in
2005 Jul 01
2
loop over large dataset
Hi All, I'd like to ask for a few clarifications. I am doing some calculations over some biggish datasets. One has ~ 23000 rows, and 6 columns, the other has ~620000 rows and 6 columns. I am using these datasets to perform a simulation of of haplotype coalescence over a pedigree (the datestes themselves are pedigree information). I created a new dataset (same number of rows as the pedigree
2003 Sep 29
1
Problems with homes after updating to 3.0 (debian)
Hello! After upgrading my sid (debian) to samba-3.0 i cannot connect to my homes-dir. I have the same configuration using with 2.2. I do not know, where is my error. I will send you my smb.conf hopping you can help me [global] panic action = /usr/share/samba/panic-action %d netbios name = zolnott01 workgroup = DROW server string = File- & Printserver Zolnott [%v] syslog = 0
2003 Feb 18
1
problems with ldap tls
Hallo! I have a problem using samba with ldap and tls: starting ldap using slapd -d1 -h "ldaps://0.0.0.0/" Why does not it work? using ldap ssl = no working thanx Here my smb.conf: ldap server = localhost #ldap port = 389 ldap port = 636 ldap suffix = o=zolnott,dc=de ldap admin dn = uid=ldaproot,o=zolnott,dc=de ldap filter =
2005 Jun 20
3
vectorisation suggestion
Hi All, I am counting the number of occurrences of the terms listed in one vector in another vector. My code runs: for( i in 1:length(vector3)){ vector3[i] = sum(1*is.element(vector2, vector1[i])) } where vector1 = vector containing the terms whose occurrences I want to count vector2 = made up of a number of repetitions of all the elements of vector1 vector3 = a vector of NAs that is
2003 Feb 14
1
programs for genetics - haplo.score for R
A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1819 bytes Desc: not available Url : https://stat.ethz.ch/pipermail/r-help/attachments/20030214/7f3adccd/attachment.bin
2006 Mar 24
1
cox model for haplotypes
Hi, Anybody knows a function that can fit haplotype data to a Cox model. I've been searching it in the web without succeed. I use "haplo.stats" package, but unfortunatelly it's not possible to analyse survival data, amb I right?. Thanks in advance. Isaac Subirana (isubirana@imim.es) [[alternative HTML version deleted]]
2009 Jan 22
1
infer haplotypes phasing trios tdthap
Dear R mailing list, I have a dataset with genotypes from trios and I would like to infer haplotypes for each mother, father and child. The package that I could find that can do this is tdthap. But when the mother is homozygous (e.g., 2/2) the haplotype is called as not possible to infer (0); I would prefer for it to call the genotype (2). From what I understand it is doing what I would like
2008 Apr 11
1
EM algorithm for multiple-locus haplotypes frequencies
Hi all, I've been looking in R for an EM algorithm adjusted for multiple-locus haplotypes frequencies, but failed in 100%. Has anyone heard of anything of this kind in R? Thanks in advance, Marcin
2004 Sep 30
1
Vectorising and loop (was Re: optim "a log-likelihood function")
>From: Sundar Dorai-Raj <sundar.dorai-raj at PDF.COM> >Reply-To: sundar.dorai-raj at PDF.COM >To: Zhen Pang <nusbj at hotmail.com> >CC: r-help at stat.math.ethz.ch >Subject: Vectorising and loop (was Re: [R] optim "a log-likelihood >function") >Date: Wed, 29 Sep 2004 18:21:17 -0700 > > > >Zhen Pang wrote: > >> >>I also use
2008 Sep 19
2
Extract method for a new class
Dear list, I am trying to write a package for simulating meioses in R. We defined a class 'haplotype' which contains the basic units of our simulation: setClass("haplotype",representation(snp = "numeric",qtl = "list", hID = "numeric",phID0 = "numeric",phID1 = "numeric"),
2006 Feb 28
4
subsetting a list of matrices
Hi All, I have a list of matrices: > x [,1] [,2] [1,] 1 4 [2,] 2 5 [3,] 3 6 > y [,1] [,2] [,3] [,4] [,5] [,6] [1,] 18 21 24 27 30 33 [2,] 19 22 25 28 31 34 [3,] 20 23 26 29 32 35 > z =list(x,y) I want to create a second list that is has a subset each matrix in the list subsetting so I get the 2nd and 3rd row of each (and
2005 Mar 08
5
removing message: [Previously saved workspace restored]
Dear All, I saved by mistake the environment I was working in after typing q(), and now I get the annoying message: [Previously saved workspace restored] I have already deleted all the objects in the environment, saving it as an empty environment, so it's just a matter of nitpicking I suppose. The message does not appear if I start R from any other place in the directory tree. I am
2011 Jul 08
3
Making a new package: licence
HI All, I have written and succesfully uploaded a new package. The licence it is under is 'GPL' --no version. My assumption is, since all the code is written in R the licence R used for R would affect the code (hence my "GPL" stands for "whatever version of the GPL R is under") I am happy with the licencing I used, but I'd like to ask if there is any transitive
2012 Jan 28
3
logical subsetting, indexes and NAs
Dear All, just a quick example: > x = 1:25 > x[12] = NA > x [1] 1 2 3 4 5 6 7 8 9 10 11 NA 13 14 15 16 17 18 19 20 21 22 23 24 25 > y = x[x<10] > y [1] 1 2 3 4 5 6 7 8 9 NA Is there any way of NOT getting NA for y = x[x<10]? Similarly > y = x[x<15] > y [1] 1 2 3 4 5 6 7 8 9 10 11 NA 13 14 How do I get rid of the NA (not post
2007 Nov 26
4
writing summary() to a text file
Hi All, I would like to output the results of a function into a text file, legible as a such. The function produces a summary quite like: summary(lm(x ~ y + w * z)) [for instance] and I am not clear how to save this summary into a text file 'automagically', because I need to be able to do it in a for() loop. Cheers, Federico -- Federico C. F. Calboli Department of Epidemiology
2009 Nov 13
4
R, NIH and FDA
Dear All, I will soon be working with NIH and possibly FDA. Will I be able to use R or will I be forced to use SAS? Cheers, Federico -- Federico C. F. Calboli Department of Epidemiology and Public Health Imperial College, St. Mary's Campus Norfolk Place, London W2 1PG Tel +44 (0)20 75941602 Fax +44 (0)20 75943193 f.calboli [.a.t] imperial.ac.uk f.calboli [.a.t] gmail.com
2006 Sep 26
5
putting stuff into bins...
Hi All, I have a vector of data, a vector of bin breakpoints and I want to put my data in the bins and then extract fanciful informations like the mean value of each bin. I know I can write my own function, but I would have thought that R should have somewhere a function that took as arguments something like (data, breaks, what to do with the data in the bins). I surey could not find it
2004 Jan 20
4
matrix exponential: M^0
> -----Original Message----- > From: Federico Calboli > Sent: Tuesday, January 20, 2004 5:40 PM > To: r-help > Subject: [R] matrix exponential: M^0 > > I would like to ask why the zeroeth power of a matrix gives me a matrix > of ones rather than the identity matrix: > > > D<-rbind(c(0,0,0),c(0,0,0),c(0,0,0)) > > D<-as.matrix(D) > > D >