Skip to content

Can't install Sweave

8 messages · Rainer Schuermann, huang min, Gavin Simpson +2 more

#
Hi there!

I tried to work with Sweave, assuming that it is part of the standard installation - which it was not for my system. Trying to install, it gives me this error message:
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
  package ?Sweave? is not available

My system data are:
R version 2.12.0 (2010-10-15)                                                                                             
Platform: x86_64-pc-linux-gnu (64-bit)                                                                                    
                                                                                                                          
locale:                                                                                                                   
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C                                                                              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8                                                                    
 [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8                                                                   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                                                                                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C                                                                            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C                                                                       
                                                                                                                          
attached base packages:                                                                                                   
[1] stats     graphics  grDevices utils     datasets  grid      methods                                                   
[8] base                                                                                                                  
                                                                                                                          
other attached packages:                                                                                                  
[1] reshape_0.8.3 plyr_1.2.1    proto_0.3-8                                                                               
                                                                                                                          
loaded via a namespace (and not attached):                                                                                
[1] ggplot2_0.8.8

Any idea what I need to do?

Thanks a lot,
Rainer
#
On Sat, 2010-12-11 at 14:07 +0100, Rainer Schuermann wrote:
Why do you think it wasn't installed? There is no package "Sweave".

Sweave() is a function in package "utils", which you session info
indicates you have and is loaded.

Care to tell us what you want to do with Sweave and why you think it
isn't working?

HTH

G

  
    
#
Oops - this is embarrassing!

I promise I have done a lot of research before I posted the question but I got the info wrong and didn't realize that it's a function, rather than a package...

Sweave.sty is not in my latex folder, will take care of that right now (I thought an "installation" would be the right way to get that done!) and keep quiet if thinks work nicely after that.

Thanks for pointing me in the right direction (also to Hung Min)
Rainer
On Saturday 11 December 2010 14:24:24 you wrote:
#
On 11/12/2010 8:41 AM, Rainer Schuermann wrote:
You shouldn't do that.  It will work until Sweave.sty is updated, then 
cause you hard-to-debug problems.

Use R utilities (e.g. tools::texi2dvi, or ones from a contributed 
package) to run latex, and they will point to the current Sweave.sty. 
If you put a copy of Sweave.sty into your latex installation, in a few 
months you'll have an obsolete version, and things will just not work.

Duncan Murdoch
#
On Saturday 11 December 2010 14:54:39 Duncan Murdoch wrote:
A link from ly latex installation to the original file in my R installation would do fine? It works, but is there a downside I wouldn't know?

Background is that I want to use kile for editing my .Rnw file (which will be more text than calculation), with the convenience of having the .Rnw and the .tex file (and the .bib file) all in one window, with an integrated Konsole window at the bottom.

Thanks,
Rainer
#
Is it a good idea to put Sweave.sty and other style files into CTAN as
a LaTeX package? (instead of pointing the users to file.path(R.home(),
'share', 'texmf') each time they run into troubles)

Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Sat, Dec 11, 2010 at 7:54 AM, Duncan Murdoch
<murdoch.duncan at gmail.com> wrote:
#
On 11/12/2010 11:18 AM, Rainer Schuermann wrote:
The link may break when you re-install R, but the link is probably safer 
than making a copy.
I don't know that editor, but I would suggest that most of the time you 
don't really want to look at the .tex file.  Changes there get wiped out 
the next time you run Sweave.

What I do is to write a simple command for my editor that does the three 
steps Sweave, latex/pdflatex, preview all in one command.  I wrote a 
little R package that helps with this; it's called patchDVI, available 
on R-forge.  Using that package the command is

echo patchDVI::SweaveMiktex('%2', preview='yap -1 -s"%1%2" \x25s') | 
Rterm --slave

or

echo patchDVI::SweavePDF('%2', stylepath=FALSE, 
preview="f:/SumatraPDF/SumatraPDF \x25s") | Rterm --slave


The previewer gets links back to the .Rnw file.

This still requires looking at the .tex file to understand LaTeX errors; 
one day I'll patch those too, but haven't got around to it yet.

Duncan Murdoch