search for: muhuri

Displaying 20 results from an estimated 21 matches for "muhuri".

Did you mean: muhui
2012 Oct 10
2
svyplot
...four different .png files. I am looking for examples how to redraw the same four graphs within grid viewports so that they stay together on a page. The goal is to create one .png file that will include all four graphs (2 rows, 2 columns). Any help would be appreciated. Thanks, Pradip Pradip K. Muhuri, Statistician Substance Abuse & Mental Health Services Administration The Center for Behavioral Health Statistics and Quality Division of Population Surveys 1 Choke Cherry Road, Room 2-1071 Rockville, MD 20857 Tel: 240-276-1070 Fax: 240-276-1260 e-mail: Pradip.Muhuri@samhsa.hhs.gov<mailto:P...
2012 Oct 02
2
svyby and make.formula
...the following error messages. - Error: object of type 'closure' is not subsettable # svyby () - Error in xx[[1]] : subscript out of bounds # make.formula () A reproducible example is appended below. I would appreciate if someone could help me. Thank you in advance. Pradip Muhuri ####Below is a reproducible example ########################################## setwd ("E:/RDATA") library (survey) xd1 <- "dthage ypll_ler ypll_75 xspd2 psu stratum wt8 mortstat NA NA NA 2 1 1 1683.7387 0 NA NA...
2012 Nov 20
4
github
Hello, I would like to learn how to set up Github/repository and upload/update files and am looking for "Github for Dummies". Any help will be appreciated. Thanks, Pradip
2012 Nov 24
5
subsetting - questions
Hello, I have two very basic questions (console attached): 1) What am I getting an error message for # 5 and # 7 ? 2) How to fix the code? I would appreciate receiving your help. Thanks, Pradip Muhuri ###### Reproducible Example ##### N <- 100 set.seed(13) df<-data.frame(matrix(sample(c(1:10),N, replace=TRUE),ncol=5)) keep_var <- c("X1", "X2") drop_var <- c("X3", "X4", "X5") df[df$X1>=8,] [,1:2] #1 df[df$X...
2012 Nov 22
4
Data Extraction
Hello, I would appreciate if someone could help me resolve the following: 1. df1[!is.na( X1 | X2 | X3 | X4 | X5),][,1:5] # This does not work 2. Is these message harmful? The following object(s) are masked from 'df1 (position 3)': X1, X2, X3, X4, X5 Thanks, Pradip Muhuri #Reproducible Example set.seed(5) df1<-data.frame(matrix(sample(c(1:10,NA),100,replace=TRUE),ncol=5)) attach (df1) #delete rows if any of them NA for X1 df1[!is.na( X1),][,1:5] # This works #delete rows if any of them NA for X1, X2, X3, X4 or X5 df1[!is.na( X1 | X2 | X3 | X4 | X5),][,1:5] # T...
2011 May 24
1
R in batch mode
...-2.10.0\bin\Rterm.exe" --no-restore --no-save < %1 > %1.Rout 2>& 1 Could anyone tell me in which directory or subdirectory I should save the mR.bat file? I would appreciate receiving any support you could extend on this subject. Thank you in advance, Pradip Pradip K. Muhuri, PhD Statistician Substance Abuse & Mental Health Services Administration The Center for Behavioral Health Statistics and Quality Division of Population Surveys 1 Choke Cherry Road, Room 7-1023 Rockville, MD 20857 Tel: 240-276-1070 Fax: 240-276-1260 e-mail: Pradip.Muhuri@samhsa.hhs.gov<mail...
2012 Dec 31
3
cut ()
...,48.7] in the ob_mrj_cat column. Is there a way to tweak the code (i.e., programmatically) to resolve the issue? I would appreciate receiving your help. Happy New Year and Best Wishes to R Expert-members, who have been so kind and helpful to beginner R users like me. Thanks and regards, Pradip Muhuri ########################## console followed the reproducible example ####### > table(p1_st_data$ob_mrj_cat) (42,48.7] (48.7,50.9] (50.9,52.8] (52.8,54.2] (54.2,58.7] 10 10 10 10 10 > p1_st_data [p1_st_data$state =="Utah",] [, 1:4]...
2012 Oct 05
1
svyhist
...c' contains NAs In addition: Warning messages: 1: In min(x) : no non-missing arguments to min; returning Inf 2: In max(x) : no non-missing arguments to max; returning -Inf I would appreciate if someone could help me resolve these issues. Below is reproducible example. Thanks, Pradip Muhuri setwd ("E:/RDATA") options(width = 120) library (survey) library (KernSmooth) xd1 <- "dthage ypll_75 xspd2 psu stratum wt8 56 19 2 2 33 1512.7287 86 0 2 2 129 1830.6400 81 0 2 1 67 536.1400 47 28 2 1...
2012 Nov 22
1
Data Extraction - benchmark()
...tached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] rbenchmark_1.0.0 loaded via a namespace (and not attached): [1] tools_2.15.1 I would appreciate receiving your help if your time permits .. Thanks and regards, Pradip Muhuri ##### Berend's code extended N <- 100000 set.seed(13) df<-data.frame(matrix(sample(c(1:10,NA),N, replace=TRUE),ncol=50)) s1 <- df[complete.cases(df),] s2 <- na.omit(df) s3 <- df[apply(df, 1, function(x)all(!is.na(x))), ] s4 <- function(df) {df[apply(df, 1, function(x)all(!is...
2013 Jan 08
2
Applying a user-defined function
...#apply the CutQuintile () on every odd-numbered columns of the "test1" data frame newcols <- sapply(test1 [, seq (1,6,2)], CutQuintiles) # name 3 new columns based on the odd-numbered columns names(newcols) <- paste (names(test1 [, seq (1,6,2)]), "_cat") ###### Pradip K. Muhuri, PhD Statistician Substance Abuse & Mental Health Services Administration The Center for Behavioral Health Statistics and Quality Division of Population Surveys 1 Choke Cherry Road, Room 2-1071 Rockville, MD 20857 Tel: 240-276-1070 Fax: 240-276-1260 e-mail: Pradip.Muhuri@samhsa.hhs.gov<mail...
2011 Jun 01
1
Contributed Packages - Hmisc & survey
...quot;survey", dependencies=TRUE) Warning: unable to access index for repository http://watson.nci.nih.gov/cran_mirror/bin/windows/contrib/2.13 Warning message: In getDependencies(pkgs, dependencies, available, lib) : package 'survey' is not available (for R version 2.13.0) Pradip K. Muhuri, PhD Statistician Substance Abuse & Mental Health Services Administration The Center for Behavioral Health Statistics and Quality Division of Population Surveys 1 Choke Cherry Road, Room 7-1023 Rockville, MD 20857 Tel: 240-276-1070 Fax: 240-276-1260 e-mail: Pradip.Muhuri@samhsa.hhs.gov<mail...
2012 Nov 03
1
Logical vector-based extraction
...does not get created although the second logical variable-based extraction works. I don't understand what I am doing wrong here. state_pflt200 <- df$p_fatal <200 df[state_pflt200, c("state.name","p_fatal")] I would appreciate receiving your help. Thanks, Pradip Muhuri ##### Below is the code that includes the reproducible example. df <- data.frame (state.name= c("Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut", "Del...
2012 Dec 14
1
format.pval () and printCoefmat ()
...0.162 1.74e-01 0.0669 12 wh othh 18.7 NA NA NA NA 13 wh pr 18.7 10.47 0.791 3.64e-23 0.2131 14 wh spn 18.7 15.15 0.237 1.58e-02 0.0922 Pradip K. Muhuri, PhD Statistician Substance Abuse & Mental Health Services Administration The Center for Behavioral Health Statistics and Quality Division of Population Surveys 1 Choke Cherry Road, Room 2-1071 Rockville, MD 20857 Tel: 240-276-1070 Fax: 240-276-1260 e-mail: Pradip.Muhuri@samhsa.hhs.gov<mail...
2012 Nov 20
2
kinitr
Hello, I am an Intro-level R and ggplot2 user and looking for resources to self teach dynamic report generation in R using knitr. Any advice would be highly appreciated. Thanks, Pradip
2012 Oct 14
2
svyhist and svyboxplot
Hello, The following code is expected to produce 4 charts. But, I only get charts 1,2 ,& 4, NOT CHART # 3. For Chart# 3, I am getting the following error message: Error in tapply(1:NROW(x), list(factor(strata)), function(index) { : arguments must have same length I would appreciate if someone could help me resolve the issue. Thanks, Pradip # BELOW IS THE REPRODUCIBLE EXAMPLE setwd
2014 Nov 14
1
file.copy
...der) and finds the list of files (list.of.files) to be copied to the toFolder, which I have verified using the print () command. But, the issue is that the file.copy() command does not work. Both the R.script and the console are shown below. Any help/hints will be appreciated. Thanks, Pradip Muhuri ######################### R script ##################################################### #file.copy.R #identify the folders fromFolder <- "H:/R/cis_study" toFolder <- "F:/cis_study_backup" # find the list of files to copy list.of.files <- list.files(fromFolder, &q...
2014 Nov 10
2
range () does not remove NA's with complete.cases() for dates (dplyr/mutate)
...read from a data frame. However, the issue is that the same function does not remove NA's for the other date variable that is created using the dplyr/mutate(). The console and the reproducible example are given below. Any advice how to resolve this issue would be appreciated. Thanks, Pradip Muhuri ################# cut and pasted from the R console #################### id mrjdate cocdate inhdate haldate oiddate 1 1 2004-11-04 2008-07-18 2005-07-07 2007-11-07 2008-07-18 2 2 <NA> <NA> <NA> <NA> <NA> 3 3 2009-10-2...
2012 Dec 08
4
read.table()
...han 30 minutes, but failed to read in this file using the read.table() function. I could not figure out how to fix the following error. Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 1 did not have 6 elements Any help would be be appreciated. Thanks, Pradip Muhuri ####### below is the reproducible example xd1 <- "race age percent sepercent flag_var Mexican 12-17 5.7926 0.64195 any Puerto Rican 12-17 5.1975 0.24929 any Cuban 12-17 3.7977 1.00487 any C-S American 12-17 4.3665 0.55329...
2014 Sep 24
1
Error Reading from Connection
Hello, I am running Rx64 3.03 under Windows 8 environment. I have been getting the following error. when running some of my old R applications. Below is a mock-up example. Could someone please help me resolve the issue? Thanks, Pradip Muhuri setwd ("D:/") > > > #load Rdata file > > load("heroin.rdata") Error: error reading from connection > > str(heroin) Error in str(heroin) : object 'heroin' not found [[alternative HTML version deleted]]
2014 Nov 09
4
Getting the most recent dates in a new column from dates in four columns using the dplyr package (mutate verb)
...a(haldate), NA, max(mrjdate, cocdate, inhdate, haldate,na.rm=TRUE ) ) ) # convert to date data2$oidflag = as.Date(data2$oidflag, origin="1970-01-01") # print records print (data2) Pradip K. Muhuri, PhD SAMHSA/CBHSQ 1 Choke Cherry Road, Room 2-1071 Rockville, MD 20857 Tel: 240-276-1070 Fax: 240-276-1260 [[alternative HTML version deleted]]