similar to: Make package out of own function

Displaying 20 results from an estimated 600 matches similar to: "Make package out of own function"

2012 Apr 16
1
system command to a specific shell (bash)
I need to run a bash command, but when you call system() the default shell is sh (see my sessionInfo below). I found the shell command ( http://www.stat.ucl.ac.be/ISdidactique/Rhelp/library/base/html/shell.html) but it seems to be disappeared in current versions of R? I am running all this from R CMD BATCH with "system" calls to other R scripts. For a little more info, I'm
2012 Mar 12
1
Faceted bar plot shows wrong counts (ggplot2)
I have encountered a problem with faceted bar plots. I have tried to create something like the example explained in the ggplot2 book (see pp. 126-128): library(ggplot2) mpg4 <- subset(mpg, manufacturer %in% c("audi", "volkswagen", "jeep")) mpg4$manufacturer <- as.character(mpg4$manufacturer) mpg4$model <- as.character(mpg4$model) base <-
2012 Mar 31
2
lm no calcula un coeficiente
Hola, quiero hacer una regresión lineal lm(y ~ x * grupo, data =datos) y: numérica, x: numérica, grupo: factor con dos niveles (1 y 2) pero no calcula el coeficiente de x:grupo2 a cuenta de una singularidad Coefficients: (1 not defined because of singularities) Estimate Std. Error t value Pr(>|t|) (Intercept) -1.283e+06 2.276e+04 -56.359 < 2e-16 *** x
2012 May 16
1
TukeyHSD plot error
Hi, I am seeking help with an error when running the example from R Documentation for TukeyHSD. The error occurs with any example I run, from any text book or website. thank you... > plot(TukeyHSD(fm1, "tension")). Error in plot(confint(as.glht(x)), ylim = c(0.5, n.contrasts + 0.5), ...) : error in evaluating the argument 'x' in selecting a method for function
2012 Apr 05
1
issue with base:::namespaceImportMethods
Hi, I've noticed an issue with S4 methods and namespaces which only arises in particular, difficult to reproduce configurations. One example is the ggbio package in Bioconductor, which currently emits these warnings when its namespace is loaded: ---------------------- library(ggbio) Loading required package: ggplot2 Attaching package: ‘ggbio’ The following object(s) are masked from
2013 Feb 15
1
Why no line? (ex. from Andy Filed book)
The following script is written by the author of a book on R--Andy Field: You can also download the small datafile, hiccups.dat, from this address: http://www.sagepub.com/dsur/study/articles.htm The script: hiccupsData <- read.delim("Hiccups.dat", header = TRUE) hiccups<-stack(hiccupsData) names(hiccups)<-c("Hiccups","Intervention")
2012 Feb 23
1
Sexpr not getting expanded in Sweave
An Sweave file, 'test.Rnw': \documentclass{article} \title{Sweave minimal} \author{MK} \begin{document} \maketitle We try Sweave: <<1>>= data(airquality) summary(airquality) x <- airquality[1, 1] @ I try Sexpr: \Sexpr{x} We plot: \begin{center} <<2, fig=TRUE, echo=FALSE >>= boxplot(Ozone ~ Month, data = airquality) @ \end{center} \end{document} I check the
2012 May 31
1
anova of lme objects (model1, model2) gives different results depending on order of models
Hello- I understand that it's convention, when comparing two models using the anova function anova(model1, model2), to put the more "complicated" (for want of a better word) model as the second model. However, I'm using lme in the nlme package and I've found that the order of the models actually gives opposite results. I'm not sure if this is supposed to be the case
2012 Sep 11
1
Animation Problem
Hi List, I am trying to build an animation and facing problem as animation is not coming "live". The goal is to build "heart beats" like diagram for the data given below. data : structure(list(date = 1971:1991, x = c(41L, 60L, 41L, 61L, 22L, 83L, 31L, 55L, 22L, 14L, 38L, 6L, 29L, 17L, 10L, 99L, 88L, 32L, 68L, 78L, 26L)), .Names = c("date", "x"), class =
2012 Nov 16
2
source file on startup question - why does an old version of a function show up? ggplot or R?
All, 1. I will try and make this clear and concise. Please let me know any information that would be helpful in figuring out this problem (I don't know the relevant information to post). I am on linux- see below for session information. 2. Problem: working directory: home an old version of a function is sourced into the R session and doesn't work working directory: Desktop the
2012 Sep 06
0
lme( y ~ ns(x, df=splineDF)) error
I would like to fit regression models of the form y ~ ns(x, df=splineDF) where splineDF is passed as an argument to a wrapper function. This works fine if the regression function is lm(). But with lme(), I get two different errors, depending on how I handle splineDF inside the wrapper function. A workaround is to turn the lme() command, along with the appropriate value of splineDF, into a text
2012 Sep 26
0
lme(y ~ ns(x, df=splineDF)) error
I would like to fit regression models of the form y ~ ns(x, df=splineDF) where splineDF is passed as an argument to a wrapper function. This works fine if the regression function is lm(). But with lme(), I get two different errors, depending on how I handle splineDF inside the wrapper function. A workaround is to turn the lme() command, along with the appropriate value of splineDF, into a text
2012 Jun 27
0
ggplot2 ordering in a faceted dotplot.
am trying to produce two dot plot figures in ggplot2. So far the first one (p) in the program below is working fine. However when I want to move to a faceted plot (p1) I seem to lose my ordering or, more likely, I'm just getting an ordering I am not expecting and I always have trouble understanding ordering in R! What I would like is the 2011 panel to be ordered in descending order as is
2011 Nov 10
0
Package build/check OK, install looking for irrelevant function
Hello R Users: I have 3 packages that I authored and they build and check just fine locally. However, when I try to install the local source packages (from the .tar.gz), I get the following message: Error in `+.POSIXt`(as.POSIXct(origin, tz = tz, ...), x) : could not find function "%is.a%" In addition: Warning message: In install.packages(file.choose(), .libPaths()[1], NULL, type =
2012 Aug 10
1
ggplot2 geom_bar produces white slashes in legend keys
When I am using geom_bar I get these white slashes through the legend keys. I cannot figure out how to remove them. ggplot(diamonds, aes(clarity, fill=cut)) + geom_bar() I have tried using opts(legend.key = theme_blank()) but with no luck. Any suggestions would be much appreciated. I am using R vers. 2.15.0 and ggplot 0.9.1, win xp Best wishes Jonas Hal
2012 Aug 09
2
read htm table error
Hi I am using Version R 2.15 and I haven't been able read html table. Following is my code and error message. Error in htmlParse(doc) : error in creating parser for http://en.wikipedia.org/wiki/Brazil_national_football_team theurl <- "http://en.wikipedia.org/wiki/Brazil_national_football_team" tables <- readHTMLTable(theurl) Regards, Kiung [[alternative HTML version
2012 May 16
3
install ggplot2 package
Has one try to install the ggplot2 package recently? I tried to install it on my new system and had trouble: > install.packages("ggplot2") Installing package(s) into 'C:/Program Files/R/R-2.14.2/library' (as 'lib' is unspecified) also installing the dependency 'scales' trying URL
2012 Aug 09
1
Using unicode symbol has unexpected results in levels of factor object
Dear all, When I use a unicode symbol in the labels for a factor object, the corresponding level does not display as expected. However, using levels() on the factor returns the desired output. I noticed the discrepancy when the legend labels from a call to ggplot() did not display the desired symbol, but an explicitly built legend using the same labels did. Example (I am trying to get the less
2012 Oct 19
5
Centering labels on X-axis
Dear all: I am trying to center labels on my plot with not much success. I have tried text(), mtext() but it's not working. I think I am using the wrong function for my task. Any help will be appreciated. My working codes. axis(1, at=c(1,2,3,4,5),font.lab=2,cex.axis=1.5,cex.lab=3,label=c("W0","CWH2","CWHmc","CH2","CHmc")
2012 Jun 28
6
Help
Dear all, I need some help on plotting multiple boxplots on one figure. I have three matrix A, B and C. Each of them is a 1000 by 10 matrix. The 10 columns of all three matrix correspond to the 10 values of the same parameter, say k=1, ..., 10. I want to make a plot where x axis represents different values of k. For each k value, I want to plot three boxplots, one on top of another. For