ral dozen times,
reducing readability and increasing the chance of making some other
mistake. As originally mentioned, I'm lazy.
I did find a super-easy solution, posted here:
http://r.789695.n4.nabble.com/run-Rscript-and-ignore-errors-tc4706333.html#a4706395
Cheers!
Nick
>
> On Thu,
Basics: ##.#. ##.#.
> Live Go...
> > Live: OO#.. Dead: OO#.. Playing
> > Research Engineer (Solar/BatteriesO.O#. #.O#. with
> > /Software/Embedded Controllers) .OO#. .OO#.
> rocks...1k
&g
Hi R-help,
I've looked at google, the Rscript documentation and the Rscript --help
output and haven't found much on this. So, here's my question:
I have a rather long script that runs on various input datasets. It is
quite convenient to run the script from the Terminal command line with
"Rscrip
Hi R-help,
I've looked at google, the Rscript documentation and the Rscript --help
output and haven't found much on this. So, here's my question:
I have a rather long script that runs on various input datasets. It is
quite convenient to run the script from the Terminal command line with
"Rscrip
Hi all,
Hi have a series of scripts that print a lot of notes etc. to screen. I
have to run them on a massive set of input files. The scripts are
self-contained and save the important output to data files in an organized
way. I don't need the screen output for anything.
Problems:
- If I run th
.g. errors/warnings)
sink(file=con, type="message")
At the end of the script:
# Turn off output sink
sink()
# Turn off message sink
sink(type="message")
# Close connection to black hole
close(con)
On Thu, Jul 24, 2014 at 12:27 PM, Nick Matzke wrote:
>
> On Thu, J
On Thu, Jul 24, 2014 at 12:16 PM, Nick Matzke wrote:
> Hi all,
>
> Hi have a series of scripts that print a lot of notes etc. to screen. I
> have to run them on a massive set of input files. The scripts are
> self-contained and save the important output to data files in an orga
Hi,
This would be an issue with if() as well as if/else. ab$b has 4
numbers in it, so ab$b > 0 evaluates to "TRUE TRUE FALSE TRUE" or
whatever. if() can only take a single true or false. Cheers! Nick
On Tue, Nov 19, 2013 at 8:30 PM, Gary Dong wrote:
> Dear R users,
>
> I am a R beginner and I a
Hi,
I am plotting some labels that consist of strings in which
some words (but only some) should be in italics.
E.g.
"M3: Homo, 5 areas, 2 areas max"
"M4: Pan, 3 areas, 2 areas max"
I am putting these on the plot with the text() command. The
words "Homo" and "Pan" should be italicized, si
I have an R package, cladoRcpp, which is up on CRAN. After
a minor update, which compiled without errors on R CMD check
on my machine, I submitted the update.
Brian Ripley got an error that I didn't get:
==
We still see
> Rcpp_
Ooh, nice! Thanks!
Nick
On 6/16/13 8:42 PM, Gabor Grothendieck wrote:
On Sun, Jun 16, 2013 at 9:00 PM, Nick Matzke wrote:
Thanks *VERY* much, this is great!
I realized a few more cases, I think I've got something that covers all the
possibilities now:
library(stringr)
tmpstr = "
tern)[[1]])
# Return them
return(nums_from_tmpstr)
}
On 6/15/13 10:46 PM, arun wrote:
HI,
One way would be:
library(stringr)
tmpstr = "The first number is: 32. Another one is: 32.1.
Here's a number in scientific format, 0.3523e10, and
another, 0.
Hi all,
I have been beating my head against this problem for a bit,
but I can't figure it out.
I have a series of strings of variable length, and each will
have one or more numbers, of varying format. E.g., I might
have:
tmpstr = "The first number is: 32. Another one is: 32.1.
Here's a
Probably good enough, thanks!
Nick
On 1/20/13 2:03 PM, Duncan Murdoch wrote:
On 13-01-20 4:51 PM, Nick Matzke wrote:
Hi, here's an obscure question someone can hopefully help
with.
I have some R code that uses stuff from parallel (now a part
of the R core in 2.15 I believe), espec
Hi, here's an obscure question someone can hopefully help with.
I have some R code that uses stuff from parallel (now a part
of the R core in 2.15 I believe), especially clusterApply.
However, this seems to cause problems in R.app, and I've
seen advice to not use these multicore functions, e.g
Hi! Thanks for the replies, comments below:
On 6/20/12 3:26 AM, Oliver Ruebenacker wrote:
Hello,
For an optimization strategy, we need to know more: do you have many
variables? do you have many different formulae? do you re-calculate
after changing only one variable?
Take care
Hi all,
This question is slightly weird. I am trying to populate a
matrix with equations. The matrix represents transition
probabilities between states. A simple example is:
state1 state2 state3
state1 s d d*d
state2 e s d*e
state3 e*e e*d s
Th
Thanks very much!!
Nick
On 2/18/12 7:39 PM, baptiste auguie wrote:
Hi,
the grImport package provides some tools for this.
HTH,
b.
On 19 February 2012 16:06, Nick Matzke wrote:
Hi,
Is there a way to parse a postscript (*.ps) file with R (or perhaps with
some other command-line utility
Hi,
Is there a way to parse a postscript (*.ps) file with R (or
perhaps with some other command-line utility)?
E.g., I have a map in postscript format with lots of
features, but I just want to extract the coastline and it's
coordinates.
Any help very much appreciated! Cheers!
Nick
--
==
Hi,
Until recently I was using the knncat classifier function of
knncat on an old computer (2.12, Mac OS X 10.4), and
everything worked great.
However, now that I have updated to R 2.14.1 (on Mac OS X
10.7), knncat seems broken. Problems:
1. It seems to output verbose output by default,
A correspondant suggests it would help if I said the OS,
it's Intel Mac OS X 10.4...yes I should update but I'm
trying to hold off a little longer due to numerous other
things I don't want to have to reinstall just yet...
On 10/28/11 10:54 AM, Nick Matzke wrote:
Hi all,
I a
Hi all,
I am attempting to install a package called phylobase from
source directory. It all seems to work until the end, at
which point it looks like the last compile command fails
because the line is too long...perhaps because the g++
command line also includes "Loading ~/.Rprofile...", lik
7;,
configure.args="--with-geos-config=/usr/local/bin/geos-config")
library(rgeos)
# (You may have to remove old .o and .so files from previous
install attempts...)
On 10/25/11 1:09 PM, Nick Matzke wrote:
Hi all,
I have almost gotten rgeos to install, however I'm getting a
pe
Thanks!!
Nick
On 5/18/11 7:06 PM, Ista Zahn wrote:
Hi Nick,
See ?"::"
Best,
Ista
On Wed, May 18, 2011 at 10:02 PM, Nick Matzke wrote:
Hi,
If I load 2 packages that have a function with the same name, how do I tell
R to run one or the other?
(Instead of having R automatically use
Hi,
If I load 2 packages that have a function with the same
name, how do I tell R to run one or the other?
(Instead of having R automatically use the first- or
last-loaded one, whichever it is. (Which is it, by the way.))
Cheers!
Nick
--
==
Hi all,
I'm using the R GUI on a Mac. It is easy to produce a
number of plots and put them into a Quartz window, and then
use Command-left or Command-right to flip between them.
However, Quartz seems to hold a maximum of about 15 plots,
and then discards anything plotted before that.
This
Oh wait, this basically does it:
> if ("a" %in% attributes(z)$names)
+ print(TRUE)
[1] TRUE
(but there may be a better way)
Cheers!
Nick
On 2/2/11 7:20 PM, Nick Matzke wrote:
I am dealing with an object that sometimes has a certain
attribute, sometimes doesn't. How d
I am dealing with an object that sometimes has a certain
attribute, sometimes doesn't. How do I check for this?
"exists" doesn't work...
===
> z=c()
> z$a = c("c", "d", "f")
> z
$a
[1] "c" "d" "f"
> exists("z")
[1] TRUE
> exists("z$a")
[1] FALSE
===
.
Hi,
I've written a function which I load with a source command.
The function requires a certain library, phangorn, to work.
I would like the function to check if phangorn is loaded as
a library before running. For some reason, just putting
require(phangorn) into the sourced function doesn'
Hi all,
I am running R.app on Mac OS X 10.4. I am trying to figure
out if there is a .plist file of some sort, or a similar
parameter file, that will let me turn on and off e.g.
line-wrapping in the R.app GUI console.
The only hint I could find online is this:
https://stat.ethz.ch/pipermail
Thanks!!
David Winsemius wrote:
On Sep 10, 2010, at 4:05 PM, Nick Matzke wrote:
Hi,
Is there an easy way to convert numbers into a form such that they all
have the same number of digits?
e.g.:
"1", "10", and "100"
...become...
"0001", "0010
Hi,
Is there an easy way to convert numbers into a form such
that they all have the same number of digits?
e.g.:
"1", "10", and "100"
...become...
"0001", "0010", "0100" etc.
I ask because I am producing a large number of files that
need to sort consistently by filename. Currently I get t
Hi all,
I googled this but no luck.
I am using R.app 2.10.1 on Mac OSX 10.4.
Here's the problem:
When I type at the R.app command line and hit the carriage
return "Enter" (right pinky, "Return" on some keyboards), it
just adds a blank line.
To actually get the command to execute, I have to
Wow, did I stump everyone with this? Mostly I'd just like
to build a class without getting the error below.
Cheers!
Nick
Nick Matzke wrote:
Hi all! I'm trying to build a simple class, but I'm getting a weird error.
E.g. if I do:
==
gregion = setClass(&quo
Hi all! I'm trying to build a simple class, but I'm getting
a weird error.
E.g. if I do:
==
gregion = setClass("gregion", contains = "data.frame",
representation(name = "character", poly.x = "numeric",
poly.y = "numeric" ))
gregion$name = "North America"
==
Then I get thi
That's the answer, thanks!!
Nick
Peter Langfelder wrote:
c(as.matrix(data)) will not do it?
Peter
On Fri, Jun 4, 2010 at 5:47 PM, Nick Matzke wrote:
Hi,
This can't be hard, but I can't find the solution. I have a 380x380 data
frame of numbers. I would like to turn it into
Hi,
This can't be hard, but I can't find the solution. I have a
380x380 data frame of numbers. I would like to turn it into
a single column so I can do e.g. hist and mean on it without
writing my own function. There must be a simple function
for this, but I'm stumped -- reshape, dim, etc.
ists, you get a single list with 4 components.
If you want to make a list of objects, use
list_of_fits = list(fitJC1, fitJC2, fitJC3)
HTH,
Peter
On Wed, May 26, 2010 at 5:23 PM, Nick Matzke wrote:
Erik Iverson wrote:
Nick Matzke wrote:
Hi all,
If I would like to make a list of complex object
Erik Iverson wrote:
Nick Matzke wrote:
Hi all,
If I would like to make a list of complex objects -- in my case,
phylogenetic trees, but it could be e.g. statistical results from
something like lm, or whatever -- how can I put them into a list?
When I try the obvious methods, e.g. cat
Hi all,
If I would like to make a list of complex objects -- in my
case, phylogenetic trees, but it could be e.g. statistical
results from something like lm, or whatever -- how can I put
them into a list?
When I try the obvious methods, e.g. cat, append, list,
etc., I seem to get weird beha
day",
horizontal=FALSE,
scales=list(alternating=FALSE,
tck=c(1,0),
x=list(at=seq(r[1],r[2],by="hour"),
labels=format(seq(r[1],r[2],"hours"), format="%H"))),
panel=function(...) {
panel.fill(col="
Hi,
I have a simple task I can't figure out. I'd like to take
some measurements I made, e.g.:
year (y-axis)
1
2
3
4
5
6
counts (x-axis)
10
10
20
30
40
50
And then, make a barplot with the x-axis ticks (representing
the borders between years) between the bars.
However, barplot seems to fo
thanks!! was stuck in python brain.
Simon Blomberg wrote:
substr(x,1,3)
On Thu, 2010-03-04 at 21:32 -0800, Nick Matzke wrote:
Hi,
This has got to be easy, but for some reason the simplest things can be
the hardest to find help on in R.
How the heck do I subset a string?
e.g.,
x
Hi,
This has got to be easy, but for some reason the simplest things can be
the hardest to find help on in R.
How the heck do I subset a string?
e.g.,
x = "abcdef"
I just want the first 3 characters.
Cheers!
Nick
--
Nicholas J. Matzke
baptiste auguie wrote:
Hi,
What about this,
eval(parse(text=expr))
(no print)
HTH,
baptiste
Thanks. For some reason I couldn't think of that, for some reason I had
a dim memory in my head that that wouldn't work, but it does. Thanks!
Cheers,
Nick
2009/9/19 Nick Ma
Hi,
I have a script which I source, which evaluates a changing expression
call hundreds of times. It works, but it prints to screen each time,
which is annoying. There must be simple way to suppress this, or to use
a slightly different set of commands, which will be obvious to those
wiser t
David Winsemius wrote:
On Sep 15, 2009, at 5:47 PM, Nick Matzke wrote:
Hi all, a quick question I couldn't find the answer to in the usual
places:
Is there a way to turn off line-wrapping in the R console? Or set the
line width-before-wrapping manually? Currently it looks lik
Hi all, a quick question I couldn't find the answer to in the usual places:
Is there a way to turn off line-wrapping in the R console? Or set the
line width-before-wrapping manually? Currently it looks like the
console linewraps after about 70 characters, this occurs even if I
increase the w
Hi all,
I'm on Mac OS X 10.4...
So I've got a small python script I need to run from R. However, to get
the python script working, I need to have the shell that R calls get
settings from my .bash_profile file, which apparently it doesn't
currently (the shell R calls uses an older version of
Hi all,
Working at the R command line, how do I get strings to display e.g. tab
or newline characters as they should be displayed, rather than as e.g.
\n or \t?
e.g.:
> x="\t"
> x="\t"
> x
[1] "\t"
> print(x)
[1] "\t"
--
Nicholas J. Matzke
;b", "c", "a")
y
a b c
a 0 1 1
b 2 3 1
c 4 5 1
z <- y[ordered_list, ordered_list]
z
b c a
b 3 1 2
c 5 1 4
a 1 1 0
On Tue, Jan 27, 2009 at 3:26 PM, Nick Matzke wrote:
Hi all,
This can't be very hard, but it is sticking me because I am a beginner.
Setup:
x = rbind
Hi all,
This can't be very hard, but it is sticking me because I am a beginner.
Setup:
x = rbind(c(0,1,1), c(2,3,1), c(4,5,1))
y = as.matrix(x)
rownames(y) = c("a","b","c")
colnames(y) = c("a","b","c")
ordered_list = c("b", "c", "a")
How do I produce a new matrix, z, with the rows and column
Thanks!!! Best R list ever...
Cheers,
Nick
Barry Rowlingson wrote:
2009/1/23 Jorge Ivan Velez :
See ?.Last.value
But don't do that right after you've done the calculation! You get
*one* chance with .Last.value:
# here comes my important numbers...
> runif(10)
[1] 0.7685472 0.2301233
Hi,
Let's say one has just run a command line command that took an hour and
produced a huge matrix as an output. However, one forgot to store the
output in a variable.
Is there a hidden variable somewhere that stores the result, so that one
doesn't have to re-run the analysis for an hour?
54 matches
Mail list logo