search for: table2

Displaying 20 results from an estimated 98 matches for "table2".

Did you mean: table
2010 Oct 21
2
Adding rows to column
I'm new to R. I'm extracting important columns from single table using following code: File2<-"file.txt" table2<- read.delim(File2, skip=19, sep=";", header=F, na.strings=NA, fill=T) #extracting column 7 where rows match "ID" col1<- table2[grep("ID", table2[,1]),7] #similarly extracting column 9,11,13,15 col2<- table2[grep("ID", table2[,1]),9] col3<- table2...
2012 Jan 03
1
sqldf and not converting integers to floating point in SQLite
..._SPREAD A|24.5 B|24.5 C|100 D|50 I can achieve this with a nested SQL query (through counting the number of POSTAL that belong to any given INSEE, and diving the value of the postal in that INSEE by that number). library(sqldf) table1 <- read.csv("c:/R/table1.csv", sep=";") table2 <- read.csv("c:/R/table2.csv", sep=";") table3 <- sqldf("select table2.INSEE, table1.VALUE / counts.nPostals as value_spread from table1, table2,(select POSTAL, count(INSEE) as nPostals from table2 group by POSTAL) counts where table1.POSTAL = counts.POSTAL and table1...
2006 Feb 28
2
Need help with a Power Find()
I was hoping someone would be able to help me with creating a method. I have two tables. What I am trying to do is create a list of all the id''s from table2 that aren''t currently referenced by Table1''s address_id column. That way, when I create a new customer I can have a drop down list in the view of all the addresses that are not currently being used. ##### Database ##### Table1 id name address_id Table2 id address ##### Models #...
2011 Dec 08
1
prop.test() and the simultaneous confidence interval for multiple proportions in R
...approximation may be incorrect I don't understand where I can deduct that Condition1 is more preferred than Conditions 2 and 3. Should I simply look at the p-value? The fact is that tried with a more extreme example, but the p-value results still above 0.05: This is the table I used: > table2 Condition1 Condition2 stimulusA 12 0 stimulusB 10 2 stimulusC 11 1 > table2<-matrix(c(12,0,10,2,11,1),ncol=2,byrow=T) > rownames(table2)<-c("stimulusA","stimulusB","stimulusC") > colnames...
2005 Aug 09
1
Adding Functionality to stat.table in Epi
...function for the sd (and included it as an options) but it just won't work. (I tried sending messages to the Epi mailing list after subscribing but my mail is always returned. I don't have the exact error messages at the moment or I would post them.) Even if I just copy stat.table to stat.table2 and try to run stat.table2, I get: > stat.table2(index=list(race,gender),list(count(),percent(race)),margins=TRUE) Error: couldn't find function "array.subset" I can't find any "array.subset" function, yet the original stat.table works just fine. I've copied ot...
2008 Dec 17
4
passing arguments to subset from a function
...ments of said function to allow me to adapt the way I do this. Among other things, I want my function to have an argument which I will pass on to subset() somewhere inside my function. Here is a quick and simplified example with the iris dataset. myfunction<-function(table, extraction) { table2<-subset(table, extraction) return(table2) } myfunction(iris, extraction= Species=="setosa") ############## end What I would like is for this function to return exactly the same thing as : subset(iris, Species=="setosa") Thanks for your help. Regards, David Go...
2011 Jul 08
0
homogenized cells problem with IF
...able$mes=substr(table[[3]],5,6) table$day=substr(table[[3]],7,8) table=subset(table,table$V3>="20000101" & table$V3<="20101231") table$year<-as.numeric(table$year) table$mes<-as.numeric(table$mes) table$day<-as.numeric(table$day) for (anyo in 2000:2010){ table2=subset(table,table$year==anyo) ndias=length(table2$year) if(ndias<365){ for (ms in 1:12){ table2=subset(table2,table2$mes==ms) ndays=length(table2$year) a<-(anyo==2000 | anyo==2004 | anyo==2008...
2013 May 01
1
Combine multiple tables into one
Hi, May be this helps: dat1<- as.data.frame(table1) ?dat2<- as.data.frame(table2) names(dat2)<-c("V3","V4") library(plyr) res<-join(dat1,dat2,type="full") ?res[is.na(res)]<- 0 ?res #? V1 V2 V3 V4 #1? 1? 1? 0? 0 #2? 1? 2? 0? 0 #3? 0? 0? 0? 1 #4? 0? 0? 0? 4 ?combinedtable<-as.matrix(res) ?colnames(combinedtable)<- NULL ?combinedtable #...
2011 Aug 16
1
getting names of dimnames of xtabs into xtable latex output
In R, the output of xtabs displays the names of the dimnames. In the example below, these are "change_diet" and "mydiet". Is there a way to have xtable incorporate these names directly into the latex output. Thanks for your help. table2 <- structure(c(26, 0, 40, 0, 10, 0, 188, 0, 281, 0), .Dim = c(5L, 2L), .Dimnames = structure(list(change_diet = c("Don't know", "Somewhat likely", "Somewhat unlikely", "Very likely", "Very unlikely" ), mydiet = c("0", "1")...
2005 Dec 15
3
<no subject>
...eriment. My problem is that I have independent list from different source and I would like to plot the pair of value using a common key. As in this simplified version: table1 = list(CGID=c("CG_1","CG_3","CG_2", "CG_4", "CG_5"), diff=c(3,5,6,4,3)) table2 = list(CGID=c("CG_2","CG_3","CG_4", "CG_1", "CG_5"), diff=c(4,6,3,9,10)) How can link the two table trough the CGIDC column and plot the data from the 2 tables. Many tx Marco Blanchette, Ph.D. mblanche at berkeley.edu Donald C. Rio's lab De...
2004 Sep 23
0
two internet connections don''t appear to be masqing
I have a script for dual internet connections that does this: ------------------------- #!/bin/bash IF1=eth1 IP1=203.219.190.106 P1=203.219.190.105 P1_NET=203.219.190.104 IF2=eth2 IP2=220.245.224.46 P2=220.245.224.45 P2_NET=220.245.224.44 IF0=eth0 P0_net=192.168.0.0 TABLE1=inet1 TABLE2=inet2 ip route add $P1_NET dev $IF1 src $IP1 table $TABLE1 ip route add default via $P1 table $TABLE1 ip route add $P2_NET dev $IF2 src $IP2 table $TABLE2 ip route add default via $P2 table $TABLE2 ip route add $P1_NET dev $IF1 src $IP1 ip route add $P2_NET dev $IF2 src $IP2 # preference for de...
2002 Jul 12
2
Crosstabs in R
Before I reinvent the wheel, I have need for a relatively straightforward crosstabulation (2 x n) function. I know that R has table(), ftable(), xtabs(), and summary(xtabs()), but none of these produce a fully "tricked" out cross-tabulation with marginal totals, expected cell frequencies, and an array of statistics about the contingency table. Is there a more complete (something
2006 Feb 19
1
One Model from two Tables with no foreign keys
I would like to create a model that is based on two database tables: Table1 --------- id (PK) data1 Table2 ---------- id (PK) data2 There is a one-to-one relationship between the records of Table1 and Table2. (That is, for every record in Table1 there is a record with matching id in Table2 and vice versa). The problem is that I cannot alter the table schemas in any way, so I cannot add tableX_id colum...
2006 Jun 13
11
Question: Migration - multiple creates
...e script requires a seperate class so formatted this way. Perhaps I''m wrong. TIA Stuart class CreateTable1 < ActiveRecord::Migration def self.up create_table :table1s do |t| t.column :length, :string end end def self.down drop_table :table1s end end class CreateTable2 < ActiveRecord::Migration def self.up create_table :table2s do |t| t.column :length, :string end end def self.down drop_table :table2s end end class CreateTable3 < ActiveRecord::Migration def self.up create_table :table3s do |t| t.column :length, :string end...
2011 Aug 11
3
improve formatting of HTML table
I am trying to improve the look of an HTML table for a report (that needs to be pasted into Word). Here is an example. table2 <- structure(c(26L, 0L, 40L, 0L, 10L, 0L, 0L, 188L, 0L, 281L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 4L), .Dim = c(6L, 3L), .Dimnames = structure(list( myvar = c("Don't know", "Somewhat likely", "Somewhat unlikely", "Very likely", "Very unlikely&quot...
2011 Sep 28
3
Data transformation & cleaning
...Make the data set "wide", counting the observations so the data looks like this: ID | Count of Preference A | Count of Preference B 123 | 1 | 1 ... Using table1 <- dcast(data,ID ~ Page,fun.aggregate=length,value_var='Page' ) 2. Create a correlation matrix of preferences cor(table2[,-1]) How would I restrict my correlation to show preferences that met a minimum sample threshold? Can you confirm if the two following commands do the same thing? What would I do from here (or am I taking the wrong approach) table1 <- dcast(data,Page ~ Page,fun.aggregate=length,value_var='...
2009 Mar 23
1
subset and "or" operator
...in different years. I would like to subset the dataframe (in this example called "table") to get a new dataframe containing only the observation of year 1995, 1998 and 2000. I've tried to use subset and the or operator "|" like this: subset(table, year==1995|1998|2000)-->table2 but the dataframe didn't subset and I get an object called table2 that is identical to table. I guess I'm doing something wrong!! Thank in advance for any suggestions! Laura
2011 Mar 10
1
snp-chip table
...sire snp1 snp2 snp3 snp4 snp5 snp6 snp7 snp8 snp9 snp10 snp11 snp12 snp13 snp14 snp15 8877 -1 -1 -1 -1 0 0 -1 -1 -1 0 1 1 1 -1 -1 7765 1 1 1 0 0 0 -1 1 1 1 0 0 0 1 0 8766 1 1 -1 0 -1 -1 0 -1 0 -1 -1 -1 0 1 0 6756 0 1 0 -1 1 -1 -1 0 0 0 0 -1 0 1 1 5644 -1 0 1 -1 0 0 0 0 -1 -1 0 0 0 0 1 I have table2 sire snp1 snp2 snp3 snp4 snp5 snp6 snp7 snp8 snp9 snp10 snp11 snp12 snp13 snp14 snp15 8989 1 1 1 1 0 0 -1 -1 1 0 -1 0 1 0 -1 i need to ask evry snp if snp1(table2)==snp1(table1) but not evry snp alone windows ==15 if 15 snp are equal then sent line to new table3 [[alternative HTML version...
2006 Feb 21
1
[Bug 452] New: DNAT to internal network don't work with source routing and 2 uplinks
...ernal network (10.0.2.1/24) Simple source routing: /sbin/ip rule add from 10.0.0.1 table TABLE1 /sbin/ip route add 10.0.0.0/29 dev eth0 src 10.0.0.1 table TABLE1 /sbin/ip route add default via 10.0.0.2 table TABLE1 /sbin/route add default gw 10.0.0.2 metric 0 /sbin/ip rule add from 10.0.1.1 table TABLE2 /sbin/ip route add 10.0.1.0/29 dev eth1 src 10.0.1.1 table TABLE2 /sbin/ip route add default via 10.0.1.2 table TABLE2 /sbin/route add default gw 10.0.1.2 metric 5 If I setup DNAT like: -A PREROUTING -i eth0 -m tcp -p tcp --dport 25 -j DNAT --to 10.0.2.133 -A PREROUTING -i eth1 -m tcp -p tcp --dpo...
2006 Mar 05
1
Sweave and long strings
...the width of the page. For example when I do in my .Rnw document : <<UsingRODBC,echo=TRUE>>= channel <- odbcConnect(dsn="database",uid="root",pwd="password") df1 <- sqlFetch(channel,"table1",rownames=TRUE) df2 <- sqlFetch(channel,"table2",rownames=TRUE) cmd <- "SELECT t1.isoisotope, t1.periode,t1.nbZ, t2.filnomchaineradio, t2.filcodepere, t2.filcodefils, t2.filproba, t2.filtransition from table1 t1,...