similar to: , Updating Table

Displaying 20 results from an estimated 10000 matches similar to: ", Updating Table"

2012 Jul 30
3
replace values in vector from a replacement table
Dear all I've got stuck when trying to replace values in a vector by selecting replacements from a replacement table. I'm trying to use only base functions. Here's a dummy example: > (x <- rep(letters,2)) [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l"
2004 Mar 17
9
Frequency table
This must be FAQ, but I can't find it in archives or with a site search. I am trying to construct a frequency table. I guess this should be done with table. Or perhaps factor and split. Or prop.table. cut? findInterval? Argh! Please correct me if what I am looking for is not called a "frequency table". Perhaps it's called grouped data. > zz$x9 [1] 65 70 85 65 65 65 62 55
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
2006 May 12
2
Help In Function
Hi All, I need a basic help from you. I've built a function like this, windowlength<-function(x) { z <- rep(seq(0,331,by=x-1)+1, each=2) zz <- z[-c(1,length(z))] ind <- as.data.frame(matrix(zz, nr=2)) j<-lapply(ind, function(x) mat[x[1]:x[2],]) cat("For",x/4,"month
2004 Jan 26
5
conditional assignment
Hi all I want to conditionally operate on certain elements of a matrix, let me explain it with a simple vector example > z<- c(1, 2, 3) > zz <- c(0,0,0) > null <- (z > 2) & ( zz <- z) > zz [1] 1 2 3 why zz is not (0, 0, 3) ????? the null <- assignment is to keep the console silent in the other hand, it curious that null has reasonable values > null [1]
2009 Jan 29
2
Stacking data
Hi I have data in the format below      Age            V1       V2      V3       V4    23646         45190 50333 55166 56271    26174         35535 38227 37911 41184    27723          25691 25712 26144 26398 and would like to sort it as follows                  Age      values     ind                 23646    45190    V1                26174   35535      V1                27723    25691     V2
2006 May 15
1
Object call
Hi All, I have a function like this: windowlength<-function(x) { mat <- matrix(rnorm(331*12),331,12) z <- rep(seq(0,331,by=11)+1, each=2) zz <- z[-c(1,length(z))] ind <- as.data.frame(matrix(zz, nr=2)) lapply(ind, function(x) mat[x[1]:x[2],]) cat("For",x/4,"month i.e",x,"week, number of windows is = ",length(ind),"\n")
2002 May 20
1
how does one apply Western Electric / AT&T rules to R plots?
I have searched for info on how to apply the Western Electric rules for process control, to data and plots I have in R, but I have not been able to learn how. Any help would be greatly appreciated. Thank you, sjcrauhut at agere.com 05/20/02 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read
2012 Oct 10
6
Exporting summary plm results to latex
Dear all, I am trying to export my fixed effect results to Latex. I am using the plm package with the summary function. However, it does not look like apsrtable, stargazer, or any other package can accompany using the plm package. I am interested in a classic table with the coefficient in one row followed by the standard error in paranthesis in the next row and stars by the coefficient to show
2010 Dec 10
2
survival package - calculating probability to survive a given time
Dear R users, i try to calculate the probabilty to survive a given time by using the estimated survival curve by kaplan meier. What is the right way to do that? as far as is see i cannot use the predict-methods from the survival package? library(survival) set.seed(1) time <- cumsum(rexp(1000)/10) status <- rbinom(1000, 1, 0.5) ## kaplan meier estimates fit <- survfit(Surv(time,
2009 Jun 08
2
help to speed up loops in r
Hi i am using a script which involves the following loop. It attempts to reduce a data frame(zz) of 95000 * 41 down to a data frame (averagedreplicates) of 95000 * 21 by averaging the replicate values as you can see in the script below. This script however is very slow (2days). Any suggestions to speed it up. NB I have also tried using rowMeans rather than adding the 2 values and dividing by 2.
2010 Jul 26
1
After writing data in MMF using SEXP structure, can i reference in R?
Hi all, After writing data in MMF(Memory Map File) using SEXP structure, can i reference in R? If input data is larger than 2GB, Can i reference MMF Data in R? my work environment : R version : 2.11.1 OS : WinXP Pro sp3 Thanks and best regards. Park, Young-Ju from Korea. ---------[ ???????? ???????? ???????? ]---------- ???????? : R-help Digest, Vol 89,
2009 May 15
2
Help with loops
Hi I am trying to create a loop which averages replicates in my data. The original data has many rows. and consists of 40 column zz[,2:41] plus row headings in zz[,1] I am trying to average each set of values (i.e. zz[1,2:3] averaged and placed in average_value[1,2] and so on. below is my script but it seems to be stuck in an endless loop Any suggestions?? for (i in 1:length(average_value[,1])) {
2009 Nov 04
4
unexpected results in comparison (x == y)
Dear readers of the list, I have a problem a comparison of two data from a vector. The comparison yields FALSE but should be TRUE. I have checked for mode(), length() and attributes(). See the following code (R2.10.0): ----------------------------------------------- # data vector of 66 double data X =
2009 May 15
1
Fw: Help with loops(corrected question)
--- On Fri, 15/5/09, Amit Patel <amitrhelp at yahoo.co.uk> wrote: > From: Amit Patel <amitrhelp at yahoo.co.uk> > Subject: Help with loops > To: r-help at r-project.org > Date: Friday, 15 May, 2009, 12:17 PM > Hi > I am trying to create a loop which averages replicates in > my data. > The original data has many rows. and consists of 40 column > zz[,2:41]
2008 Jul 30
1
model mix problem. FALSE CONVERGENCE
Hi R users I try to use the lme but I can?t!!!!! My script is (some words in french, sorry!!): rm(list=ls(all=TRUE)) #Efface tous les objets en m?moire pour ?viter des erreurs library(MASS) #Chargement des Librairies library(car) library(Hmisc) library(tkWidgets) library(svDialogs) library(multtest) library(nlme) #Rep <- "C:/Documents and Settings/U3M/Bureau/steph/Scripts
2010 Jun 22
4
seek() and gzfile() on 32-bit R2.12.0 in linux
I have installed both 32-bit and 64-bit versions of R2.12.0 (2010-06-15 r52300) on my Ubuntu 10.04 64-bit system. I observe the following behavior when running the examples from base::connections. There appears to be a problem with seek() on a .gz file when using a 32-bit installation of R2.12.0, but the problem doesn't appear in the 64-bit installation. I realize that seek() has been
2005 Aug 29
4
ttda on R 2.1.1: error
Hello, I'm trying to use the package ttda, wich is involved in text analysis, for my own data about answers in a company survey. I've installed it, as well as ispell, but when trying to use an example: > zz <- file("stupid.txt", "w") # build a data file > cat("{comment - stupid data file} \n" , file = zz) > cat("<uci=1>
2005 Jun 02
1
Wishlist: more flexible handling of tick labels in axis.Date (PR#7913)
Full_Name: Gavin Simpson Version: 2.1.0-patched (1-Jun-2005) OS: Linux (Fedora Core 3) Submission from: (NULL) (128.40.32.76) axis.Date() insists on labelling tick marks. It could be made more flexible by allowing the user to specify if they want the ticks to be labelled, for example, to add un-labelled minor ticks for "months", added to a plot with "years" labelled. The user
2006 Jul 23
1
Iterated Data Input/Output with Random Forests
Hi, I am currently writing code to input a few thousand files, run them through the Random Forests package, and then output corresponding results. When I use the code below: zz<-textConnection("ex.lm.out", "w") sink(zz)