Displaying 20 results from an estimated 3000 matches similar to: "specify lattice black-and-white theme"
2009 Oct 12
3
xyplot does not find variable in data
When we call a lattice function such as xyplot, to what extent does
the "data" designation cause the function to look inside the "data"
for variables?
In the examples below, the "subset" argument understands that
"Variety" is a variable in the data.
But the "scales" argument does not understand that "nitro" is a
variable in the data.
2009 Jul 26
1
obtain names of variables and data from glm object
Suppose we have some glm object such as:
myglm <- glm( y ~ x, data=DAT)
Is there an elegant way--or the "right way" within the R way of thinking--to
obtain the names of the response variable, the predictor variables, and the
dataset, as character strings?
For instance, suppose the "right way" was to use the (currently fictitious)
functions theresponse(), thepredictors(),
2009 Oct 10
1
lattice auto.key drop unused levels
The following code produces a legend ("key") that mentions the unused
levels of Block.
library(MEMSS)
xyplot(yield~nitro, subset=(Block=="I" | Block=="II"), data=Oats,
group=Block, auto.key=T)
and adding "drop.unused.levels=T" does not fix it. And in fact even
the following does not solve the problem:
xyplot(yield~nitro,
2009 Aug 05
4
multiple lty on same panel in xyplot
I would like to use lattice graphics to plot multiple functions (or groups
or subpopulations) on the same plot region, using different line types "lty"
or colors "col" to distinguish the functions (or groups).
In traditional graphics, this seems straightforward: First plot all the data
using 'type="n"', and subsequently execute a series of "points"
2009 Aug 07
1
lattice: simultaneously control aspect & outer whitespace
Suppose we wish to achieve the following three aims:
(1) Control the aspect ratio of our plot (i.e., tweak this till it looks
great)
(2) Save the plot as a PDF with zero or minimal white space outside it.
(3) Preserve this in code, so that in the future the exact same plot can be
reproduced by simply sourcing the code.
I can almost achieve (1) and (2) on my MacBook Pro by pointing and clicking,
2009 Aug 03
3
session logging
Consider all the text that one sees on the console during an R session.
Is there a way, within R, to make all this text--both the "output" and the "messages"--automatically get copied to a single text file, in addition to seeing it on the console?
If I remember to save the console to a file at the end of my R session, that does it. But
(1) That requires pointing and
2008 Jul 17
2
nested calls, variable scope
Below is an example of a problem I encounter repeatedly when I write functions. A call works at the command line, but it does not work inside a function, even when I have made sure that all required variables are available within the function. The only way I know to solve it is to make the required variable global, which of course is dangerous. What is the elegant or appropriate way to solve
2009 Oct 28
3
variable labels to accompany data.frame
Often it is useful to keep a "codebook" to document the contents of a dataset. (By "dataset" I mean
a rectangular structure such as a dataframe.)
The codebook has as many rows as the dataset has columns (variables, fields). The columns (fields)
of the codebook may include:
? variable name
? type (character, factor, integer, etc)
? variable label
2013 Dec 02
2
plus/minus +/- in factor; not plotmath not expression
I want to put the "plus or minus" symbol into a character variable, so that this can be turned into a factor and be displayed in the "strip" of a faceted ggplot2 plot.
A very nice solution, thanks to Professor Ripley's post of Nov 16, 2008; 3:13pm, visible at http://r.789695.n4.nabble.com/Symbols-to-use-in-text-td874239.html and subsequently
2007 Oct 05
3
Mac GUI and .Renviron
The .Renviron and .First functions do not seem to work the same way on a
Mac OS 10.4 as on a Windows XP machine.
From working in Windows I am used to creating a new directory for each
data analysis project. In the new directory I place
First, an .Renviron file consisting of the following text:
R_HISTFILE="history.txt"
R_HISTSIZE=1000000
Second, an .RData file containing a .First
2009 Oct 27
2
Porting Custom Packages from Linux to Windows
On my linux workstation I have a nice, very little project in a
directory called "mystuff"
I installed "mystuff" into site-library with R CMD build, R CMD check
and R CMD install. This was all with the file mystuff.tar.gz.
Now I want to install "mystuff" on my windows workstation. Can I use
the same file mystuff.tar.gz. Do I need to do something different with
R
2009 Jul 12
11
get DB data to rhtml file
I am trying to get data out of a database to my rhtml file. The files
look like this:
Model
-------
mystuff.rb
class Mystuff < ActiveRecord::Base
set_table_name "mytable"
set_primary_key "id"
end
Controllers
--------------
mystuff_controller.rb
require ''Mystuff''
class MystuffController < ApplicationController
def read
@me =
2002 Jul 02
1
subscript out of bounds
Hello
As I'm beginning to write functions, I decided to have my personnal R library
named MyStuff located in /home/fred/R.Lib/MyStuff/
The library file itself is at /home/fred/R.Lib/MyStuff/R/MyStuff
evrything seems ok since
> library()
gives :
Packages in library `/usr/lib/R/library':
KernSmooth Functions for kernel smoothing for Wand &
2007 Nov 22
2
Wayward Directories
Seems that any program that has a default data directory, or previously
selected directory preserved, has the directory duplicated/nested:
That data is in c:\mystuff\mydata
It is shown as c:\mystuff\mydata\mydata
The files appear and maybe can be read. Any attempt to write produces an error
(obviously, there is no such directory). Some programs will crash/abort wine
trying to navigate this
2007 May 14
2
How to write data to astdb?
Hello,
I'm trying to fill CID data into the astdb using AsteriskWin32's
asterisk.exe, to no avail: The batch file stops after the first line, and
just waits:
----------------------------------------
rem c:\cygroot\mystuff>import.bat
rem
rem c:\cygroot\mystuff>C:\cygroot\bin\asterisk.exe -rx 'database put
cidname 123 "My cellphone"'
rem
rem Asterisk module
2007 Nov 29
1
Wireframe graph: black and white shading instead of color
All,
The code below produces a color 3D graph. I'd like to make it black and
white shading. I tried setting col.regions to FALSE but this just made it
completely white. I want the graph to look exactly as is, except black (or
grey) and white shading. Is this possible?
Cheers,
David
p.list = c(.01, .1, .25, .5, .75, .9)
cov.list = c(.2, .1, .05) ### leave out .01
X = rep(p.list, 3)
2005 Oct 21
3
Problems with example(Grid) in grid package
The following:
library(grid)
grid.newpage()
example(Grid)
has the yaxis label partly cut off and the x axis label does not appear at all.
Also ?grid.multipanel in that example brings up documentation for
grid-internal but this would not seem to be internal if its part of an example.
I am using:
> R.version.string # Windows XP
[1] "R version 2.2.0, 2005-09-20"
2011 Nov 16
1
Deleting a mailbox and all its children
I'm looking at scripting a mechanism to delete a mailbox, which is easy
with 'doveadm mailbox delete' -- however it gets complicated when there
are children of arbitrary depth, for example, I may have this:
restored.daily1.INBOX
restored.daily1.Sent
restored.daily1.Mystuff
restored.daily1.Mystuff.foo
I would like to delete the 'restored' mailbox and all its children (and
2002 Feb 11
1
problem getting just a single dir !
I am trying to fetch a single dir using the following command but all I
get is a empty dir:
rsync -av www.myServer.com::myStuff --include=myDir --exclude=* .
Here is the rsync output:
receiving file list ... done
myDir/
./
wrote 119 bytes read 392 bytes 92.91 bytes/sec
total size is 0 speedup is 0.00
The command looks simple and straight forward but somehow I am not
getting the expected
2003 Jul 14
2
Multipanel weighted regression lines.
Dear R-users,
I am trying to create a multipanel scatter plot which displays weighted
regression lines for each subgroup. I am having diffuculty figuring out
how the Trellis multipanel plotting functions work, in general. Does
someone know where there are some beginners examples on how to create
and use panel.xxx functions in conjunction with the xyplot functions?
Back to the matter at hand