> lambda=lambda1
> lbar=lbar1
> apple=eval(apple2)
> gradient=cbind(eval(D(apple2,'rec')),eval(D(apple2,'lambda')),
> eval(D(apple2,'lbar')))
> attr(apple.ana,'gradient')=gradient
> apple
> }
>
> fit.error=function(rec1,lambda1
or,
e.g. c(1:2, NA) promotes it to integer, c(3.14, NA) promotes it to numeric.)
More generally, I'd say reading the man page or the source is a better
way to find out about the requirements for the arguments of a function.
Duncan Murdoch
__
bort exiting when RGui asks me to save the workplace or not. Please help
> me out.
In Windows you can also abort execution by hitting Esc, or the menu
entry "Misc|Stop current computation".
Duncan Murdoch
__
R-help@stat.math.ethz.ch mailin
o
define a macro (e.g. \Gwidth) to give the default width, and then call
\setkeys{Gin}{width=\Gwidth}
at the start of your document and after any change like the one above.
Duncan Murdoch
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
function optimizes over the elements of the first parameter. You've
got two other parameters there, and I think you're trying to optimize
over them as well. Put them all into one vector.
The documentation for constrOptim doesn't make this as clear as it
should; I'll clarif
us)
I would include an explicit "dev.off()" after the plotting; I'm not sure
all devices guarantee a clean shutdown when R quits.
Duncan Murdoch
>
> --Gene
>
> On Fri, 7 Sep 2007, Duncan Murdoch wrote:
>
>> On 9/7/2007 12:36 PM, Gene Selkov wrote:
>>> I h
.1), RSQLite (>= 0.5-5), gsubfn"
>>
>
> packageDescription does not mention the packages DBI and proto.
They are part of the recursive tree-walking that Barry mentioned, i.e.
dependencies of RSQLite or gsubfn:
> packageDescription("RSQLite", fields="Depends"
bout the spot in the code where I can fix it.
The ?postscript man page suggests that
postscript(file="", command="cat")
should do what you want (or maybe something other than "cat" for the
passthrough). The file arg is described as a character string, not a
connect
ably correct me).
You could also look at Ross Ihaka's paper that is online here:
http://cran.r-project.org/doc/html/interface98-paper/paper.html
R was written in C, with the intention that it be Scheme-like.
Duncan Murdoch
__
R-help@stat.math.et
ne form or another. What were
> you proposing to use for this? As far as I know, R has no
> database relevant to street addresses!
But if the addresses are in the US and include zip codes, a database is
available online for free, here:
http://www.aggdata.com/files/zip_codes.zip
This includes
felse( x == 1, x + 1,
ifelse( x == 2, x,
NA) )
(where I've used NA for the case where x is neither 1 nor 2.)
Duncan Murdoch
>
> #Second example:
> x=c(1,2)
> t<-for(i in 1:length(x)){
> if (x==1){
> a=x
> b=x
ut I can't seem to make this work.
>>
>
> I'm not familiar with the Scode environment, but
>
>
> <>=
> ?HSP
> @
>
>
> does what you want.
>
Like Deepayan, I also use <<>>= notation, but this probably works
anywhere: put keep.
there are other ways to do this, but one that works is to use
\begin{frame}[containsverbatim]
at the start of each slide. This makes some other beamer features stop
working, but I forget which.
Duncan Murdoch
> Could you please see the file:
> http://www.mayin.org/ajayshah/tmp/bugdemo
ople you have to deal with are into astrology you should
> learn astrology?
I don't think astrologers have much use for data, but if some did and
wanted to hire me to analyze it, I think understanding their point of
view would help.
Duncan Murdoch
e+80i
> [9] 3.892581e+80-4.389625e+80i 3.136461e+80-3.536955e+80i
But watch out if you do this, because of the arbitrary choice of a root.
You get oddities like this:
> x <- complex(real = -1)
> x
[1] -1+0i
> 1/x
[1] -1+0i
> x^(1/3)
[1] 0.5+0.8660254i
> (1/x)^(1/3)
[1] 0.5
tistical calculations are data-reducing, ie, many-to-one.
>
> I don't think you are likely to find a language where you can change the
> confidence limits for the sample mean and have the data change in
> response.
But just think how much money you could make as a consultant if
definition of raising something to a
fractional power. The approach R takes to the latter is to define x^B
to be exp(B * ln(x)), and ln(x) is undefined for negative x.
Duncan Murdoch
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailm
lly changing "Standard" format to
"Text" *every time* I load the file. There's a help index entry "date
formats;avoiding conversion to", but it offers no more help than "add an
apostrophe at the beginning of the entry".
This is brain-dead behaviour
formats in the Windows
clipboard. If you can figure out what's there you should have access to
it from R using getClipboardFormats and readClipboard. I think the only
lobbying that would be needed would be to reveal the format, and that
may have already been done.
Duncan Murdoch
. There's a generic called "show" in the methods package. But
you can define your own function called "show", and in your workspace,
you'd want to call that, not the one from methods.
I'd recommend using setGeneric() to create a generic, rather than
depend
On 8/27/2007 8:52 AM, John Kane wrote:
> --- Duncan Murdoch <[EMAIL PROTECTED]> wrote:
>> I like the first, simple suggestion best; I'll put
>> it into R-devel.
>> (With the slight change to use ul.menu instead
>> of just ul, because FAQ 2.7 includes a pl
quired for the system to recognize this command?
What you list above should be sufficient.
Duncan Murdoch
> Found example "R CMD build --force --binary --auto-zip %1 pkgname" in
> search.R-project.org . What must be done so system can find
Deepayan Sarkar wrote:
> On 8/23/07, Duncan Murdoch <[EMAIL PROTECTED]> wrote:
>
>> On 8/23/2007 11:28 AM, Prof Brian Ripley wrote:
>>
>>> On Thu, 23 Aug 2007, John Kane wrote:
>>>
>>>
>>>> The FAQ Section 7 is a v
n me.
Duncan
>
> - Original Message
> From: Duncan Murdoch <[EMAIL PROTECTED]>
> To: Usman Shehu <[EMAIL PROTECTED]>
> Cc: r-help@stat.math.ethz.ch
> Sent: Sunday, 26 August, 2007 12:02:13 PM
> Subject: Re: [R] error message!
>
>
> On 26/08/2007 6:1
P
> environment.
You could try ?Rscript within R, or Rscript --help from the command line
(assuming you have R's bin directory on your path.
Duncan Murdoch
>
> Prof Brian Ripley a écrit :
>> Look into Rscript.exe (on Windows), which is a flexible way to run
>> scri
ose? Do
you get the same error if you choose a different one?
Duncan Murdoch
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
On 8/24/2007 11:14 AM, Dirk Eddelbuettel wrote:
> On Fri, Aug 24, 2007 at 10:57:46AM -0400, Duncan Murdoch wrote:
>> On 8/24/2007 10:33 AM, Dirk Eddelbuettel wrote:
>>> On Fri, Aug 24, 2007 at 08:32:00AM -0400, Duncan Murdoch wrote:
>>>> On 8/24/2007 6:58 AM, Ronald
On 8/24/2007 1:05 PM, Gabor Grothendieck wrote:
> On 8/24/07, Dirk Eddelbuettel <[EMAIL PROTECTED]> wrote:
>> On Fri, Aug 24, 2007 at 10:57:46AM -0400, Duncan Murdoch wrote:
>> > On 8/24/2007 10:33 AM, Dirk Eddelbuettel wrote:
>> >> On Fri, Aug 24, 2007 at 08
On 8/24/2007 10:33 AM, Dirk Eddelbuettel wrote:
> On Fri, Aug 24, 2007 at 08:32:00AM -0400, Duncan Murdoch wrote:
>> On 8/24/2007 6:58 AM, Ronaldo Reis Junior wrote:
>> > Hi,
>> >
>> > It is possible to use a shell command inside a R script?
>> >
>
an rename and move a file to a new directory,
as long as it's on the same drive. That should be as quick as a batch file.
Duncan Murdoch
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting
and available functions depend on the platform, but you want
to look at ?system, ?shell, and/or ?shell.exec. (These all exist in
Windows; on Unix-alikes, you probably won't have the latter two.)
Duncan Murdoch
__
R-help@stat.math.ethz.ch maili
on't see how to tell makeinfo --html to do this. Adding
--number-sections isn't enough.
Duncan Murdoch
>
>
>> An R-help list reply of "Read FAQ 7.10" in response to
>> a question about converting a factor to numeric is a
>> bit cryptic. The only tim
9786558
> my.fcn(10)
[1] 1.022467
You can't expect integrate() to return a sensible answer if you don't
give it a function that returns consistent results.
Duncan Murdoch
>
>> my.fcn = function(mu){
> + m = 1000
> + z = 0
> + z.mse = 0
> + for(i in 1:m){
nction
definitions without re-doing all the simulations in your project.
Duncan Murdoch
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and
ode, it's
not hard to recognize and merge changes to the .tex file back into the
Rnw file.
Duncan Murdoch
>
> Best,
>
> Renaud
>
> 2007/8/22, Werner Wernersen <[EMAIL PROTECTED]>:
>> Hi,
>>
>> I am very intrigued by the idea of integrating
>&
On 8/22/2007 3:20 AM, Gregor Gorjanc wrote:
> Arjun Ravi Narayan arjunnarayan.com> writes:
>> I am editing a document for submission to the R-news newsletter, and
>> in my article my Sweave code inserts a dynamically generated PDF
>> report that my R program generates.
>>
>
> Slightly off Arjuns
roducing
> a valid C language routine which can then be compiled by R CMD COMPILE and
> dynamically loaded.
As a matter of fact, one of Oleg's examples is an image filter.
Duncan Murdoch
>
> (Of course, it can get more complicated than just inserting a single text
> fragment!)
>
&
et.
>
> i intend to do it inside a loop, using a new object (and hence, a new
> name) for each iteration (i.e., instead of a$x, it would be a$1, a$2,
> a$3, and so on, for a million times).
>
> i would greatly appreciate it if someone could help me on this iss
ion, R will ignore variables that are not
functions. So what you show above is not an error, though it can be
confusing, so it's not a good idea.
Duncan Murdoch
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
.
>
> Moreover, my question is still somehow un-answered: Is there any existing
> ANTLR-based parser for R? I understand that in omegahat.org project, people
> used ANTLR for RSJava, but i am not sure if that had anything to do with an
> R-parser.
I doubt it. The parser f
ng value where TRUE/FALSE needed
>
You should address questions about contributed packages to the
maintainer of the package, in this case Diethelm Wuertz and Rmetrics
Core Team <[EMAIL PROTECTED]>.
Duncan Murdoch
__
R-help@stat.math.ethz.ch mai
for some
specialized stuff (e.g. medical imaging).
> 3) Any other software I need to learn that would make my work in R
> more productive? (for example, a code editor).
A lot of people are happy with ESS mode in Emacs.
Duncan Murdoch
__
R-h
.
It's then possible (but not easy) to propagate these ranges through
transformations.
Duncan Murdoch
> Any thoughts?
> Pieter
>
> --
> This message was sent on behalf of [EMAIL PROTECTED] at openSubscriber.com
> http://www.
r) {
> if (label(var) !="" )
> res <- label(var)
> else res <- names(data.frame(var))
> return (res) }
Use "else res <- deparse(substitute(var))" as the 4th line
to write C code to
do the work.
Duncan Murdoch
> Thanks
>
> Felipe D. Carrillo
> Fishery Biologist
> US Fish & Wildlife Service
> Red Bluff, California 96080
>
> __
> R-help@stat.math.ethz.ch mailing list
> https:/
", pch=16)
>
> and got the following error message:
>
> Error in xyz.coords(x, y, z) : 'x', 'y' and 'z' lengths differ.
>
> Does anyone know how I can use this function in the scatterplot3d package?
try
my.3dplot$points3d(x=400, y=600, z=0.19,
rom them than from
us --- but that doesn't mean you shouldn't try. Perhaps when anyone
searching for "Mac OSX Preview" on Google shows up a page full of
unhandled bug reports they'll actually do something.
Duncan Murdoch
>
> On Aug 13, 2007, at 9:56 AM, Dunca
x27;t a bug, why did it bother you so much? And why do you think
it's reasonable to complain about it on R-help, but not to complain
about it to Apple, who are clearly responsible for it?
Duncan Murdoch
>
> On Aug 13, 2007, at 9:30 AM, Duncan Murdoch wrote:
>
>> On 8/1
7;m not yet ready to drop Preview from my toolbox.
An alternative to dropping Preview is to report the bug in it to Apple.
Apple has an online bug reporting web page somewhere; I haven't found
them as helpful as R-help, but your mileage may vary.
Duncan Murdoch
_
Michael Kubovy wrote:
> On Aug 12, 2007, at 6:24 AM, Duncan Murdoch wrote:
>
>
>> Michael Kubovy wrote:
>>
>>> Dear r-helpers,
>>>
>>> In my previous message there were comments in the code that may
>>> have made cutting and
wed up.
>
> Your help will be highly appreciated!
coef(a) will get what you want. coef() works for most modelling
functions where it makes sense.
Duncan Murdoch
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-hel
>
What artifacts do you see? It looks like a smoothly varying field when
produced by R 2.5.1 and viewed in Acrobat Reader 6.0 on Windows.
Duncan Murdoch
> require(grDevices)
> imSize <- 200
> lambda <- 10
> theta <- 15
> sigma <- 40
> x <- 1:imSize
> x
you don't export the functions, they won't normally be visible
outside your package, but you can still use the ":::" notation to get
them, e.g.
mypackage:::myfunction
gets myfunction even if it was not exported.
Duncan Murdoch
__
R-
in+intercept.min),2)
>
> round(res.600nm,2)
> round(10^(two.points.min*-0.71+1.5),2)
The convention in the lm() function is to express a model as
response ~ predictor. So you should expect
round(ov.mag.min,2) == round(10^(log(res.600nm,
10)*slope.min+intercept.min),2)
not the
actually be stored as 0.499 and round(x)
should return 0 even using roundup().
Duncan Murdoch
> In this context you cannot leave rounding until the end of course! Clearly
> in
> an arithmetic context, rounding should always be left to the end but I don't
> think that
with above command
In English the spelling is "cumulative", but the help.search() function
can find the answer with small misspellings:
help.search("commulative sum")
yields cumsum as the answer.
Duncan Murdoch
> Thanks
>
>
> Zahid Khan
> Lecturer in S
he association as
"F:\R\R-2.5.1\bin\Rgui.exe" --args "%1"
(with obvious modifications to the path) and put this line in your
RHOME/etc/Rprofile.site file:
utils::file.edit(commandArgs(TRUE))
You could make things more sophisticated if you don't want a blank edit
wind
mary(x))
into your file, then
cmds <- parse(file="garbage.R", n=NA)
as in Andy's suggestion. Then find the dividing line using
divider <- which(unlist(lapply(cmds, deparse)) == "divider")
and then
part_one <- 1:(divider-1)
part_two <- (div
collect(): should it really try to go
into the base environment and delete the c object? That would be fairly
disastrous if it succeeded. But if it found a c() function in the
global environment, removing it from there might be sensible (maybe even
if this rename request were executed from a
ewname, get(oldname))
# delete the old object
rm(list=oldname)
}
The code above should work in simple cases where you run it in the
console and it works on objects in the global workspace. If you want to
write a function to do this things get more complicated, because you
want to make
do nothing when you see the null
ptr, as you do below?
By the way, questions about programming at this level are better asked
in the R-devel group.
Duncan Murdoch
> Best regards
>
>
> Jens Oehlschlägel
>
>
> // C-code
>
> static void rindex_finalize(SEXP extPtr){
>
lig (perhaps
because you used fix(zelig) to make a small change to the existing one),
your line above would call yours, not the original.
Duncan Murdoch
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
and than tried to implement this in the text3d:
>
> text3d( c(Anth_cap,
> Anth_crin,
I think all you need is
text3d(PCoA, text=Nam)
but you might want to set the adj argument if you want the labels offset
from the points, and you might want type="n" in the original plot3
On 19/07/2007 7:41 PM, runner wrote:
> It is ok to bury a reg expression '\n' when using 'cat', but not 'paste'.
> e.g.
>
> cat ('I need to move on to a new line', '\n', 'at here') # change line!
> paste ('I need to move on to a new line', '\n', 'at here') # '\n' is just a
> character as it is.
>
t just because I
> have 3.5 million cases to read in.
If you have 3.5 million cases to read, you should specify the column
classes. I'd recommend setting nrows to a small number for a few tries
first, until you get it right.
Duncan Murdoch
_
vector with a named entry. You can do calculations with
it without stripping off the name.
Duncan Murdoch
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.
lines of R code. Any suggestions?
Even though it's not very informative, that really is the source for
that function. For instructions on how to see the more useful stuff,
see Uwe Ligges' article in the Oct 2006 R News (available at
http://cran.
# input: a vector and the
>> first
>>>> index (1), Stack=c(), Indexes=c().
>>>>> {
>>>>> print(Indexes)
>>>>> # if (sum(i)==0) break # Doesn't work...
>>>>if (sum(i)==0) return(NULL)
>>>>
>>>
)
>>
>>> Here is a function which almost works. It is for inorder-tree-
>> walk.
>>> iotw<-function(v,i,Stack,Indexes) # input: a vector and the first
>> index (1), Stack=c(), Indexes=c().
>>> {
>>> print(Indexes)
>>> # if (sum(i)
tack,Indexes) # input: a vector and the first index (1),
> Stack=c(), Indexes=c().
> {
> print(Indexes)
> # if (sum(i)==0) break # Doesn't work...
if (sum(i)==0) return(NULL)
should work.
Duncan Murdoch
>
> if (is.na(v[i])==FALSE & is.
he
element, the latter works on a subset. So your version tried to change
a subset of length 1 into a subset of length 2, which generates the
warnings. You want to assign a list of length 2 as an element of minbins.
Duncan Murdoch
>
> And it doesn't work ...
> Warning messages:
t of the second if is NULL. That's what your function returned.
If you had wrapped those calls in return() you'd get what I think you
expected:
if (type=="est1") return(est1(x,y))
if (type=="est2") return(est2(x,y))
because the return() causes the function to ex
hin
f1, e.g.
f1<-function(...){
nm1 <- something
f2 <- function (...) {}
result1<-f2(nmArg1=nm1)
...
}
(which is the best way to do it), or you could explicitly manipulate the
environment of f2 (which is an ugly way), or you could store nm1 in some
place that's visib
other person. How can I do that?
This will depend on the system you're using. If the command "emailit"
would work from the command line on your system, then
system("emailit")
should work from within R. Writing that command
you want to help to make it happen, I'd
suggest working to add it to the GL2PS project
(http://www.geuz.org/gl2ps) and then it should be automatically
incorporated into the rgl package.
Duncan Murdoch
__
R-help@stat.math.ethz.ch mailing list
htt
n! copies of it onto a
cube, and use adapt to integrate over that.
That is: if f() is your function, defined on 0 < x[1] < x[2] < ... <
x[n] < 1, define g <- function(x) f(sort(x)), and the integral you want
is (1/n!) times the integral of g over the unit cube.
Duncan Murdoch
m arguments to
plot() to change the range. For example,
plot(ecdf(x), do.points=FALSE, verticals=TRUE, xlim=c(1, max(x)),
ylim=c(1-sum(x>1)/length(x), 1))
Duncan Murdoch
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo
contacting Dr. DuMouchel to see if he is willing to let
you have his S code.
Duncan Murdoch
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide
er. Proceeding from smallest to largest, if
you see a black i, duplicate the i'th element in the current version of
the sequence.
For example, if k=5, n=4, you might draw red 2, 3 and black 1, 2, so
you'd build your sequence as
2 3
2 2 3
2 2 2 3
or you might draw red 1, 4, 5 and black 2, so you'd output
1 4 4 5
Duncan Murdoch
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
#x27;s why I wanted to know if there was a way to
> improve the function call - I think there isn't.
But on Linux you can just use "the system man pages", as ?tcltk tells
you. (And by the way, tkgetOpenFile opens a reasonably nice window for
me when run on
is?
See the repos option in ?options, or ?setRepositories.
Duncan Murdoch
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commen
/doku.php?id=rdoc:tcltk:tkcommands
Thanks, Philippe. That's a useful function.
Duncan Murdoch
> Best,
>
> Philippe Grosjean
>
> ..<°}))><
> ) ) ) ) )
> ( ( ( ( (Prof. Philippe Grosjean
> ) ) ) ) )
&
his, but a GUI menu with more than a few
entries is just unwieldy.
We do have a text reference to the help files in the ?tcltk topic.
Duncan Murdoch
>
> Cheers, Mike
>
>
> Mike Prager wrote:
>> "Alberto Monteiro" <[EMAIL PROTECTED]> wrote:
>>
>>
ndows (assuming
Mac OSX counts as an *ix), and TCL and TK help files are distributed
with R. See RHOME/Tcl/doc. He'll still have the problem of converting
TCL/TK documentation conventions into their R equivalents, but I think
you've given reasonable documentation on how to do t
ks
You don't say what is going wrong, but I suspect your problem is that
you're not printing matrix.merge2. Listing a variable name on a line by
itself only causes it to be printed when you're typing at the console,
not when it's a line in a function or a line sourced from
failed for 'mypkg'
> Execution halted
>
> It looks like this package has a loading problem: see the messages for
> details.
>
> Here is the mypkg.R file
> sss <- "/home/hodgesse/Desktop/R-2.5.1"
> .First.lib <- function(lib=sss,pkg="mypkg")
>
I
create a gzipped version of a write.table output and run
for(i in 1:1000) read.table(gzfile(f))
in R 2.5.0 I don't see a problem. This is on Windows, but I doubt that
makes a difference.
Duncan Murdoch
__
R-help@stat.math.ethz.ch mailing lis
On 7/3/2007 10:23 AM, Ivan Baxter wrote:
>
> Duncan Murdoch wrote:
>> On 7/3/2007 1:59 AM, Ivan Baxter wrote:
>>> I am having trouble printing a table out to the GUI display when the
>>> table is created and printed within a loop.
>>>
>>> I
I can print
> out the last iteration of the table.
You should simplify your loop until it's something you can post for us
to try. Chances are you'll notice the error when you do that, but if
not, someone else will be able to tell you what's going on.
Without a reproducibl
s well known by people who've been
bitten by it.
Duncan Murdoch
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented
ng
> elements of x.' (emphasis added)
>
> floor(3) == 2
> >True
3 is not greater than 3, but it is greater than 2, so the result you
quote above is wrong. You should see
> floor(3)
[1] 3
> floor(3) == 2
[1] FALSE
Do you rea
s parameter, it still
> complains about "mylab" does not exist. It seems that it consider
> mylab as package instead of its value.
One of the examples in ?library shows how to do what you want.
pkg <- "splines"
library(pkg, character.only = TRUE)
Duncan Murdoch
>
you don't want it, specify
row.names=FALSE (and do the same when you write subsequent lines).
Duncan Murdoch
>
> " blank <- data.frame(name=character(0), wife=character(0),
> no.children=numeric(0))
> write.csv(blank, 'file.csv')"
>
> Thank
esults, so
write.csv will work.
Create a data frame with 0 rows, and write it out: this will give you
your header line.
e.g.
blank <- data.frame(name=character(0), wife=character(0),
no.children=numeric(0))
write.csv(blank, 'file.csv')
Now you can rbind new lines onto the
columns are characteristics, until I found they were too slow:
and then I'd consider temporary conversion to a matrix to speed things
up. As Knuth said, premature optimization is the root of all evil.
Duncan Murdoch
__
R-help@stat.math.ethz.ch
se, so that's likely your
problem. You might have better luck with
log1p(tasa)
if the authors of the Matrix package have written a method for log1p();
if not, you'll probably have to do it yourself.
Duncan Murdoch
__
R-help@stat.math.ethz
ar pros and cons of each approach?
If rbind or cbind work, use them. They are much simpler, but much less
flexible.
Duncan Murdoch
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting gui
On 21/06/2007 7:39 PM, Judith Flores wrote:
> Hi,
>
>I need to add exponents to a label in one of the
> axes of a plot, how can I do this?
See ?plotmath. For example,
plot(1,2, xlab=expression(x^2), ylab=expression(exp(-x^2/2)))
Du
like to know how could I utilize the object chara , and to
> use the characters it contains as the name of the slot of try1.
You can use
slot(try1, chara) <- matrix("", 3, 4)
as long as the slot name contained in chara really is a slot.
Duncan Murdoch
> (that is because condition 'A' might be called again and could be different
> in
> it's T/F state from previous calls).
Simply make a function that does what you want:
modifyx <- function(x, A) {
if (A) x[-1] <- 0
else x[-2] <- 0
x
}
then call
1 - 100 of 1536 matches
Mail list logo