Displaying 20 results from an estimated 1000 matches similar to: "Error loading packages at sprintf()"
2009 Apr 08
2
factor, as.factor and levels
Dear All,
to my surprise as.factor does not accept a levels argument. Maybe I
did not read the documentation well enough. See the example below. I
wanted to use ch1 as factor in the newdata argument of survfit, so I
assumed that I could write as.factor(ch1, levels=ch1), since the
order should be kept.
But as.factor(ch1, levels=ch1) results in the error:
Error in as.factor(ch1, levels = ch1)
2008 Jun 30
2
Plotting question: Problem with strwidth in 2.7.1
R users,
I have a problem with function strwidth in 2.7.1. I'm trying to set
the plot margins in a way that horizontal
column labels will fit to the graph. tmp.t is a list of data.frame
objects. This code works well in 2.6.0.
...snip..
library(gplots)
for (i in names(tmp.t)) {
bmp(filename=paste(i, "_", Sys.Date(), ".bmp", sep=""),
width=1038,
2009 Jun 01
2
Sweave:Figures from plot (LME output) not getting generated (pdf or eps)
Hi,
I seem to be facing a strange problem when I use Sweave for creating a
LaTeX document of the R lme() output --- The EPS and PDF figure files
get created, but are empty. I have attached a reproducible example
below (taken from the R lme() help example).
------------------------------------------------------------------------------------
\documentclass[a4paper,10pt]{article}
2008 Jul 11
2
Help with error in "if then" statement
Dear list,
I'm afraid this is a mundane question. Here's the background: I've
produced a function which allows me to sequentially measure angles and
distances from a specified reference point to a curve defined by
empirical data points while (i.e. using a while loop) the angle being
measured is within certain bounds. Because the curve is circular I
need to pars the data
2010 Apr 13
2
Help required with png graphic production as text has shadows?
I have produced a series of graphs with the png command, however when I have finally printed these out the black text appears to have a colour shadow with blue or red on either side of the letter.
I tried increasing my res to 1200 and this improved it somewhat, but the text is still not sharp and occassionally these "shadows" will still print.
I initially thought this was an issue with
2009 Jan 10
3
install.views()
Dear Rxperts,
Using R 2.8.1 and trying
install.views("Cluster")
getting error
Error: could not find function "install.views"
Please help:-(
--
Oscar
Oscar A. Linares
Molecular Medicine Unit
Bolles Harbor
Monroe, Michigan
[[alternative HTML version deleted]]
2009 Apr 29
1
RweaveHTML (R2HTML) Help
I have found Sweave() to be great for producing PDF documents. I have
been experimenting with RweaveHTML (from the R2HTML) package and have
had moderate success. My main issue has been that I simply want the R
output to be shown verbatim in the HTML document but RweaveHTML tends to
convert most output to a table, for example. So, is there a way to
force the RweaveHTML driver to simply provide
2008 Nov 21
1
different .Rprofile files for different projects
Dear list,
First off, let me offer my apologies, I know this is a very basic question. After amassing a large number of objects (from multiple projects) in one working directory, I'd like to be able to start using different directories, just for the sake of organization alone. But I have no idea how to do this. I am using a mac, running R 2.5.
Searching the FAQ online I find:
12.1 How
2008 Nov 05
0
library(gdata) fails
I wanted to install the package "gdata". Here are the commands I gave and the
responses:
install.packages("gdata")
Warning in install.packages("gdata") :
argument 'lib' is missing: using '/Users/dbae/Library/R/library'
trying URL
'http://cran.uk.r-project.org/bin/macosx/universal/contrib/2.8/gdata_2.4.2.tgz'
Content type
2008 Nov 02
1
Simple R (in Sweave) Question
I am writing a report using Sweave with specific R output incorporated into
the text using the Sexpr{} command. I have run into two specific issues:
1) If the result inside the Sexpr{} command is an integer less than 10 I
would like to print the ?word? for that number ? e.g., ?seven? for 7.
2) If a p-value is ?equal to zero? to some arbitrary number of decimal
places -- e.g.,
2008 Oct 01
1
Help with CrossTable
Hi,
I am using the CrossTable function from library(gmodels).
x=unique(data[,c("L1","L1_Revenues","RIC")])
L1_Classification=CrossTable(x$L1,x$L1_Revenues,exclude =
c("NA","","0%","0"),prop.r=FALSE,prop.c=FALSE,prop.t=FALSE,prop.chisq=FA
LSE,dnn=c("L1_Classification","Revenue"))
What I would like
2008 Nov 14
0
Cross-validation
Hi,
I was trying to do cross-validation using the crossval function (bootstrap package), with the following code:
---------------------------------------------------------------------------------------------------------
theta.fit <- function(x,y){
model <- svm(x,y,kernel = "linear")
}
theta.predict <- function(fit,x){
prediction <- predict(fit,x)
2009 Apr 30
0
plot scaling bug when using par(mfg)
Dear list,
I've noticed a width/height scaling bug in multi-panel plots when you
change the active plot using par mfg
The underlying par setting that maps the full plot width (or height)
to the numerical axis labels does not get updated when you change
plots with par(mfg=...). Thus plotting a point at c(10,10) in the
first plot will only be in the correct place IF the most recently
2007 Oct 03
2
Shading area under density curves
Hello,
I have a question regarding shading regions under curves to display
95% confidence intervals. I generated bootstrap results for the slope
and intercept of a simple linear regression model using the following
code (borrowed from JJ Faraway 2005):
> attach(allposs.nine.d)
> x<-model.matrix(~log(d.dist,10))[,-1]
> bcoef<-matrix(0,1000,2)
> for(i in 1:1000){
+
2010 May 28
0
simulate time series with various "colors" of noise
Hello,
I'm trying to simulate time series with various "colors" of noise to verify
some other code I've written. I'm using the fractal package, specifically
FDSimulate. I have a detailed question about this particular function, but
I'd also be happy to receive any suggestions for other packages, functions,
citations.
To the question: FDSimulate takes a delta parameter
2010 Apr 02
1
All sub-summands of a vector
Hello,
I'd like to take all possible sub-summands of a vector in the quickest and
most efficient way possible. By "sub-summands" I mean for each sub-vector,
take its sum. Which is to say: if I had the vector
x<-1:4
I'd want the "sum" of x[1], x[2], etc. And then the sum of x[1:2], x[2:3],
etc. And then...so on.
The result would be:
1 2 3 4
2 5 7
6 9
10
I can
2010 Jan 28
2
Constrained vector permutation
Hello,
I'm trying to permute a vector of positive integers > 0 with the constraint
that each element must be <= twice the element before it (i.e. for some
vector x, x[i] <= 2*x[i-1]), assuming the "0th" element is 1. Hence the
first element of the vector must always be 1 or 2 (by assuming the "0th"
element is 1). Similarly, the 2nd must always be below/= 4, the
2009 Nov 03
1
lmer and estimable
Hi everyone,
I'm using lmer and estimable (from packages lme4 and gmodels respectively) and have the disconcerting happening that when I run exactly the same code, I get different results! In checking this out by running the code 50x, it seems to be that answers may be randomly deviating around those which I get from another stats package (GenStat, using the linear mixed models functionality
2009 Jul 21
1
problem with heatmap.2 in package gplots generating non-finite breaks
I have written a wrapper for heatmap.2 called
heatmap.w.row.and.col.clust which auto-generates breaks using
breaks<-round((c(seq(from=(-20 * stddev), to=(20 * stddev))))/20,
digits = 2) #(stddev in this case = 2.5)
This has always worked well in the past but now I am getting an error
that non-finite breaks are being generated. Drilling down, it seems
that my wrapper is generating finite
2010 Apr 24
4
assign value between different type: Double vs Integer
Dear list,
just to put it in a simple way:
i read.csv from csv file to create a gdata
then, create array gdata34
however, when making a loop for assigning gdata34[1,m]<-gdata[m,4], this is what happen
gdata[1,4] 's real value is 10354, however, the gdata34[1,4] turns to be 883
then i checked the type: gdata[1,4] is integer, while gdata34[1,4] is double.
Can any one give me some help