similar to: Counting Frequencies in Data Frame

Displaying 20 results from an estimated 30000 matches similar to: "Counting Frequencies in Data Frame"

2006 Jul 26
2
String frequencies in rows
Hi All, I’m trying to evaluate the frequency of different strings in each row of a data.frame : INPUT: ID G1 G2 G3 G4 … GN 1 AA BB AB AB … 2 BB AB AB AA … 3 AC CC AC AA … 4 BB BB BB BB… The number of different strings can vary in each row. My solution has been: for (i in 1:length(INPUT[,1])){ b=as.data.frame(table(t((INPUT[i,2:5])))) <some operations using the string values and
2013 Apr 29
3
rbinding some elements from a list and obtain another list
Hi everybody, I have a list, where every element of this list is a data frame. An example: Mylist<-list(A=data.frame, B=data.frame, C=data.frame, D=data.frame) I want to rbind some elements of this list. As an example: Output<-list(AB=data.frame, CD=data.frame) Where AB=rbind(A,B) CD=rbind(C,D) I’ve tried: f<-function(x){ for (i in
2013 Mar 11
2
how to convert a data.frame to tree structure object such as dendrogram
I have a data.frame object like: > data.frame(x=c('A','A','B','B'), y=c('Ab','Ac','Ba','Bd')) x y 1 A Ab 2 A Ac 3 B Ba 4 B Bd how could I create a tree structure object like this: |---Ab A---| _| |---Ac | | |---Ba B---| |---Bb Thanks, Zech [[alternative HTML version deleted]]
2012 Feb 11
3
Counting occurences of variables in a dataframe
Hi everybody, I have a large dataframe similar to this one: knames <-c('ab', 'aa', 'ac', 'ad', 'ab', 'ac', 'aa', 'ad','ae', 'af') kdate <- as.Date( c('20111001', '20111102', '20101001', '20100315', '20101201', '20110105', '20101001', '20110504',
2012 May 16
2
Help needed for efficient way to loop through rows and columns
Dear R-helpers: I am trying to write a script that iterates through a dataframe that looks like this: Example dataset called "sample": names <- c("S1", "S2", "S3", "S4") X <- c("BB", "AB", "AB", "AA") Y <- c("BB", "BB", "AB", "AA") Z <- c("BB",
2005 Jun 24
5
Memory limits using read.table on Windows XP Pro
Hello, When I try: geno <-read.table("2500.geno.tab",header=TRUE,sep="\t",na.strings=".",quote=" ",comment.char="",colClasses=c("factor"),nrows=2501) I get, after hour(s) of work: Error: cannot allocate vector of size 9 Kb I have: Rgui.exe --max-mem-size=3Gb and multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft
2012 Jul 11
2
help with merging 2 data frames
Dear R-ers, I feel I am close, but can't get it quite right. Thanks a lot for your help! Dimitri # I have 2 data frames: x<-data.frame(a=c("aa","aa","ab","ab","ba","ba","bb","bb"),b=c(1:2,1:2,1:2,1:2),d=c(10,20,30,40,50,60,70,80))
2017 Aug 25
2
retrieve machine password in current Samba?
We have a wireless network that uses 802.1x authentication, in which domain joined computers use their machine credentials to connect. Windows machines do this automatically, and until recently Linux computers could join using wicd, wpa-supplicant, and a simple script that would retrieve the machine password with tdbdump. ( specifically tdbdump -k SECRETS/MACHINE_PASSWORD/DOMAIN
2010 Apr 30
1
How to generate a distance matrix?
Hi, I'm trying to generate a distance matrix between sample pairs (example below). I'm not very familiar with the loop command which I expect I will need for this. The example below demosntrates what I'd like to get out of the data - essentially, to calculate the proportion of positions where two samples differ. Any help much appreciated! Also, any notes on how the functions work
2007 Aug 24
3
Merging two files together in R
Hi, Thanks in advance for reading this post. I received some affymetrix genotyping data back recently (250K, Nsp array)…However, in order for me to do any analysis on this data set, I need to add append the annotation file to it. Basically I want to do something that looks like this: Snpfile(tab delimited): SNPID Genotype X Y 123 AA 13.4 1.2
2009 Sep 11
1
help in matching two column vectors
Dear list, I have a long list of two vectors with some matching elements. I would like to line them up in two columns and have an NA in those positions of the second vector where a match is absent. With a simple example, I will explain my problem. (a<-1:6) (b<-c(5,2)) (m1<-match(a,b)) (ab<-cbind(a,m1)) m2<-numeric(length(m1)) for (i in 1:length(m1))
2014 Mar 07
4
Cannot chain to another PXE server on the same subnet
On Fri, Mar 7, 2014 at 2:33 AM, Vieri <rentorbuy at yahoo.com> wrote: > So I take it it's more of a DHCP hack in which: > 1- client boots and gets DHCP response from 10.215.144.7 with PXE syslinux info > 2- client loads pxelinux.0 menu and selects menu that chains to Altiris PXE menu except, instead of calling pxechain.com or pxechn.c32 with the Altiris server's IP address,
2007 Dec 13
4
Very simple question on plot
Hi, I try to make a plot like this: Y | | | o | o o | o o | o o |o o o |-------------------------------- 0 10 20 30 40 50 60 70 80 90 100 (A) 100 90 80 70 60 50 40 30 20 10 0 (B) or B 100 90 80 70 60 50 40 30 20 10 0 Y |-------------------------------- | | o
2015 Nov 11
4
Problema con la lectura de datos
Has probado con cor(datos,use="pairwise.complete.obs") ??? > From: valeagui en outlook.es > To: cof en qualityexcellence.es; r-help-es en r-project.org > Date: Wed, 11 Nov 2015 15:13:55 +0000 > Subject: Re: [R-es] Problema con la lectura de datos > > Hola Carlos, muchas gracias....pero hago exactamente lo mismo que tu..y al intentar de hacer la matriz de
2015 Nov 11
2
Problema con la lectura de datos
?Hola, A mí me funciona la importación directa. Previamente he guardado la hoja de Excel en .csv (separado por ";"). Y hago sin problemas la correlación entre dos variables (las dos primeras). > datIn <- read.csv("Variables.csv", header=T, as.is=T, sep=";", dec=",") > head(datIn) EMPRESAS AA AB AC AD AE AF AG AH AI
2009 Feb 04
7
counting entries in vector
Hi all, I've a vector with entries, which are all of the same type, e.g. string: k <- c("bb", "bb", "bb", "aa", "cc", "cc") and want to create a second vector containing the number of each entry in k in the same order as in k, i.e. c(3, 1, 2) or: k <- c(5,5,5,5,2,2,4) => c(4,2,1) thanks
2008 Aug 31
4
give all combinations
Hello,   is there a simple way to give all combinations for a given vector:   v<-c("a","b","c")   combination(v,v) becomes "aa","ab","ac","bb","bc","cc'   combination(v,v,v) becomes "aaa","aab","aac","abb",......     [[alternative HTML version deleted]]
2011 Oct 08
1
HWEBayes, swapping the homozygotes genotype frequencies
I evaluated the Bayes factor in the k=2 allele case with a "triangular" prior under the null as in the example in the help file: HWETriangBF2(nvec=c(88,10,2)) [1] 0.4580336 When I swap the n11 entry and n22 entry of nvec, I received totally different Bayes factor: > > HWETriangBF2(nvec=c(2,10,88)) [1] 5.710153 > In my understanding, defining the genotype frequency as
2018 Jan 08
2
Replace NAs in split lists
Thank you Jeff. Your code works, as usual , perfectly. I am just wondering why if i put the whole code in one line, i get an error message. sdf2 <- lapply( sdf, function(z){z$Value <-ifelse(is.na(z$Value),z$Value[!is.na(z$Value)][1],z$Value)z}) error. unexpected symbol in sdf2 Thanks again EK On Mon, Jan 8, 2018 at 3:12 AM, Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote: >
2006 Aug 01
4
Overlay Boxplot with scatter plot
I am trying to make a box plot and overlay it with a scatter plot from another data.frame. I was able to successfully create the boxplot, but when i tried using points(x~y...) the dots did not show up. example code aa<-(300,300,300,300,600,600,600,600,900,900,900,900) bb<-(13,12,14,11,56,44,34,75,22.,34,22,98,59,55,56) cc<-(13,12,14,11,56,44,34,75,22.,34,22,98,59,55,56)