Berwin Turlach has pointed out that to
be equivalent to the original answer the
code should be:
plot(a, ylim = range(a) * (1 + 0.06 * c(-1,1)))
On Fri, Jan 9, 2009 at 2:22 PM, Gabor Grothendieck
wrote:
> Or even:
>
> plot(a, ylim = range(a) + 0.06 * c(-1, 1))
>
>
> On Fri, Jan 9, 2009 at 2:07 PM
Use the "bubble" command in gstat.
-Roy M.
On Jan 9, 2009, at 5:58 PM, t c wrote:
Dear R help list,
I am working on some data from a study on the habitat use and
movement patterns of fish using a marine protected area in Hawaii.
We have a number of acoustic receivers in a MPA, and any tim
Dear R help list,
I am working on some data from a study on the habitat use and movement patterns
of fish using a marine protected area in Hawaii. We have a number of acoustic
receivers in a MPA, and any time a tagged fish passes within range it records
the date and time of detection. I am t
Dylan Beaudette wrote:
Subsequent calls to:
conn <- dbConnect(PgSQL(), host="localhost", dbname="xxx", user="xxx")
query <- dbSendQuery(conn, query_text)
res <- dbGetResult(query)
are resulting in this:
*** glibc detected *** /usr/local/lib/R/bin/exec/R: realloc(): invalid
other attache
Thanks Kingsford. I thought the column power was supposed to be just for
that column but you're probably correct. English has its oddities
because if one reads the actual sentence the person wrote it's still not
clear, atleast to me.
"Actually I want to have a matrix with p columns such that
On Fri, Jan 9, 2009 at 6:36 PM, wrote:
> Charlotte: I ran your code because I wasn't clear on it and your way would
> cause more matrices than the person requested.
Bhargab gave us
x<-c(23,67,2,87,9,63,8,2,35,6,91,41,22,3)
and said: "I want to have a matrix with p columns such that each
c
Hi all-
I am stumped. The code in A. returns errors at lines 14 and 15 and fails
to load series1 and series2. However, in B., if temp1 and temp2 are
called again (which returns a "Table exists" error; see lines 14-17 in
B.) series1 and series2 load correctly. Any ideas? Also-I am open to any
Dear Sarah and Glenn,
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On
> Behalf Of Sarah Goslee
> Sent: January-09-09 7:32 PM
> To: glenn
> Cc: r-help@r-project.org
> Subject: Re: [R]
>
> Hi Glenn,
>
> On Fri, Jan 9, 2009 at 7:20 PM, gle
Charlotte: I ran your code because I wasn't clear on it and your way
would cause more matrices than the person requested. So
I think the code below it, although not too short, does what the person
asked. Thanks though because I understand outer better now.
temp <- matrix(c(1,2,3,4,5,6),ncol=2)
On Fri, Jan 9, 2009 at 7:42 PM, Charlotte Wickham
wrote:
> .Last.value
Oh, right. Thanks.
Sarah
--
Sarah Goslee
http://www.functionaldiversity.org
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the
> comparable to S-Plus and SAS, not withstanding Milley's snide comment. But
> if you want to attack the chronic and painful productivity problems with
> data preparation and statistical table production, you need to go beyond R
> and SAS.
What are these problems?
Hadley
--
http://had.co.nz/
_
>> (2) mathematica has a term (%) that when typed means the last returned
>> value, so > % + 1 say would return the last outputted value +1 .is there
>> an R equivalent please?
>
> I don't think so - you need to assign that value to something to be able
> to reuse it.
.Last.value
Charlotte
___
One of those more elegant ways:
outer(x, 1:p, "^")
Charlotte
On Fri, Jan 9, 2009 at 4:24 PM, Sarah Goslee wrote:
> Well, mat doesn't have any dimensions / isn't a matrix, and we don't
> know what p is supposed to be. But leaving aside those little details,
> do you perhaps want something like th
Hi Glenn,
On Fri, Jan 9, 2009 at 7:20 PM, glenn wrote:
> Very simple questions if anyone can help:
>
> (1) what is the value in saving workspaces, which is offered at every close?
> I thought it might save the set up of the GUI but I cant work out what it
> does I run a script that loads the pa
Well, mat doesn't have any dimensions / isn't a matrix, and we don't
know what p is supposed to be. But leaving aside those little details,
do you perhaps want something like this:
x<-c(23,67,2,87,9,63,8,2,35,6,91,41,22,3)
p <- 5
mat<- matrix(0, nrow=p, ncol=length(x))
for(
Very simple questions if anyone can help:
(1) what is the value in saving workspaces, which is offered at every close?
I thought it might save the set up of the GUI but I cant work out what it
does I run a script that loads the packages I need at the start of every
session.
(2) mathematica has a
Try:
> mapply( seq, from=1:4, to=7:10 )
[,1] [,2] [,3] [,4]
[1,]1234
[2,]2345
[3,]3456
[4,]4567
[5,]5678
[6,]6789
[7,]789 10
Is that what you want?
--
Gregory (Greg) L. Snow Ph.D.
You may also want to look at the label function (and friends) from the Hmisc
package. This gives a way to use short, "correct" names for the variables, but
have a longer, more descriptive label to use in plots.
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
gr
Try this (replace the 0:9 with your values):
> distfun <- approxfun( c(-Inf,0:9), seq(0,1,length=length(0:9)+1),
> method='constant', rule=2)
> distfun( c(-1,0,3,3.4,4,12) )
Does that do what you want?
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@
Hi,
Can any one please explain why the following code doesn't work? Or can anyone
suggest an alternative.
Suppose
x<-c(23,67,2,87,9,63,8,2,35,6,91,41,22,3)
mat<-0;
for(j in 1:length(x))
{
for(i in 1:p)
mat[i,j]<-x[j]^i;
}
A
On Fri, Jan 9, 2009 at 4:28 PM, Wacek Kusnierczyk
wrote:
> Rau, Roland wrote:
>>
>> P.S. Any suggestions how to become more proficient with regular
>> expressions? The O'Reilly book ("Mastering...")? Whenever I tried
>> anything more complicated than basic usage (things like ^ $ * . ) in R,
>> I w
Hi,
Subsequent calls to:
conn <- dbConnect(PgSQL(), host="localhost", dbname="xxx", user="xxx")
query <- dbSendQuery(conn, query_text)
res <- dbGetResult(query)
are resulting in this:
*** glibc detected *** /usr/local/lib/R/bin/exec/R: realloc(): invalid
pointer: 0x0a605de4 ***
=== Backt
On Fri, Jan 9, 2009 at 4:20 PM, Wacek Kusnierczyk
wrote:
>
>> Duncan Murdoch wrote:
>>
>>>
>>> I'm curious about something: does "file extension" have a standard
>>> definition? Most (all? I haven't tried them all) of the solutions
>>> presented in this thread would return an empty string for th
Dear Barry,
In Dante's Divine Comedy the sequels were the Purgatorio and the Paradiso;
the analogy suggests that there may be a way out of R Hell (and actually
Patrick provides the way out right in his Inferno -- thanks Patrick!).
Regards,
John
> -Original Message-
> From: r-help-boun.
Hi Thomas
Rather than getting into the details of libcurl options
which are quite general and very flexible, I thought
it was easier to write an explicit ftpUpload() function
that takes care of the details.
You need a new version of the package (as it contains the function and
a small change t
Rau, Roland wrote:
>
> P.S. Any suggestions how to become more proficient with regular
> expressions? The O'Reilly book ("Mastering...")? Whenever I tried
> anything more complicated than basic usage (things like ^ $ * . ) in R,
> I was way faster to write a new function (like above) instead of fin
> Duncan Murdoch wrote:
>
>>
>> I'm curious about something: does "file extension" have a standard
>> definition? Most (all? I haven't tried them all) of the solutions
>> presented in this thread would return an empty string for the "plain
>> base" if given the filename ".bashrc".
>>
r
Great! thank you so much!
Dimitris Rizopoulos-4 wrote:
>
> one way is using mapply(), e.g.,
>
> mapply(":", 1:4, 3:6)
>
>
> I hope it helps.
>
> Best,
> Dimitris
>
>
> Yasir Kaheil wrote:
>> hi all,
>> how can I create sequences that start from a known vector, say x1 and end
>> with anothe
on 01/09/2009 02:42 PM Yasir Kaheil wrote:
> hi all,
> how can I create sequences that start from a known vector, say x1 and end
> with another say x2- also suppose all the sequences will be the same length.
> I don't want to use a for loop
> x1<-c(1,2,3,4); x2<-(3,4,5,6);
> what I want is
> 1 2 3
one way is using mapply(), e.g.,
mapply(":", 1:4, 3:6)
I hope it helps.
Best,
Dimitris
Yasir Kaheil wrote:
hi all,
how can I create sequences that start from a known vector, say x1 and end
with another say x2- also suppose all the sequences will be the same length.
I don't want to use a for
hi all,
how can I create sequences that start from a known vector, say x1 and end
with another say x2- also suppose all the sequences will be the same length.
I don't want to use a for loop
x1<-c(1,2,3,4); x2<-(3,4,5,6);
what I want is
1 2 3 4
2 3 4 5
3 4 5 6
Thanks
-
Yasir H. Kaheil
Colum
2009/1/9 Duncan Murdoch :
> Which he well deserves -- it's good advice, and a fun read too.
I'm looking forward to the sequel - Shakespeare perhaps?
"as.YouLike(it)"? "Much Ado About NULL"? "Night[12] | What(You.Will)"?
Barry
__
R-help@r-project.org
On 1/9/2009 1:27 PM, roger koenker wrote:
I think that this continuation constitutes what Pat calls "hijacking
the thread"
at the end of his new and magnificent opus. The original thread
should be
reserved for kudos to Pat.
Which he well deserves -- it's good advice, and a fun read too.
D
On Thu, 08-Jan-2009 at 01:26AM -0500, Robert Wilkins wrote:
[]
|> Some R promoters point out that R has lexical scope and lots of
|> Scheme goodness. ( and what widespread programming language today
|> does not have lexical scope? ). But other R promoters point out
|> that programs in S-Plus
WOW, Gabor, that is fancy. I have gotten better at this R thing, but
have far to go. That is a neat solution.
thanks
Stephen
On Fri, Jan 9, 2009 at 2:22 PM, Gabor Grothendieck
wrote:
> Or even:
>
> plot(a, ylim = range(a) + 0.06 * c(-1, 1))
>
>
> On Fri, Jan 9, 2009 at 2:07 PM, Mike Prager w
Hi
I am reading the source code of the ridge regression of the MASS package,
and I found the following piece of code
X <- model.matrix(Terms, m, contrasts)
n <- nrow(X); p <- ncol(X)
offset <- model.offset(m)
if(!is.null(offset)) Y <- Y - offset
if(Inter <- attr(Terms, "interce
Thank you very much. That certainly worked. Somehow I did not see that when
reading the help file, nor could I find it via Google search so I appreciate
your help! -- JC
Henrique Dallazuanna wrote:
>
> Try this:
>
> read.table(, check.names = FALSE)
>
> On Fri, Jan 9, 2009 at 3:56 PM,
Hello,
Sorry to ask this question, I have been searching quite a lot but I could
not find an answer.
I have seen one post about this subject but I did not really understand the
answer.
I have a linear regression with 95% confidence interval.
I would like to find the x-absciss of the intersection
Or even:
plot(a, ylim = range(a) + 0.06 * c(-1, 1))
On Fri, Jan 9, 2009 at 2:07 PM, Mike Prager wrote:
> "stephen sefick" wrote:
>
>> low <- min(a*0.98)-(min(a)*0.04)
>> high <- max(a*1.02)+(max(a)*0.04)
>> plot(a, ylim=c(low, high))
>
> Unless I am misreading your example, this can be done a
Hello Ryan,
I have good and bad news for you.
The good one is that there is a new rpy in active development. The bad one
is that you should compile it yourself.
You can get it here
http://rpy.sourceforge.net/rpy2.html
I use the regular distro of rpy under Linux x86_64. It works. I hope you ge
"stephen sefick" wrote:
> low <- min(a*0.98)-(min(a)*0.04)
> high <- max(a*1.02)+(max(a)*0.04)
> plot(a, ylim=c(low, high))
Unless I am misreading your example, this can be done a little
more compactly as:
plot(a, ylim = range(a * 0.94, a * 1.06))
--
Mike Prager, NOAA, Beaufort, NC
* Opinions
Felipe Carrillo yahoo.com> writes:
> One thing that I noticed though, when I generated my pdf
> all the pages had different numbers of rows, for example page 1 had 24
rows,second page 15 rows,third page 2
> rows of data. Is that something that can be controlled with pagebreaks?
I darkly rememb
Thanks Dieter:
It's exactly what I want. Thanks a lot for you help. One thing that I noticed
though, when I generated my pdf all the pages had different numbers of rows,
for example page 1 had 24 rows,second page 15 rows,third page 2 rows of data.
Is that something that can be controlled with p
I think that this continuation constitutes what Pat calls "hijacking
the thread"
at the end of his new and magnificent opus. The original thread
should be
reserved for kudos to Pat.
url:www.econ.uiuc.edu/~rogerRoger Koenker
emailrkoen...@uiuc.eduDepartment of
Try this:
read.table(, check.names = FALSE)
On Fri, Jan 9, 2009 at 3:56 PM, Cloudy56 wrote:
>
> Is there any way to maintain spaces, slashes, and parentheses in variable
> names when reading these into R?
>
> Of course, read.table converts these to periods. However, I know that it's
> not
Is there any way to maintain spaces, slashes, and parentheses in variable
names when reading these into R?
Of course, read.table converts these to periods. However, I know that it's
not strictly illegal to have these characters in variable names as I am able
to add them using the "variable edito
In newest version of R2WinBUGS, the default directory is changed to
working.directory, but never changed back once finished bugs call.
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinf
Felipe Carrillo wrote:
>
> This is what I got.
>
> \documentclass[11pt]{article}
> \usepackage{longtable,lscape}
> \usepackage{accents}
> \usepackage[usenames,dvipsnames]{color} % load all the colors
> \title{\color{Blue}How to transfer column names and add captions to pages
> in document}
> .
> now if only i could get tips to sort a 5 column * 1 million rows dataset in
> less than ..eternity
May I suggest mySQL, postgreSQL, etc.? If what you need to do is a basic
sort, a database is going to be faster than R.
--
Insert something humorous here. :-)
Do you really need the p-value or do you want to test at one
of the socially acceptable levels (i.e. .05 or .01). If all you want
is the test, use:
quantile(bootsample,c(0.025,0.975))
If the quantile range includes 0 then you decide there is no evidence
that the mean is different from zero, at t
Ajay ohri wrote:
excellent adaptation of Dante and R with real common sense tips to help
beginners especially ..goes to the blogroll..
now if only i could get tips to sort a 5 column * 1 million rows dataset in
less than ..eternity
Er, that's a fairly short eternity:
> x <- data.frame
All-
Thanks in advance for your help.
I'm trying to call R function using Python in a windows environment and have
downloaded the Rpy library however it doesn't appear to work with R 2.7.2.
Does anyone know if a new version of Rpy exists for windows that will work
with R an
excellent adaptation of Dante and R with real common sense tips to help
beginners especially ..goes to the blogroll..
now if only i could get tips to sort a 5 column * 1 million rows dataset in
less than ..eternity
Ajay
www.decisionstats.com
On Fri, Jan 9, 2009 at 9:44 PM, Patrick Burns
Hi -
If I have a hypothetical distribution as an array
distribution<-c(0,1,2,3,4,5,6,7,8,9)
and I want to find the probability there is a value smaller than a new
value.
new_value<-4
(such that I'd get this type of output)
new_value p-value
4 0.5
3.4 0.4
3 0.4
0
see:
http://www.nabble.com/Compressing-String-in-R-td21160453.html
On Fri, Jan 9, 2009 at 10:50 AM, Gundala Viswanath wrote:
> Dear all,
>
> Does R has any function/package that can pack
> and unpack string into bit size?
>
> The reason I want to do this in R is that R
> has much more native sta
"The R Inferno" is now on the Burns Statistics website at
http://www.burns-stat.com/pages/Tutor/R_inferno.pdf
Abstract: If you are using R and you think you're in hell,
this is a map for you.
Also, I've expanded the outline concerning R on the
Burns Statistics 'Links' page. Suggestions (off-lis
on 01/09/2009 09:00 AM Duncan Murdoch wrote:
> On 1/8/2009 9:10 PM, Gundala Viswanath wrote:
>> Dear all,
>>
>> The basename() function returns the extension also:
>>
>>> myfile <- "path1/path2/myoutput.txt"
>>> basename(myfile)
>> [1] "myoutput.txt"
>>
>>
>> Is there any other function where it ju
Duncan Murdoch wrote:
> On 1/8/2009 9:10 PM, Gundala Viswanath wrote:
>> Dear all,
>>
>> The basename() function returns the extension also:
>>
>>> myfile <- "path1/path2/myoutput.txt"
>>> basename(myfile)
>> [1] "myoutput.txt"
>>
>>
>> Is there any other function where it just returns
>> plain bas
Gundala --
Gundala Viswanath wrote:
Dear all,
Does R has any function/package that can pack
and unpack string into bit size?
All of your questions relate to DNA strings. The R/Bioconductor package
Biostrings is designed to manipulate such objects. It does not
necessarily address this partic
On Thu, Jan 8, 2009 at 5:58 PM, Robert Wilkins wrote:
> Is anyone in the leadership of the R-project going to contact the New
> York Times and clarify that the article gave remarkably short shrift
> to the people who designed the user interface for R, to a large extent
> AT&T researchers from an e
Try this:
## 1
map <- list(A = '00', C = '01', G = '10', T = '11')
myStr <- 'GATTA'
paste(map[unlist(strsplit(myStr, NULL))], collapse = "")
## 2
cod <- "100000"
library(gsubfn)
strapply(cod, '[0-9]{2}')
names(map)[match(unlist(strapply(cod, '[0-9]{2}')), map)]
On Fri, Jan 9, 2009 at 1:50 P
Graham: OK. Just give me a few days and I will be sending you some simple RVM
code lines. However, you have the Kernlab help with some nice examples
Â
Best regards
Â
Dr. Gabriel Ibarra-Berastegi
University of the Basque Country
SPAIN
--- El vie, 9/1/09, Graham Williams escribió:
De: Graham
Hi there, I think something like the following is what you want:
### R start...
# if you put your plain text files in a folder like this
my.path <- 'C:\\Documents and Settings\\tony\\Desktop\\texts\\'
# then you can construct a simple tdm like this
library(tm)
my.corpus <- Corpus(DirSource(my.pat
This is what I got.
\documentclass[11pt]{article}
\usepackage{longtable,lscape}
\usepackage{accents}
\usepackage[usenames,dvipsnames]{color} % load all the colors
\title{\color{Blue}How to transfer column names and add captions to pages in
document}
\begin{document}
\maketitle
I am using Sweave a
oooups. Thank you very much.
2009/1/9 Duncan Murdoch
> On 1/9/2009 10:38 AM, David Hajage wrote:
>
>> Dear R useRs,
>>
>> Sorry for this foolish question, but I can't find how to escape the *
>> character when using grep :
>>
>
> You use a backslash to escape the *. Unfortunately, to enter a ba
Thanks Thierry,
A quick test shows almost equivalent timing with the modification of
relevel() suggested earlier:
relevel <-
function (x, ref, ...)
{
lev <- levels(x)
if (is.character(ref))
ref <- match(ref, lev)
if (any(is.na(ref)))
stop("'ref' must be an existi
Hi there, you probably want something like:
# R
grep("\\*", c("/3", "2*3", "4-4"))
hope that helps a little,
Tony Breyal
On 9 Jan, 15:38, "David Hajage" wrote:
> Dear R useRs,
>
> Sorry for this foolish question, but I can't find how to escape the *
> character when using grep :
>
> > grep("
* must be escaped for grep with \ and \ must be escaped for R itself
with another \, so you need
grep("\\*", c("/3", "2*3", "4-4"))
Gabor
2009/1/9 David Hajage :
> Dear R useRs,
>
> Sorry for this foolish question, but I can't find how to escape the *
> character when using grep :
>
>> grep("-",
Use fixed = TRUE argument to grep.
2009/1/9 David Hajage :
> Dear R useRs,
>
> Sorry for this foolish question, but I can't find how to escape the *
> character when using grep :
>
>> grep("-", c("/3", "2*3", "4-4"))
> [1] 3
>> grep("/", c("/3", "2*3", "4-4"))
> [1] 1
>> grep("*", c("/3", "2*3", "
Use double backslashes:
grep("\\*", c("/3", "2*3", "4-4"))
2009/1/9 David Hajage
> Dear R useRs,
>
> Sorry for this foolish question, but I can't find how to escape the *
> character when using grep :
>
> > grep("-", c("/3", "2*3", "4-4"))
> [1] 3
> > grep("/", c("/3", "2*3", "4-4"))
> [1] 1
>
On Fri, Jan 9, 2009 at 10:23 AM, Rau, Roland wrote:
> Hi,
>
>> [mailto:r-help-boun...@r-project.org] On Behalf Of Henrique
>> Dallazuanna
>>
>> Try this also:
>>
>> substr(basename(myfile), 1, nchar(basename(myfile)) - 4)
>>
>
> This, of course, assumes that the extensions are always 3 characters.
Dear all,
Does R has any function/package that can pack
and unpack string into bit size?
The reason I want to do this in R is that R
has much more native statistical function than Perl.
Yet the data I need to process is so large that it
required me to compress it into smaller unit -> process it
R would have truly arrived if the Wall Street Journal mentions it as an
alternative to SAS or Excel...but that is some years away...
Ajay
www.decisionstats.com
On Fri, Jan 9, 2009 at 7:28 AM, Robert Wilkins wrote:
> Is anyone in the leadership of the R-project going to contact the New
> York Tim
On 1/9/2009 10:38 AM, David Hajage wrote:
Dear R useRs,
Sorry for this foolish question, but I can't find how to escape the *
character when using grep :
You use a backslash to escape the *. Unfortunately, to enter a
backslash in an R string, you need to escape it. So the pattern is "\\*".
Dear R useRs,
Sorry for this foolish question, but I can't find how to escape the *
character when using grep :
> grep("-", c("/3", "2*3", "4-4"))
[1] 3
> grep("/", c("/3", "2*3", "4-4"))
[1] 1
> grep("*", c("/3", "2*3", "4-4"))
Erreur dans grep("*", c("/3", "2*3", "4-4")) :
expression régulièr
Hi,
> [mailto:r-help-boun...@r-project.org] On Behalf Of Henrique
> Dallazuanna
>
> Try this also:
>
> substr(basename(myfile), 1, nchar(basename(myfile)) - 4)
>
This, of course, assumes that the extensions are always 3 characters.
Sometimes there might be more ("index.html"), sometimes less
On 1/8/2009 9:10 PM, Gundala Viswanath wrote:
Dear all,
The basename() function returns the extension also:
myfile <- "path1/path2/myoutput.txt"
basename(myfile)
[1] "myoutput.txt"
Is there any other function where it just returns
plain base:
"myoutput"
i.e. without 'txt'
I'm curious ab
Right,
Other option is:
substr(nameFile, 1, tail(unlist(gregexpr("\\.", nameFile)), 1) - 1)
On Fri, Jan 9, 2009 at 1:23 PM, Rau, Roland wrote:
> Hi,
>
> > [mailto:r-help-boun...@r-project.org] On Behalf Of Henrique
> > Dallazuanna
> >
> > Try this also:
> >
> > substr(basename(myfile), 1, nc
On Fri, Jan 9, 2009 at 1:45 PM, Roland Studer wrote:
> I agree, that there are better plattforms.
> I'd love to see something like Stack Overflow:
> http://stackoverflow.com/
Why, you cannot see it now? You can start posting your R questions and
answers to it right away if you like.
> When you t
WOW, I am not going to post after midnight. Thank you for your
response, and this is what I settled on.
`plot.e` <- function(b, w, x, y, z){
a <- window.chron(b, w, x, y, z)
low <- min(a*0.98)-(min(a)*0.04)
high <- max(a*1.02)+(max(a)*0.04)
plot(a, ylim=c(low, high))
lines(a*0.98, col="blue")
lin
Dear Baptiste,
You can avoid the recursive stuff. And it will run about twice as fast.
> order.factor <- function (x, ref)
+ {
+ last.index <- length(ref) # convenience for matlab's end keyword
+ if(last.index == 1) return(relevel(x, ref)) # end case, normal case
+ my.new.list <- list(x=re
On 9 Jan 2009, at 15:26, Dimitris Rizopoulos wrote:
I think that you can still use to core of stats:::relevel.factor; the
only thing that needs to be changed is the controls for bad values of
the 'ref' argument, i.e.,
relevelNew <- function (x, ref, ...) {
lev <- levels(x)
if (is.chara
Dear Luke and others,
I have many R versions on my machine and want to start a particular
one when snow builds its cluster. (The same version I start snow
from.) It seems that everything is set up correctly in
defaultClusterOptions:
> mget(ls(defaultClusterOptions), defaultClusterOptions)
$homoge
I think that you can still use to core of stats:::relevel.factor; the
only thing that needs to be changed is the controls for bad values of
the 'ref' argument, i.e.,
relevelNew <- function (x, ref, ...) {
lev <- levels(x)
if (is.character(ref))
ref <- match(ref, lev)
if (any
G'day Wacek,
On Fri, 09 Jan 2009 15:19:46 +0100
Wacek Kusnierczyk wrote:
> i think i did not suggest the original poster to learn perl.
As I see it, you didn't suggest anything to the original poster, at
least not directly. But, since these days you have to be subscribed
to r-help to post IIRC
Prof Brian Ripley wrote:
>
> Actually, that's a valid regex in any of the variants offered. A more
> conventional writing of it is the second of
>
>> f <- 'foo.bar.R'
>> sub("[.][^.]*$", "", f)
> [1] "foo.bar"
>> sub("\\.[^.]*$", "", f)
> [1] "foo.bar"
>
more conventional in r, perhaps. it's not
Howdy Gurus
I 'd like to ask a question about how to build TermDocMatrix in tm text
mining package.
It is not clear about importing a plain text file, and them converting that
text file into TermDocMatrix file, etc to me.
How can I build a TermDocMatrix of " a plain text document file for text
as
Berwin A Turlach wrote:
> G'day Wacek,
>
> On Fri, 09 Jan 2009 14:22:19 +0100
> Wacek Kusnierczyk wrote:
>
>
>>> Apparently also a possibility, I guess it can be made to work with
>>> the original example and my extensions.
>>>
>>>
>> i guess it does work with the original example and
Dear list,
I'm having second thoughts after solving a very trivial problem: I
want to extend the relevel() function to reorder an arbitrary number
of levels of a factor in one go. I could not find a trivial way of
using the code obtained by getS3method("relevel","factor"). Instead, I
thou
Hi Everyone,
This example code results in R 'crashing'; that is the R application closes
with no warnings or error messages.
#---
myD <- read.table(stdin(), header=TRUE, nrows=20)
Broth Salt pH TempN Y Growth
13109.0 2.92 10 90.0 NA0
2
On Fri, 9 Jan 2009, Berwin A Turlach wrote:
G'day Wacek,
On Fri, 09 Jan 2009 12:52:46 +0100
Wacek Kusnierczyk wrote:
Berwin A Turlach wrote:
G'day all,
On Fri, 9 Jan 2009 08:12:18 -0200
"Henrique Dallazuanna" wrote:
Try this also:
substr(basename(myfile), 1, nchar(basename(myfile)) -
G'day Wacek,
On Fri, 09 Jan 2009 14:22:19 +0100
Wacek Kusnierczyk wrote:
> > Apparently also a possibility, I guess it can be made to work with
> > the original example and my extensions.
> >
>
> i guess it does work with the original example and your extensions.
And I thought that you woul
Berwin A Turlach wrote:
> G'day Wacek,
>
>
>
>>> Or, in case that the extension has more than three letters or
>>> "myfile" is a vector of names:
>>>
>>> R> myfile <- "path1/path2/myoutput.txt"
>>> R> sapply(strsplit(basename(myfile),"\\."), function(x)
>>> R> paste(x[1:(length(x)-1)], collapse=
G'day Wacek,
On Fri, 09 Jan 2009 12:52:46 +0100
Wacek Kusnierczyk wrote:
> Berwin A Turlach wrote:
> > G'day all,
> >
> > On Fri, 9 Jan 2009 08:12:18 -0200
> > "Henrique Dallazuanna" wrote:
> >
> >
> >> Try this also:
> >>
> >> substr(basename(myfile), 1, nchar(basename(myfile)) - 4)
> >>
No problem, easy peasy, just hack it together and put all the old
archives on so the subscribers can vote.
greetings, el
On 09 Jan 2009, at 14:45 , Roland Studer wrote:
I agree, that there are better plattforms.
I'd love to see something like Stack Overflow:
http://stackoverflow.com/
When you
I agree, that there are better plattforms.
I'd love to see something like Stack Overflow:
http://stackoverflow.com/
When you type your question, it compares it to previously answered
questions. Answers can get voted up and down. Answers AND questions can be
edited!
Regards
Roland Studer
On Fri
On Fri, 9 Jan 2009, richard.cot...@hsl.gov.uk wrote:
Is it possible to save plots as byte streams?
You mean bitmap plots? E.g. PDF plots are not even written
sequentially.
For example, if I want the
bytes for a PNG plot, I could use
#Write the plot to a PNG file
png("test.png")
plot(1:10
Gabor Grothendieck wrote:
> On Fri, Jan 9, 2009 at 6:52 AM, Wacek Kusnierczyk
>
>
>> or have sub do the job for you:
>>
>> filenames.ext = c("foo.bar", basename("foo/bar/hello.dolly"))
>> (filenames.noext = sub("[.][^.]*$", "", filenames.ext, perl=TRUE))
>>
>
> We can omit perl = TRUE here.
Thank you again for your response.
This worked great.
Quick question about the legend for qplot. Instead of being outside the plot,
is it possible to move the location of the legend to the upper left or right
corner of the plot? Could you possibly provide an example.
Thank you again for
On Fri, Jan 9, 2009 at 6:52 AM, Wacek Kusnierczyk
wrote:
> Berwin A Turlach wrote:
>> G'day all,
>>
>> On Fri, 9 Jan 2009 08:12:18 -0200
>> "Henrique Dallazuanna" wrote:
>>
>>
>>> Try this also:
>>>
>>> substr(basename(myfile), 1, nchar(basename(myfile)) - 4)
>>>
>>
>> Or, in case that the extens
1 - 100 of 115 matches
Mail list logo