Re: [R] Quantiles on multiply imputed survey data - mitools

2016-05-10 Thread Anthony Damico
is the `with` not passing make.formula( get( 'var_name' ) ) through to svyquantile for some reason? does this work? MIcombine( with(des, svyquantile(~LBXTCD, .5))) if that's not it, could you make a minimal reproducible example that includes the data download? code to download and import nhane

Re: [R] very long processing time

2016-05-10 Thread Jim Lemon
Hi Shashi, First off, keep the thread on the list. Compare the two statements below: Jim: If this method is revealed to us, we may be able to help you. Shashi: "if this method reveal to me i can help" Regardless, I will attempt to help. This looks like number 2 - inefficient code You appear to

Re: [R] Creating data frame of predicted and actual values in R for plotting

2016-05-10 Thread Muhammad Bilal
Pls don't mind the typo in predict() functions for some of the models. Sent from my iPhone > On 11 May 2016, at 12:47 am, Muhammad Bilal > wrote: > > Hi All, > > > I have the following dataset: > > >> str(pfi_v3) > 'data.frame': 714 obs. of 8 variables: > $ project_id : int

[R] Creating data frame of predicted and actual values in R for plotting

2016-05-10 Thread Muhammad Bilal
Hi All, I have the following dataset: > str(pfi_v3) 'data.frame': 714 obs. of 8 variables: $ project_id : int 1 2 3 4 5 6 7 8 9 10 ... $ project_lat: num 51.4 51.5 52.2 51.5 53.5 ... $ project_lon: num -0.642 -1.85 0.08 0.126 -1.392 ... $ sector

Re: [R] error in lmerTest after updating to R 3.3.0

2016-05-10 Thread Ben Bolker
Pascal A. Niklaus ieu.uzh.ch> writes: > > Dear all, > > After updating to R 3.3.0 (inadvertently, via apt-get), I get an error > when using lmerTest. Here is an example: > > library(lmerTest) > library(MASS) > data(oats) > m <- lmer(Y ~ N*V + (1|B/V), data=oats) > summary(m) > > summary from

Re: [R] very long processing time

2016-05-10 Thread Jim Lemon
Hi Shashi, The assumption that anyone on the list apart from yourself knows what "some calculation" involves is incorrect. I suspect that "what is wrong" may be one of two things: 1) "some calculation" includes a very large number of operations, perhaps leading to "disk-thrashing" when your 16GB o

[R] Quantiles on multiply imputed survey data - mitools

2016-05-10 Thread Anne Bichteler
Hello, and thank you for considering this question: The svystat object created with multiply imputed NHANES data files is failing on calling survey::svyquantile. I'm wondering if I'm diagnosing the issue correctly, whether the behavior is expected, and whether y'all might have any ideas for wor

Re: [R] web scraping tables generated in multiple server pages

2016-05-10 Thread boB Rudis
Unfortunately, it's a wretched, vile, SharePoint-based site. That means it doesn't use traditional encoding methods to do the pagination and one of the only ways to do this effectively is going to be to use RSelenium: library(RSelenium) library(rvest) library(dplyr) library(pbapply

Re: [R] web scraping tables generated in multiple server pages

2016-05-10 Thread Marco Silva
Excerpts from Michael Friendly's message of 2016-05-10 14:45:28 -0400: > This is my first attempt to try R web scraping tools, for a project my > daughter is working on. It concerns a data base of projects in Sao > Paulo, Brazil, listed at > http://outorgaonerosa.prefeitura.sp.gov.br/relatorios

Re: [R] Ensure parameter is a string when passed within an lapply & called function runs a 'substitute' on it

2016-05-10 Thread Bert Gunter
Andrew: Actually, thinking about it a bit more, I think my "solution" is not really a solution either; that is, it will fail in use. My understanding, which may be wrong and which others may correct, is this: in the lapply call, x.var = ... will result in substitute(...) in testFunc yielding an un

[R] error in lmerTest after updating to R 3.3.0

2016-05-10 Thread Pascal A. Niklaus
Dear all, After updating to R 3.3.0 (inadvertently, via apt-get), I get an error when using lmerTest. Here is an example: library(lmerTest) library(MASS) data(oats) m <- lmer(Y ~ N*V + (1|B/V), data=oats) summary(m) summary from lme4 is returned some computational error has occurred in lmerTe

[R] web scraping tables generated in multiple server pages

2016-05-10 Thread Michael Friendly
This is my first attempt to try R web scraping tools, for a project my daughter is working on. It concerns a data base of projects in Sao Paulo, Brazil, listed at http://outorgaonerosa.prefeitura.sp.gov.br/relatorios/RelSituacaoGeralProcessos.aspx, but spread out over 69 pages accessed throug

Re: [R] Ensure parameter is a string when passed within an lapply & called function runs a 'substitute' on it

2016-05-10 Thread Bert Gunter
Well, here's a very bad way of doing this: vars <- names(dataSet) lapply(vars, function(var) { assign("y",var,pos=parent.frame(2)) testFunc(x = model, pred.data = dataSet, x.var=eval(y,parent.frame(2)), plot = F) } ) ## results in [1] "X1" [1] "X2" [1] "X3" [1] "X4" [1] "X5" [1] "X6" [[1]]

[R] Left align plot_grid titles?

2016-05-10 Thread Mike Smith
Is there any way to left align titles automatically in plot_grid?? Currently using this code which centre aligns the whole plot title thanks! library(ggplot2) library(cowplot) data <- read.csv("http://www.lecturematerials.co.uk/data/times_tables.csv",header=T) gg1<-ggplot(data,aes(x=multiplie

[R] very long processing time

2016-05-10 Thread SHASHI SETH
Hi, I have implemented following program in R, that reads data from the "dtm_mydata.csv". file size is 114,029 kB, saved document Term matrix. Prog. performing some calculation and writing in a file. my computer RAM is 16 GB. To execute this program its taking around 25 hours. can any bo

Re: [R] Cannot Install Packages

2016-05-10 Thread Uwe Ligges
On 10.05.2016 19:14, Jason Hernandez via R-help wrote: I have been trying to install the package "reshape2" using the code: install.packages("reshape2") I get the following return: Installing package into ‘C:/Users/Jason/Documents/R/win-library/3.0’ (as ‘lib’ is unspecified) Warning: unable

[R] Cannot Install Packages

2016-05-10 Thread Jason Hernandez via R-help
I have been trying to install the package "reshape2" using the code: > install.packages("reshape2") I get the following return: Installing package into ‘C:/Users/Jason/Documents/R/win-library/3.0’ (as ‘lib’ is unspecified) Warning: unable to access index for repository http://cran.cs.wwu.edu/bin/

Re: [R] Assistance with httr package with R version 3.3.0

2016-05-10 Thread David Winsemius
> On May 10, 2016, at 10:02 AM, David Winsemius wrote: > > >> On May 10, 2016, at 2:08 AM, boB Rudis wrote: >> >> I don't fully remember, but I doubt httr::content() ever returned a >> character vector without using the `as="text"` parameter. Try >> switching that line to: >> >> html <- co

Re: [R] Coverage Probability

2016-05-10 Thread Ben Bolker
Muhammad Kashif uaf.edu.pk> writes: > > Dears > Can anyone help me to solve the issue. > > By using" boot" and "boot.ci" package in R we can construct bootstrap confidence intervals. How we > calculate the coverage probability of these intervals. Calculating coverage probability for any but

Re: [R] Antwort: Re: Re: sink(): Cannot open file

2016-05-10 Thread Duncan Murdoch
On 10/05/2016 11:15 AM, John Sorkin wrote: George, I do not know what operating system you are working with, but when I use sink() under windows, I need to specify a valid path which I don't see in your code. I might, for example specify: sink("c:\myfile.txt") Note that the backslash should

Re: [R] Assistance with httr package with R version 3.3.0

2016-05-10 Thread David Winsemius
> On May 10, 2016, at 2:08 AM, boB Rudis wrote: > > I don't fully remember, but I doubt httr::content() ever returned a > character vector without using the `as="text"` parameter. Try > switching that line to: > >html <- content(r, as="text") > > > > On Tue, May 10, 2016 at 3:27 AM, Luca

Re: [R] Regarding to R

2016-05-10 Thread Ben Bolker
shweta shukla gmail.com> writes: > > Dear, > I recently started R for my analysis but still not clear concept. > please guide me with some informative mterial to learn R. > > Iam also confuse that which one I should prefer R or R studio and what > differences in between. > R and RStudio are t

Re: [R] Regarding to R

2016-05-10 Thread Greg Snow
Please help us help you. Tell us what you have tried and where you have looked (otherwise we may just point you to things you already know about). Also what is your focus (simple analysis, learning, programming, ...)? The best place to start is with "An Introduction to R" which Installs with R.

Re: [R] find high correlated variables in a big matrix

2016-05-10 Thread David L Carlson
Look at varclus() in package Hmisc or package ClustOfVar. - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Lida Zeighami

[R] Antwort: Re: Antwort: Re: Re: sink(): Cannot open file

2016-05-10 Thread G . Maubach
Hi Sarah, John, Jim, Hi All, I have set my envrionment variable path <- file.path("H:", "2016", "Analysis") setwd(dir = path) This works well cause the file is created in that directory. I have tried close(zz) unlink(zz) and neither worked nor did it work out using them together. I had this

Re: [R] find high correlated variables in a big matrix

2016-05-10 Thread Lida Zeighami
Thank you David for your reply, But still couldn't get my answer. I've already used the rcorr and created the correlation matrix and found the high correlated variables but just among the two variables, it means I could find the pairs of variables with high correlation. So I couldn't get for examp

[R] Regarding to R

2016-05-10 Thread shweta shukla
Dear, I recently started R for my analysis but still not clear concept. please guide me with some informative mterial to learn R. Iam also confuse that which one I should prefer R or R studio and what differences in between. Thank you. [[alternative HTML version deleted]] ___

[R] intermediate action button necessary to update graph-not responding

2016-05-10 Thread Clarkson, Christopher
Hello, I'm aware that this is not a suitable question for this resource but neither Stackoverflow nor shiny help forum could help with the problem I'm having- is it possible that you could point me in the right direction? thanks Chris I have a command from a particular package that outputs a gra

Re: [R] Antwort: Re: Re: sink(): Cannot open file

2016-05-10 Thread Sarah Goslee
Try closing the type of sink you're actually opening: zz <- file("all.Rout", open = "wt") sink(zz, type = "message") try(log("a")) sink(type = "message") close(zz) unlink(zz) If you look carefully at the example in?sink, there are two close statements, one for each stream being sent to that fil

Re: [R] Antwort: Re: Re: sink(): Cannot open file

2016-05-10 Thread John Sorkin
George, I do not know what operating system you are working with, but when I use sink() under windows, I need to specify a valid path which I don't see in your code. I might, for example specify: sink("c:\myfile.txt") R code goes here sink() with the expectation that I would create a file myfi

[R] Antwort: Re: Re: sink(): Cannot open file

2016-05-10 Thread G . Maubach
Hi Jim, I tried: sink("all.Rout") try(log("a")) sink() The program executes without warning or error. The file "all.Rout" is begin created. Nothing will be written to it. The file is accessable rights after the execution of the program by notepad.exe. The program zz <- file("all.Rout", open

[R] Ensure parameter is a string when passed within an lapply & called function runs a 'substitute' on it

2016-05-10 Thread Andrew Clancy
Hi, I’m trying to solve what looks like the same issue as stack overflow article, but within an lapply: http://stackoverflow.com/questions/18939254/cant-use-a-variable-as-an-argument-but-can-use-its-value I’ve replicated the issue with partialPlot below in ‘testFunc’. The lines up to the final

Re: [R] sink(): Cannot open file

2016-05-10 Thread Jim Lemon
Have you tried: sink("all.Rout") try(log("a")) sink() Jim On Tue, May 10, 2016 at 9:05 PM, wrote: > Hi Jim, > > thanks for your reply. > > ad 1) > "all.Rout" was created in the correct directory. It exists properly with > correct file properties on Windows, e.g. creation date and time and file

[R] Coverage Probability

2016-05-10 Thread Muhammad Kashif
Dears Can anyone help me to solve the issue. By using" boot" and "boot.ci" package in R we can construct bootstrap confidence intervals. How we calculate the coverage probability of these intervals. [[alternative HTML version deleted]] __ R-h

[R] Antwort: Re: sink(): Cannot open file

2016-05-10 Thread G . Maubach
Hi Jim, thanks for your reply. ad 1) "all.Rout" was created in the correct directory. It exists properly with correct file properties on Windows, e.g. creation date and time and file size information. ad 2) I can not access the file with Notepad.exe directly after it was created by R. The er

Re: [R] sink(): Cannot open file

2016-05-10 Thread Jim Lemon
Hi Georg, I don't suppose that you have: 1) checked that the file "all.Rout" exists somewhere? 2) if so, looked at the file with Notepad, perhaps? 3) let us in on the secret by pasting the contents of "all.Rout" into your message if it is not too big? At a guess, trying: close(zz) might get

Re: [R] Problem while predicting in regression trees

2016-05-10 Thread Muhammad Bilal
Many thanks Max for these valuable suggestions. -- Muhammad Bilal Research Fellow and Doctoral Researcher, Bristol Enterprise, Research, and Innovation Centre (BERIC), University of the West of England (UWE), Frenchay Campus, Bristol, BS16 1QY muhammad2.bi...@live.uwe.ac.uk

Re: [R] Assistance with httr package with R version 3.3.0

2016-05-10 Thread boB Rudis
I don't fully remember, but I doubt httr::content() ever returned a character vector without using the `as="text"` parameter. Try switching that line to: html <- content(r, as="text") On Tue, May 10, 2016 at 3:27 AM, Luca Meyer wrote: > Hi Jim, > > Thank you for your suggestion. I have act

Re: [R] Assistance with httr package with R version 3.3.0

2016-05-10 Thread Luca Meyer
Hi Jim, Thank you for your suggestion. I have actually tried to upload XML and xml2 but nothing changed...any other suggestion? Kind regards, Luca > rm(list=ls()) > library(httr) > library(XML) > library(xml2) > > #carico i dati da Google spreadsheets > url <- " https://docs.google.com/spreadsh

[R] sink(): Cannot open file

2016-05-10 Thread G . Maubach
Hi All, I would like to route the output to a file using sink(). When using the example from the ?sink documentation: sink("sink-examp.txt") i <- 1:10 outer(i, i, "*") sink() unlink("sink-examp.txt") ## capture all the output to a file. zz <- file("all.Rout", open = "wt") sink(zz) sink(zz, type