Displaying 20 results from an estimated 6000 matches similar to: "Alternative to slow double for() loop"
2009 Sep 04
2
lrm in Design package--missing value where TRUE/FALSE needed
Hi,
A error message arose while I was trying to fit a ordinal model with lrm() I am using R 2.8 with Design package.
Here is a small set of mydata:
RC	RS	Sex	CovA	CovB	CovC	CovD	CovE
2	1	0	1	1	0	-0.005575280	2
2	1	0	1	0	1	-0.001959580	2
3	0	0	0	1	0	-0.004725880	2
0	0	0	1	0	0	-0.005504850	2
2	1	1	0	0	0	-0.003880170	1
2	1	0	0	1	0	-0.006074230	2
2	1	0	0	1     1 	-0.003963920	2
2	1	0	0	1	0	
2018 Jan 28
1
semPLS package will not load seems to be failing on loading package lattice
Hi R Help Team
I recently updated my R installation to R 3.4.3 and updated to later version of R Studio and I found that the package semPLS will not load even though installed and it seems to be failing on loading package lattice
Getting the following error message:
library(semPLS)
Loading required package: lattice
Error: package or namespace load failed for 'lattice':
.onLoad failed in
2003 Jul 29
1
Sweave: pass scale parameter to includegraphics?
Hi all
I'm using Sweave and find it a treat.  But one
question:
I use Sweave to create my pictures which are
automatically included into LaTeX.  For example, 
in the file  test.Snw,  I may have:
% LaTeX stuff
\begin{figure}
<<fig=true,width=5,height=5>>=
x1 <- seq(1,5, length=10)
x2 <- sin(x1)
plot(x1,x2)
@
\caption{Plot}
\end{figure}
% More LaTeX
This produces the LaTeX
2008 Jun 09
1
Bug/Error in formatC? (Was: Why doesn't formatC( x, digits=2, format= "g")...)
Hi all
After posting what follows, Duncan Murdoch suggested perhaps a bug 
in formatC, or an error on documentation.  Any comments?
In particular, bug, error or not, any ideas about how I can 
consistently get two significant figures to print?
P.
----------  Original Message  ----------
Hi all
I am not a C programmer, but I am trying to understand  formatC  to 
get consistent printing of
2008 Feb 27
2
Adding LaTeX cross-references into Sweave plots
Hi all
I'm using Sweave and LaTeX, and love how they interact.
But here's a different interaction I'm not sure how to achieve; I 
hope someone can help.  I use a simple example, of course, to 
demonstrate.
Suppose in my LaTeX document I have this:
	Here is a linear equation:
	\begin{equation}
		y = -1 + 3 x
		\label{EQ:example}
	\end{equation}
This appears in the final product
2007 Mar 07
1
Sweave issue: quotes in verbatim-like output print incorrectly
Hi all
I love Sweave; use it all the time.
But I recently received a new computer, and ever since I
have had a problem I've never seen before.
For example, I place the following in my Snw file:
<<>>=
sms <- 
read.table("http://www.sci.usq.edu.au/staff/dunn/Datasets/applications/popular/smsspeed.dat",
header=TRUE)
attach(sms)
sms.lm <- lm( Time ~ Age*Phone,
2003 Mar 21
1
The best way to end up with TIFF {Was: end up with WMF)
Hi all
I posted a couple of days ago about how to end up with wmf files
eventually in R for linux.
The short answer was:  you (probably) can't...and don't!
The journal in question also accepts TIFF files, I am told (it's
a physiology journal).
So I adjust my question:  What is the best way to get TIFF files
out of R?  It can't create them directly as far as I can tell.
2007 Nov 08
1
Mixing lty specifications in legend
Hi all
I have a plot with lines, one specified as (say) lty=1, 
using standard line types, and another as (say) my
own spec: lty="51".
I can't get  legend  to display both.  Toy example:
> plot(1~1)
> legend("topright", lty=c("51",1), legend=c("My own","Standard"))
Error in segments(x1, y1, x2, y2, ...) : invalid line type: must be
2004 Mar 29
1
White background in PS pictures
Hi all
I am using R to produce postscript pictures via the
postscript  command.  I have never had any problems...
until now, when I want to inlcude my .ps file is a
LaTeX document *without* a white background.  (If
it's important, I'm using the  prosper  class with
the  whitecross option, so the background in blue.)
I would like my .ps file to have a white background.
If I read the help
2004 Jun 22
1
Using xtable with summaries of lm objects
Hi all
Suppose I do the following:
set.seed(1000)
library(xtable)
x <- runif( 10 )
y <- 1 + 2*x + rnorm( length(x) )
test.lm <- lm( y ~ x )
summary( test.lm )
xtable ( summary( test.lm ) )
The final  xtable  output follows:
% latex table generated in R 1.8.1 by xtable 1.2-2 package
% Tue Jun 22 09:56:36 2004
\begin{table}[ht]
\begin{center}
\begin{tabular}{rrrrr}
\hline
  &
2004 Nov 11
1
substitute/paste question for using Greek in plot titles
Hi all
I am having troubles making sense of why code (1)
below fails but code (2) below works.
Code (1):
 > phi.1 <- 1
 > plot(0 ~ 0,
+ main=substitute(paste("A vaue for ",phi," = ",phival), 
list(phival=phi.1)) )
Error in paste("The two deviances for ", phi, " = ", 2) :
         Object "phi" not found
But this works:
Code (2):
 >
2003 Mar 19
3
The best way to end up with WMF files
Hi all
I am doing some stats work for a group of biologists
who require windows metafiles (*.wmf) for their publications.
To create these, I appear to have two choices:
1.  Restart my machine in Windows and use  savePlot
2.  Keep my machine in linux, save as another format,
    then convert.
I'd rather stay in linux; but how do I get wmf files?  I looked
at using ImageMagick's  convert,
2003 Jul 28
1
Plotting (mixed) line types and legends
Hi all
I have a question about plotting line types and
legends.  Here's a short piece of code to
demonstrate:
x <- y <- seq(1,10)
plot(x,y, type ="l", lty="33")
lines(x,y+1,  lty=1)
legend( 8,2,legend=c("lty=1","lty=\"33\""), lty=c(1,"33") )
On my system (see below), the line types in the legend
are not the same as in the
2003 Apr 02
2
Two questions
Hi all
Two questions:
1. I note that help for the postscript device claims "The 
postscript produced by R is EPS (Encapsulated PostScript)
compatible...".  It does not say it is EPS *compliant*.  
Indeed, the EPS produced by R includes a \showpage command 
which I believe (not that I'm an expert!) non-standard EPS.  
My question:  Is there any reason why it is EPS compatible,
but
2007 Jun 15
2
sma package, and MouseArray data set
Hi all
I have just downloaded the  sma  package from CRAN.
On installing on my linux machine, I get the message
> library(sma)
> data(MouseArray)
Warning message:
file 'MouseArray.RData' has magic number 'RDX1'
   Use of save versions prior to 2 is deprecated
Hereafter,  MouseArray  is not found:
> MouseArray
Error: object "MouseArray" not found
We were
2002 Dec 13
1
Loading libraries: Nas introduced
Hi all,
I am trying to package a library in R 1.6.1 (Windoze XP).
I have read the document "Writing R extensions" and think I
have done things correctly (though apparently not).  I have
searched the mail archives for help to no avail.
When I try to attach the library using, eg
	> library( libname, lib.loc=path.to.library)
I get this message:
	Warning message: 
	NAs introduced by
2004 May 06
1
Printing ps pictures with transparent b'ground
Hi all
I wish to create a ps file of a picture produced in R.
With my limited R, I see two ways:
1. Print direct to the postscript device
2. Print to the screen, and save to ps using dev.print.
I want a white (not transparent) background.  Option
1 above works fine, but 2 does not:  even when I say I
want a white background, I get transparent; perhaps I
misread the help files.
Here's some R
2007 May 03
2
Building package: What does this message about rcompgen imply?
Hi all
I'm updating a package for submission to CRAN, and I am getting
an error message I never have seen before, and can't find out
what it implies or means (and hence, what I need to do to fix
it).
After running R CMD check, I get this:
<snip>
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd
2008 Jun 06
2
Why doesn't formatC( x, digits=2, format="g") doesn't always give 2 sig figs?
Hi all
I am not a C programmer, but I am trying to understand  formatC  to 
get consistent printing of reals to a given number of significant 
digits.
Can someone please explain this to me?  These first three give what 
I expect on reading ?formatC:
> formatC(0.0059999, digits=2,format="fg",flag="#")
[1] "0.0060"
> formatC(0.59999,
2002 Dec 16
1
Creating libraries: Cannot make help
Hi all
I am trying to package a library in R 1.6.1 (Windoze XP).
I have read the document "Writing R extensions" and think I
have done things correctly (though apparently not).  I have
searched the mail archives for help to no avail.
I also posted a few days ago and thanks to Peter Dalgaard I have
managed to focus my search for errors.
I am trying to create a library in R.  I run the