[R] Names of variables needed in newdata for predict.glm

2018-03-06 Thread Bendix Carstensen
I would like to extract the names, modes [numeric/factor] and levels of variables needed in a data frame supplied as newdata= argument to predict.glm() Here is a small example illustrating my troubles; what I want from (both of) the glm objects is the vector c("x","f","Y") and an indication that f

[R] Problems update version

2018-03-06 Thread carlos alfredo barron gallardo
Hello. I'm trying to install bioconductor software on my ubuntu linux computer system. I've installed already the latest R version but when trying to install any semiconductor package, I can't. After write the command on R, it says that I have to upload my R to the new version but I have already

[R] ggplot2: plot gruped/nested split violins

2018-03-06 Thread Big Floppy Dog
Hi, I posted this on StackOverflow also but did not get a response so I thought that I would also try luck here. The post is at: https://stackoverflow.com/questions/49120060/ggplot2-display-blocks-of-nested-split-violins Basically, I have the following test example: --cut-and-paste-from-here-on

Re: [R] Capturing warning within user-defined function

2018-03-06 Thread Jen
I did explore tryCatch but wasn't successful. However, I did just try your solution, William, and it worked! I just had to modify this line in my function: p <- ((svyciprop(~grp, grp1, family=quasibinomial))[1]) to p <- withWarnings((svyciprop(~grp, grp1, family=quasibinomial))[1]) Then I cou

Re: [R] Capturing warning within user-defined function

2018-03-06 Thread William Dunlap via R-help
tryCatch() is good for catching errors but not so good for warnings, as it does not let you resume evaluating the expression that emitted the warning. withCallingHandlers(), with its companion invokeRestart(), lets you collect the warnings while letting the evaluation run to completion. Bill Dunl

Re: [R] Capturing warning within user-defined function

2018-03-06 Thread Jen
Hi William, Thanks, I'll give that a shot. I tried using withCallingHandlers without success but II admit I'm not familiar with it and may have used it wrong. I'll report back. Jen On Tue, Mar 6, 2018, 5:42 PM William Dunlap wrote: > You can capture warnings by using withCallingHandlers. H

Re: [R] Capturing warning within user-defined function

2018-03-06 Thread Bert Gunter
1. I did not attempt to sort through your voluminous code. But I suspect you are trying to reinvent wheels. 2. I don't understand this: "I've failed to find a solution after much searching of various R related forums." A web search on "error handling in R" **immediately** brought up ?tryCatch, w

Re: [R] Capturing warning within user-defined function

2018-03-06 Thread William Dunlap via R-help
You can capture warnings by using withCallingHandlers. Here is an example, its help file has more information. dataList <- list( A = data.frame(y=c(TRUE,TRUE,TRUE,FALSE,FALSE), x=1:5), B = data.frame(y=c(TRUE,TRUE,FALSE,TRUE,FALSE), x=1:5), C = data.frame(y=c(FALSE,FALSE,TRUE,TRUE,TRUE)

[R] Capturing warning within user-defined function

2018-03-06 Thread Jen
Hi, I am trying to automate the creation of tables for some simply analyses. There are lots and lots of tables, thus the creation of a user-defined function to make and output them to excel. My problem is that some of the analyses have convergence issues, which I want captured and included in the

Re: [R] couple of how-to-do it in R questions regarding corelations and mean and SD of likert items

2018-03-06 Thread Jim Lemon
Hi Faiz, Just to add to the confusion: library(prettyR) describe(iris) You can specify which summary measures you want in the "num.desc" argument. Jim On Tue, Mar 6, 2018 at 11:03 PM, faiz rasool wrote: > Dear list, I have the following how-to-do it in R, questions. > > Suppose I have ten inde

Re: [R] couple of how-to-do it in R questions regarding corelations and mean and SD of likert items

2018-03-06 Thread Richard M. Heiberger
Please look at the microplot package, install.packages("microplot") ## it will bring in lots of other packages. Specifically look at the demo demo("tablesPlusGraphicColumn", package="microplot") The last item in that demo is an MS Word table with the text of the question, some numerical informa

Re: [R] couple of how-to-do it in R questions regarding corelations and mean and SD of likert items

2018-03-06 Thread Rui Barradas
Hello, You can use function apply() to do what you want without needing to type the same 10 times. Here is a reproducible example. set.seed(2234)# Make the results reproducible # Make up some data dv <- rnorm(100) iv <- replicate(10, rnorm(100)) apply(iv, 2, cor, dv) Now suppose you hav

Re: [R] package installation

2018-03-06 Thread Jeff Newmiller
There is the directory that the compressed file gets downloaded (Temp), and there is another directory where the the extracted files are "installed" ("library"). You can read all about this in the "R Administration and Installation Manual" that comes with R. The message about the download direct

Re: [R] couple of how-to-do it in R questions regarding corelations and mean and SD of likert items

2018-03-06 Thread David L Carlson
Your quickest way to learn about R is to use the manual pages that are included with your installation. Typing the command ?cor produces a page with the following information: x a numeric vector, *matrix* or *data frame*. y NULL (default) or a vector, *matrix* or *data frame* with co

Re: [R] couple of how-to-do it in R questions regarding corelations and mean and SD of likert items

2018-03-06 Thread PIKAL Petr
Hi For first question, maybe I am completely wrong but cor(swiss[,-1], swiss[,1]) should give you what you want in one step. Second question Without an example it is hard to say but maybe aggregate is the way forward. > aggregate(iris[,1:4], list(iris$Species), function (x) c(mean=mean(x), >

[R] couple of how-to-do it in R questions regarding corelations and mean and SD of likert items

2018-03-06 Thread faiz rasool
Dear list, I have the following how-to-do it in R, questions. Suppose I have ten independent variables, and one dependent variable. I want to find the Pearson correlation of all the IVs with the DV, but not the correlation between the IVs. What I know so far, about R, that I have to type the cor

Re: [R] package installation

2018-03-06 Thread PIKAL Petr
Hi If you installed through install.packages you could specify lib see help page lib character vector giving the library directories where to install the packages. Recycled as needed. If missing, defaults to the first element of .libPaths(). But I believe you hardly need to do it. You probably

[R] package installation

2018-03-06 Thread Kabouch Nourdine via R-help
Hi, When installing packages is there any preferable path. In my case I got this message in R consol:The downloaded binary packages are in         C: ~\ Temp \ RtmpQLTD5e \ downloaded_packages this is a temporary files that I delete every time. Is it possible to install packages in a specefic fold

Re: [R] raster time series statistics

2018-03-06 Thread David Winsemius
> On Mar 5, 2018, at 9:07 PM, > wrote: > > It works if you use as.Date. But this defeates the purpose for the yearmon > notion... > > require(raster) > require(rts) > require(stringr) > r <- raster(ncol=100, nrow=100) > values(r) <- runif(ncell(r)) > stack(r)->s > r->rs > for(i in 1:23){ > r