similar to: sum a particular column by group

Displaying 20 results from an estimated 6000 matches similar to: "sum a particular column by group"

2009 Nov 24
1
keep empty subsets using aggregate
Dear all, I am struggling with a small problem. By using aggregate, the empty subsets are removed. I need each empty subset to be 0. Any suggestions will be appreciated. Code: edref = aggregate(rep(1,times=dim(eds)[1]),list(eds[,11], eds[,7], eds[,27]), sum) Thanks in advance, Betty [[alternative HTML version deleted]]
2009 Nov 02
3
problems with read.csv
Dear all, I''d like to ask help on R code to get the same results as the following Splus code: >indata<-importData("/home/data_new.csv") >indata[1:5,4] [1] 0930 1601 1006 1032 1020 I tried the following R code: > indata<-read.csv("/home/data_new.csv") > indata[1:5,4] [1] 930 1601 1006 1032 1020 I''d like the first
2009 Oct 23
2
extract day or month as in Splus
Dear all, I am writing to ask for help to find R code to do the same thing as the following Splus code: dates <- c("02/27/1992", "02/27/1992", "01/14/1992", "02/28/1992", "02/01/1992") timeDate(as.character(dates),in.format="%m/%d/%Y","%a") [1] Thu Thu Tue Fri Sat Could anyone give me some R codes to get the
2012 Sep 24
1
Adding textbox to multiple panels in lattice
Dear R-users, I am trying to add some text in a textbox to all panels in the following example file. Using the panel-function, I can add a white rectangle with panel.rect but then I have to fit in the text into the box by hand and it will not automatically be centered. Does anyone know how to add the text centered with a white box around it automatically? Is there something like panel.textbox for
2008 Sep 10
2
relsurv package
Dear R-users, I have a couple of questions about the relsurv package: 1) when I try to run the example: fit <- rsmul(Surv(time,cens)~sex+as.factor(agegr)+ratetable(age=age*365.24,sex=sex,year=year),ratetable=slopop,data=rdata) with the datasets in the package (rdata and slopop) it gives me an error: Error in nrow(x) : object "x" not found 2) If I have a date format
2006 May 31
1
trouble with boot ()
Dear members, I am trying to use boot () to compute the distributions of a statistic of a data set. The statistic is defined in the following code: eds<-function(x) { r<-cor(x) paren<-1-abs(r)/2 denom<-sum(sum(paren)+0.5) desvio<-sd(x) media<-mean(x) a<-desvio/media
2005 Apr 19
1
How to make combination data
Dear R-user, I have a data like this below, age <- c("young","mid","old") married <- c("no","yes") income <- c("low","high","medium") gender <- c("female","male") I want to make some of combination data like these, age.income.dat <- expand.grid(age,
2012 Feb 24
1
package relsurv
Dear R-Users, I've recently used relsurv package for relative survival analysis. In particular I've tried to reproduce the examples proposed in the R-documentation about rsadd, rsmul and rstrans functions in R latest version (R 2.14.1). These examples don't run and the error message is always the following: data(slopop) data(rdata)
2008 Jul 28
1
Negative Binomial Regression
Hello. I am attempting to duplicate a negative binomial regression in R. SAS uses generalized estimating equations for model fitting in the GENMOD procedure. proc genmod data=mydata (where=(gender='F')); by agegroup; class id gender type; model count = var1 var2 var3 /dist=NB link=log offset=lregtm; repeated subject=id /type=exch; run; Since my dataset has several observations for
2006 Apr 29
2
How many asterisk process's are "normal"?
Hello all, I have two test beds running the exact same version of asterisk 1.2.7.1, latest of zaptel, libpri, etc.. Test bed #1 (Solaris 9,sparc ultra 5): This one is closer to a "production" machine, in that it is connected to a sip provider thru an iax2 connection and have an incoming DID configured. I can send and receive calls. Test bed #2 (Slackware Linux 10.2, AMD XP chip):
2010 Apr 26
1
help with code
I am new to R and have tried for a good while to figure out how to code this in R. The dataset below: FTIStandKey State County FTITract CoverType Ver_CT V_Origin V_SpGrp NAH6005-001 Texas Jasper NAH6005 PPLB-2000-U PPLB-2000-U P P NAH6005-002 Texas Jasper NAH6005 NHHX-1950-O NHHX-1950-I N H NAH6253-001 Texas Tyler NAH6253 PPLB-2001-U PPLB-2001-U P P
2008 Jun 09
2
converting a data set to a format for time series analysis
I currently have a data set describing human subjects enrolled into an international clinical trial, the name of the hospital enrolling this human subject, the date when the subject was enrolled, and a vector with variables representing characteristics of the site (e.g., number of beds in a hospital). my data sets looks like this: subject hospital date_enrollment hospital_beds 1 hospitalA
2011 May 30
1
Need help reading website info with XML package and XPath
Hi, I'm looking for help extracting some information of the zillow website. I'd like to do this for the general case where I manually change the address by modifying the url (see code below). With the url containing the address, I'd like to be able to extract the same information each time. The specific information I'd like to be able to extract includes the homedetails url, price
2011 May 28
1
newbie xml parsing question
I am trying to read some data off the zillow site. Newbie to xml, html, parsing and the xml package. I've been able to load the web page I'm interested with the following code but I'm not sure of the next step to get the information I'm interested in into R : library(XML) url <- "http://www.zillow.com/homes/511 W Lafayette St, Norristown, PA_rb" doc <-doc <-
2018 Mar 22
5
why is dovecot "Allowing any password"
On 03/21/2018 10:34 PM, @lbutlr wrote: > The question is does it allow remote users to login with no password? Yes, and the answer is: no. > If not, then the message ie nearly notification that login without a password is potentially possible. Yes, but a worrying one. That's why i decided to post here. > I have no idea why you would have nopassword=y set in the first place, so it
2013 Mar 28
4
bayesian HLM random effects
Hello, all. I've been working on this for sometime and was almost at the end/ last chunk of code i would need.... When I received an error. Rather than go to bed and think about it in the morning, I messed with my data and now I am not getting anything. I was up until 4am trying to fix this. Zip files of my data are attached (the data which ends in 'a' matches with wvsA and the
2007 Jan 28
2
help with RandomForest classwt option
Hello there, I am working on an extremely unbalanced two class classification problems. I wanna use "classwt" with "down sampling" together. By checking the rfNews() in R, it looks that classwt is not working yet. Then I looked at the software from Salford. I did not find the down sampling option. I am wondering if you have any experience to deal with this problem. Do you
2012 Jan 10
4
Sum of a couple of variables of which a few have NA values
Dear everyone, I have looked all over the internet but I cannot find a way to solve my problem. In my data I want to sum a couple of variables. Some of these variables have NA values, and when I add them together, the result is NA dat <- data.frame( id = gl(5,1), var1 = rnorm(5, 10), var2 = rnorm(5, 7), var3 = rnorm(5, 6), var4 = rnorm(5, 3), var5 = rnorm(5, 8) ) dat[3,3] <- NA dat[4,5]
2017 Sep 19
3
what do you think about write.table(... qmethod = "excel")?
Last week one of our clients reported trouble with a csv file I generated with write.table. He said that columns with quotes for character variables were rejected by their data importer, which was revised to match the way Microsoft Excel uses quotation marks in character variables. I explained to them that quoted character variables are virtuous and wise, of course, but they say Microsoft Excel
2008 Apr 26
4
how to use printk() in xen?
hi, all: i want to add a function in xen. in the function i need to call the "printk" to display the values of some variables. i found the definition of printk() in file "xen-3.1.0-src\xen\include\xen\lib.h ": extern void printk(const char *format, ...) __attribute__ ((format (printf, 1, 2))); who can tell me the location of printk()? thanks in advance. 2008-04-26