search for: tab1

Displaying 20 results from an estimated 52 matches for "tab1".

Did you mean: tab
2011 Aug 16
2
Assignment working differently inside ifelse()
Hello all, I need to extract rows and columns from a data frame and put them in a matrix. In some cases, there are no rows in the data frame meeting the selection criteria. For those rows I want to put a row of 0's in the matrix. Here's my clumsy code: tab1.m1 <- matrix(0, nrow=2, ncol=4) tab1.m1[1,] <- ifelse(length(as.matrix(tab1[tab1$comp==the.comp & tab1$schlid==the.schl & tab1$ext.obs==0, 4:7])) > 0, as.matrix(subset(tab1, tab1$comp==the.comp & tab1$schlid==the.schl & tab1$ext.obs==0)[4:7]),...
2005 Jul 27
2
How to delete rows
Dear R-users, I am very new to R, so maybe my question is very easy to answer. I have the following table: TAB1<-data.frame(Name,Number), "Name" and "Number" are all character strings, it looks like this: Name Number ab 2 ab 2 NA 15 NA 15 NA 15 cd 3 ef 1 NA 15 NA 15 gh 15 gh 15 I want to delete all the rows which begin with...
2010 Jul 25
1
Left Outer Join 2 DF's on Multiple Conditions
Hi, I am trying to execute the following SQL statement using two data frames: tab1, tab2 : Two Tables Select tab1.*, tab2.*, tab1.tobiiTime - tab2.ruiTime as timeDiff, IFNULL(n-m, -9999999) as alwaysIncrement FROM tab1 LEFT OUTER JOIN tab2 On tab1.data1 - tab2.mouseX = 0 And tab1.data2 - tab2.mouseY = 0 I am trying to do the following in R:- *#Getting error...
2013 Feb 11
2
How to plot doubles series with different location using plotCI
...##data value1<-c(1,2,1,2,1,3,4,2,6,1,3,4,2,6) value2<-c(1,5,1,2,4,4,4,3,3,1,3,4,9,8) typo<-c("C","C","C","C","A","A","A","A","A","B","B","B","B","B") tab1<-data.frame(data=cbind(value1,value2,typo)) colnames(tab1)<-c("value1","value2","typo")   tab1$value1<-as.numeric(tab1$value1) tab1$value2<-as.numeric(tab1$value2) ##mean and error first data series tmp <- split(tab1$value1,tab1$typo) means <- sapp...
2005 Oct 27
2
F tests for random effect models
...20 10 2 Of course, summary(aov(Rendement ~ Pollinisateur * Lignee, data = mca2)) gives wrong tests of random effects. But, summary(aov1 <- aov(Rendement ~ Error(Pollinisateur * Lignee), data = mca2)) gives no test at all, and I have to do it like this : tab1 <- matrix(unlist(summary(aov1)), nc=5, byrow=T)[,1:3] Femp <- c(tab1[1:3, 3]/tab1[c(3,3,4), 3]) names(Femp) <- c("Pollinisateur", "Lignee", "Interaction") 1 - pf(Femp, tab1[1:3,1], tab1[c(3,3,4),1]) With "lme4" package (I did'nt succeed in wr...
2013 Apr 10
6
means in tables
Hi. I have 2 tables, with same dimensions (8000 x 5). Something like: tab1: V1 V2 V3 V4 V5 14.23 1.71 2.43 15.6 127 13.20 1.78 2.14 11.2 100 13.16 2.36 2.67 18.6 101 14.37 1.95 2.50 16.8 113 13.24 2.59 2.87 21.0 118 tab2: V1 V2 V3 V4 V5 1.23 1.1 2.3 1.6 17 1.20 1.8 2.4 1.2 10 1.16 2.6 2.7 1.6 11 1.37 1.5 2.0 1.8 13 1.24 2.9 2.7 2.0 18 I need generate a t...
2008 Feb 13
2
apply on large arrays
I have a big contingency table, approximately of size 60*2*500*500, and I need to count the number of cells containing a count of 1 for each of the factors values defining the first dimension. Here is my attempt: tab1<-with(pisa1,table(CNT,GENDER,ISCOF,ISCOM)) tab2<-apply(tab1,1:4,function(x)ifelse(sum(x)==1,1,0)) tab3<-apply(tab2,1,sum) Computing tab2 is very slow. Is there a faster and/or more elegant way of doing this? -- Erich Neuwirth, University of Vienna Faculty of Computer Science Computer Sup...
2011 Oct 29
1
Refresh tab content on click in JQuery UI Tabs
HI Guy''s TAB1 and TAB2 have some radio button, checkbox and dropdown menu. When TAB1 is selected, I have to switch to TAB2 and then back to TAB1 to refresh the loaded content. How to make TAB1 refresh loaded content when click on its tab? *code is something like that* <ul class="tabs">...
2010 May 26
3
shapiro.test
Hi, I am not so sure about an error note I got when using shapiro.test. I imported some data into R by wrinting it into a .txt file via > tab1<-read.table("etc....txt",header=T) > attach(tab1) The following object(s) are masked _by_ .GlobalEnv : ozon > ozon$V1 [1] 2.5 3.0 5.6 4.7 6.5 6.7 1.7 5.3 4.6 7.4 5.4 4.1 5.1 5.6 5.4 6.1 7.6[18] 6.2 6.0 5.5 5.8 8.2 3.1 5.8 2.6 Now I wanted to use the shapiro.test: > shapir...
2006 Oct 27
3
How to best divide table by table
Hi all, how can I divide two tables of the same dimension so that all names are preserved, ie do not become NA? I have "tab1" and "tab2", each having names in the first column. I want "tab3" with the same names and values "tab1/tab2". Thanks, Serguei
2005 Oct 28
2
Random effect models
...Df Sum Sq Mean Sq F value Pr(>F) Residuals 4 18.0294 4.5074 Error: Pollinisateur:Lignee Df Sum Sq Mean Sq F value Pr(>F) Residuals 36 5.1726 0.1437 Error: Within Df Sum Sq Mean Sq F value Pr(>F) Residuals 50 3.7950 0.0759 # F tests : > Femp <- c(tab1[1:3, 3]/tab1[c(3,3,4), 3]) > names(Femp) <- c("Pollinisateur", "Lignee", "Interaction") > Femp Pollinisateur Lignee Interaction 9.258709 31.370027 1.893061 > 1 - pf(Femp, tab1[1:3,1], tab1[c(3,3,4),1]) Pollinisateur Lignee...
2010 Apr 24
2
table command
Hi, Let s be a dataframe. > s A B C 0 0 1 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 1 1 0 1 1 0 0 1 > tab1=table(s[,c(1,2)]) > tab1 B A 0 1 0 3 3 1 3 0 > tab2=table(s[,c(1,3)]) > tab2 C A 1 0 6 1 3 The problem is I need to access frequency corresponding to (0,0). tab1[1] will give me the correct value while tab2[1] will not give the frequency which I expec...
2005 Jun 24
1
comparing strength of association instead of strength of evidence?
...for an association....It is sensible to decompose chi-squared into components, study residuals, and estimate parameters such as odds ratios that describe the STRENGTH OF ASSOCIATION". Can I do this "decomposition" in R for the following example including 2 contingency tables? > tab1<-array(c(11266, 125, 2151526, 31734), dim=c(2,2)) > tab1 [,1] [,2] [1,] 11266 2151526 [2,] 125 31734 > tab2<-array(c(43571, 52, 2119221, 31807), dim=c(2,2)) > tab2 [,1] [,2] [1,] 43571 2119221 [2,] 52 31807 BTW, is there some good forum on the theory of...
2009 Dec 22
2
Nested For loops
...- function (infile) {     data<-read.table(infile)     data_value <- data[,-1]     data_value_mean <- mean(data_value)     data_value_square <- (data_value - data_value_mean) ^ 2     square_sum<-sum(data_value_square)     entry<-NROW(data_value)     deno<-square_sum/entry     tab1<-c()     tab2<-c()     ps_value <- seq(0,(floor(entry/2)),1)         for(k in 0:(floor(entry/2))){         for (i in 1:(entry-k)) {             mult<-(data_value[i] - data_value_mean) * (data_value [i+k] - data_value_mean)             tab1 <- c(tab1,mult)         }             auto_...
2010 Jul 14
2
count - help
Hi, I have a data frame with several factors and I want to count the occurrences of an event resulting from an interaction of some factors. I tried to do several tables (and then converting to d.f and then merge them by one factor and the freq Tab1 <- merge (BPorAmost,BPorSector,by=c('Sample','Freq')) Tab1 <- merge (Tab1,BPorDist,by=c('Sample','Freq')) Tab1 <- merge (Tab1,BPorProf,by=c('Sample','Freq')) But I have lots of NAs because I can have a interaction between sample and freq dif...
2008 Sep 12
2
Fw: Complex sampling survey _ Use of survey package
...2070 G 551 9 50 > 2070 S 551 9 51 > 2070 S 551 9 52 > > > > yes Totanim is the total number of animals in the farm and num is the > total number of herds > > I keep on obtaining this error message > > clustot<-svydesign(id=~num+ ~ Id_An, fpc=~fpc1+~Totanim, data=tab1) > > Erreur dans as.fpc(fpc, strata, ids) : > FPC implies >100% sampling in some strata. > > > -------------------------------------------------- > From: "Thomas Lumley" <tlumley at u.washington.edu> > Sent: Friday, September 12, 2008 12:02 AM > To: &q...
2011 Dec 23
3
Applying a function
Hi, I need help writing a function I capture seal pups mutliple times during the lactation season in order to monitor their growth rate. When I release them, the recovery (mother-pup) time is not the same for all individuals. I want to know if individuals that recover their mother the fastest are the ones with the highest growth rates. So, I noted at every release if the pup
2008 Sep 11
1
Complex sampling survey _ Use of survey package
Hello everybody I don't understand how I'm supposed to use svydesign caracteristics to explain to R that my sampling design is the following one Data base = tab1 here are the five first rows of the database (nrow = 11792) num esp Quarters Totcat Totshp Totgt Tbtpos fpc1 Totanim Id_An 10 2045 G 01-Q1 0 0 12 1 551 10 10 11...
2010 Jan 07
2
table() and setting useNA to be there by default?
...gt; table(t1) t1 1 2 3 1 2 3 I keep forgetting to allow for NAs and I was bitten *again* this morning... ideally I'd like to be able to set a default in my profile so that table(t1) will actually do table(t1, exclude=NULL) or table(t1, useNA='ifany') I could say something like.. > tab1 <- function(t, ...) { table(t, ..., useNA='ifany') } > tab1(t1) t 1 2 3 <NA> 1 2 3 4 but this names it as 't' instead of 't1' which is ugly? Any other suggestions please? Thanks in advance, Sean O'Riordain Dublin Ireland
2010 Mar 15
0
Making descriptive analyisis in R
when I try to make a package coping R code such as tab1, summ, titleString, setTitle from epicalc package, the following problems are found. * using log directory 'C:/Rpackage/EpiStat.Rcheck' * using R version 2.10.0 (2009-10-26) * using session charset: ISO8859-1 * checking for file 'EpiStat/DESCRIPTION' ... OK * checking extension typ...