similar to: understanding output of tapply/by cumsum

Displaying 20 results from an estimated 400 matches similar to: "understanding output of tapply/by cumsum"

2008 May 08
1
Reading multiple tables from file
Dear R-users, I have output files having a variable number of tables in the following format: ------------- 1 Pietje I1 I2 Value 1 1 0.11 1 2 0.12 2 1 0.21 2 Jantje I1 I2 I3 Value 1 1 1 0.111 3 3 3 0.333 ... ------------- Would there be an easy way of turning this into (a list of) data.frames with names Pietje, Jantje and variables I1,I2,...Value? (I1,I2 are string or categorical,
2011 Nov 14
2
how to include integrate in a function that can be solved with uniroot?
Hallo, I am trying to define expectation as an integral and use uniroot to find the distribution parameter for a given expectation. However I fail to understand how to define properly the functions involved and pass the parameters correctly. Can anyone help me out? Thanks, Gerrit Draisma. This what I tried: ======= > # exponential density > g <- function(x,lambda){ lambda
2007 Aug 01
2
Simple table with frequency variable
Hallo, Im trying to find out how to tabulate frequencies of factors when the data have a frequency variable. e,g: i<-rep(1:5,2) j<-rep(1:2,5) N<-10*i+j table(i,j) gives a table of ones as each combination occurs only once. How does one get a table with the corresponding N's? Thanks! Gerrit. -- Gerrit Draisma Department of Public Health Erasmus MC, University Medical Center
2008 Aug 04
2
Howto Smooth a Curve Created with the Point Function
Hi all, I have this figure: http://docs.google.com/Doc?id=df5zfsj4_103rjt2v4d5 created with the following steps: > x [1] 90.4 57.8 77.0 103.7 55.4 217.5 68.1 85.3 152.0 113.0 97.1 89.9 [13] 68.1 83.7 77.4 34.5 104.9 170.3 88.6 88.1 108.8 77.4 85.6 82.7 [25] 81.3 108.0 49.5 71.0 85.7 99.3 203.5 275.9 51.1 84.8 16.5 72.6 [37] 160.5 158.3 136.7 140.0 98.4 116.1
2008 Jul 30
1
Unexpected line type in lattice plot key on pdf device
L.S., With the code below, on the Windows screen the line types in the key show as solid and dashed as in the graph, and in the pdf file they show as solid in the key and solid and dashed in the graph. I would not expect that, but may be I get something wrong. Gerrit. ------- library(lattice) # pdf("pietje.pdf") x<-0:10 xyplot((x^0.5)+(x^0.75)~x,type="o",lty=c(1,2),
2008 Apr 18
1
Vertical bars with barchart
Hallo, What is the right way to get vertical bars in a barchart? For instance barchart(VADeaths, key=simpleKey(colnames(VADeaths),points=F,rectangles=T)) gives what I need, only I would like the bars to be vertical. But barchart(VADeaths,horizontal=F, key=simpleKey(colnames(VADeaths),points=F,rectangles=T)) does not give what I need, and I do not understand how to change the
2009 Jun 06
1
correct line types in lattice legends
Hallo R-users, I do not understand how to specify the correct line and symbol types in the legends of a lattice xyplot. This is what I tried, but the line types and symbol in the graph are not seen in the legend. Any help is appreciated. Thanks, Gerrit. library(lattice) s<-rep(1:3,len=10) x<- 1:10 y<- x+s+rnorm(10) d<-data.frame(s,x,y) xyplot(y~x, groups=s,data=d,
2012 Jul 06
4
differences between survival models between STATA and R
Dear Community, I have been using two types of survival programs to analyse a data set. The first one is an R function called aftreg. The second one an STATA function called streg. Both of them include the same analyisis with a weibull distribution. Yet, results are very different. Shouldn't the results be the same? Kind regards, J -- View this message in context:
2003 Apr 04
2
Bug in %in% (match)
Hi, Am I hitting some limit in match? Consider the following example: > tst<-seq(100,125,by=.2)%in%seq(0,800,by=.1) > sum(tst) [1] 76 > seq(100,125,by=.2) [1] 100.0 100.2 100.4 100.6 100.8 101.0 101.2 101.4 101.6 101.8 102.0 102.2 [13] 102.4 102.6 102.8 103.0 103.2 103.4 103.6 103.8 104.0 104.2 104.4 104.6 [25] 104.8 105.0 105.2 105.4 105.6 105.8 106.0 106.2 106.4 106.6 106.8
2003 Apr 04
2
Bug in %in% (match)
Hi, Am I hitting some limit in match? Consider the following example: > tst<-seq(100,125,by=.2)%in%seq(0,800,by=.1) > sum(tst) [1] 76 > seq(100,125,by=.2) [1] 100.0 100.2 100.4 100.6 100.8 101.0 101.2 101.4 101.6 101.8 102.0 102.2 [13] 102.4 102.6 102.8 103.0 103.2 103.4 103.6 103.8 104.0 104.2 104.4 104.6 [25] 104.8 105.0 105.2 105.4 105.6 105.8 106.0 106.2 106.4 106.6 106.8
2010 May 19
1
printing a dataframe by categories
I am looking for the following simple question. I have a data frame with names and numbers, divided in categories. I would like to produce a text file with page breaks, listing the names and numbers by category, and totalling the numbers. Example: Name<-LETTERS[1:6] Score<-rep(5:8,length.out=6) Form<-rep(1:2,each=3) x<-data.frame(Name,Score,Form) This gives approximately
2010 Oct 29
1
Tukey post hoc comparison (glht?) after 3factorial mixed model (lmer)
Hello, dear R-community. This is a question about TukeyHSD between factor combinations of a Three-Way ANOVA, which is - since it is a multi measure ANOVA - not a simple ANOVA but a Generalised Linear Mixed Model (GLMM), calculated with "lmer". > growth <- groupedData(length~meas|box_id,outer=~spec*comp*water,data=all.spec) > model <-
2013 Jul 17
2
error message in gev
  Hi r-users,   I would like to use gev and my data (annual rainfall ) is as follows:   > head(dat,20) A B C D E F G H I J 1 45.1 41.5 58.5 50.1 46.0 49.1 37.7 49.1 59.8 54.0 2 50.3 39.8 49.4 56.4 49.4 48.8 42.1 49.8 49.4 58.3 3 41.7 39.3 44.6 39.1 35.7 41.5 40.8 40.8 38.5 45.6 4 50.7 33.9 48.4 28.2 35.5 39.1 61.4 17.0 30.7 38.3 5 39.3 30.6 46.9 23.8 25.8
2009 Dec 04
1
latex.table for table with character and numeric columns
Hallo, I have a dataset with one or two columns with character data and the rest with numeric data. Using latex.table from the quantreg package produced a table, but I cannot set the decimals. For instance: --- > x<-data.frame(Name=c("Jan","Piet","Jan"), V=c(1,2.991,3)) > latex.table(as.matrix(x),file="x",caption="x") >
2007 Apr 03
8
FastCGI performing better than Mongrel - what am I doing wrong?
I tried benchmarking the same site behind an NGINX proxy with both fastcgi and mongrel, and for some reason mongrel is performing pretty poorly in comparison. Any idea what I might be doing wrong? Here''s my benchmarks for 1 fcgi: Server Software: nginx/0.4.0 Server Hostname: eship.com.br Server Port: 80 Document Path: / Document Length: 95
2012 Oct 15
1
performance analytics
hi Michael, am sorry for the incomplete reply . csv file data havinmg like this , >getSymbols("IBM") >weekly_data = to.weekly(week_name) >dataframe=data.frame(weekly_data) >outputfile_name="F:\\R-programs\\Outputfile.csv" >write.table(dataframe, file =outputfile_name,sep = ",",col.names =TRUE,row.names = T) > datafrom_table <-
2008 Jun 23
3
Getting only label column of a data frame
Hi, How can I extract the label only from a given data frame. Fore example from this data frame. > print(dataf) V1 V2 V3 V4 V5 V6 V7 V8 V9 11145 14.3 17.1 31.2 41.7 45.8 49.8 68.6 70.6 72.9 3545 10.2 15.6 20.9 23.2 31.4 31.7 36.2 48.4 51.9 8951 15.2 17.5 20.0 21.4 32.4
2012 Apr 12
2
How to calculate the "McFadden R-square" for LOGIT model?
Dear all, can somebody please help me how to calculate "McFadden R-square" for a LOGIT model? Corresponding definition can be found here: http://publib.boulder.ibm.com/infocenter/spssstat/v20r0m0/index.jsp?topic=%2Fcom.ibm.spss.statistics.help%2Falg_plum_statistics_rsq_mcfadden.htm Here is my data: Data <- structure(c(1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1,
2013 Jul 18
1
Bland Altman summary stats for all column combinations
Hello, I have the following data.frame structure(list(Study = structure(c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L,
2018 Mar 12
1
Help on Aggregation
Dear All, 1.I have been trying to aggregate my data but I have not been getting it correctly. In the data I want to convert hourly data into daily averages. Here is a sample of the data: Neph_no Date Time Temp_C Pressure_kPa RH 9 2014/03/28 10:00:00 38.4 95.9 29.7 9 2014/03/28 11:00:00 37.8 95.8 29.2 9 2014/03/28 12:00:00 36.7 95.8 35.1 9 2014/03/28 13:00:00 35.4 95.8 38.9 9