Displaying 20 results from an estimated 3000 matches similar to: "RE: [R] Several R vs S-Plus issues (PR#1112)"
2001 Oct 03
0
Several R vs S-Plus issues (PR#1110)
Hi, all,
I've been converting code from S-Plus ("S" for short) to R for a few weeks.
Here are some differences I've found, aside from the big well-known ones
(scoping, models, data storage) and the contents of Kurt Hornik's FAQ section
3.3.3. Let me start with the ones that seem like serious bugs or deficiencies:
1) LETTERS[c(NA,2)] in S is
2001 Oct 03
8
Several R vs S-Plus issues
Hi, all,
I've been converting code from S-Plus ("S" for short) to R for a few weeks.
Here are some differences I've found, aside from the big well-known ones
(scoping, models, data storage) and the contents of Kurt Hornik's FAQ section
3.3.3. Let me start with the ones that seem like serious bugs or deficiencies:
1) LETTERS[c(NA,2)] in S is
2001 Oct 03
8
Several R vs S-Plus issues
Hi, all,
I've been converting code from S-Plus ("S" for short) to R for a few weeks.
Here are some differences I've found, aside from the big well-known ones
(scoping, models, data storage) and the contents of Kurt Hornik's FAQ section
3.3.3. Let me start with the ones that seem like serious bugs or deficiencies:
1) LETTERS[c(NA,2)] in S is
2001 Sep 25
2
read.table() suggestions
Hi,
I understand work is being done to improve read.table(), especially by
Prof. Brian D. Ripley. I offer below a version that I wrote, in the hope some
aspects of it may prove useful or at least inspire discussion.
Be aware that my version differs in a couple fundamental ways that reflect
my aversion to dataframes and factors. So it returns a list of vectors which
are all character,
2001 Sep 13
1
rowsum dimnames
Hi,
The result of rowsum() in R doesn't have the dimnames I'd expect, e.g.:
> rowsum(matrix(1:12, 3,4), c("Y","X","Y"))
[,1] [,2] [,3] [,4]
1 2 5 8 11
2 4 10 16 22
whereas S-Plus gives the more useful result:
[,1] [,2] [,3] [,4]
X 2 5 8 11
Y 4 10 16 22
This is because R's rowsum() code gives
2001 Sep 14
1
rowsum dimnames (PR#1092)
The result of rowsum() in R doesn't have the dimnames I'd expect, e.g.:
> rowsum(matrix(1:12, 3,4), c("Y","X","Y"))
[,1] [,2] [,3] [,4]
1 2 5 8 11
2 4 10 16 22
whereas S-Plus gives the more useful result:
[,1] [,2] [,3] [,4]
X 2 5 8 11
Y 4 10 16 22
This is because R's rowsum() code gives the
2001 Oct 04
2
Characters subsetted with NA (was: Several R vs S-Plus issues)
Hello, R-devel!
I posted to R-help, and (inappropriately) to R-bugs, this R/S-Plus difference:
> LETTERS[c(NA,2)] in S is c("","B"), but in R is c("NA","B")
Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at> wrote:
> I think we do not want to change this. ...
> R> is.na(LETTERS[c(NA,2)])
[1] TRUE FALSE
> so we really have NA but it is
2001 Sep 27
5
Reading and writing to S-like databases
Hi,
I asked this question 2 years ago, and would like to know if the answer has
changed.
In S-Plus, I build databases of many large objects. In any given analysis,
I only need a few of those objects, but attach'ing the whole database is fine
since objects are only read as needed. How can I do the same thing in R,
without reading the entire database?
One possibility is to treat
2003 Jan 23
0
Summary: Warnings with no INDEX file in a package
Thanks to Henrik Bengtsson, Martin Maechler, Brian Ripley, Jeff Gentry and
David Brahm for taking the time to answer my questions about INDEX files in R
packages.
My key take-aways were:
1) All of this will be changing a lot in R 1.7.0-to-be, so don't sweat the
details.
2) Many people run R CMD build before they run R CMD check. I found this quite
surprising. I did not realize that R
2002 Jan 07
1
Mishandling missing "..." (PR#1247)
R> myfun <- function(x, ...) {x[...] <- 0; x}
R> myfun(3)
Error in myfun(3) : SubAssignArgs: invalid number of arguments
It fails because no ... was passed. The workaround (and desired behavior) is:
R> myfun <- function(x, ...) {if (missing(...)) x[] <- 0 else x[...] <- 0; x}
R> myfun(3)
[1] 0
Deja vu? This is the one piece of my PR#1110 (Oct 3, 2001) that I
2015 Jul 11
1
User Input
All,
I have a package BondLab, all variables are passed to the models via Cusip objects. ?
The only variables input by the user are?
settlement date,?
price or yield or spread. ?
Further price may be passed as 100.125, 100-8 (1/8), or 100-2 (2/64) or 100-2+ (5/128).?
Once passed these variables must have a steady state (in decimal). ?After reading the R documentation and Hadley's book I
2011 Jul 05
1
Executing a function several time, how to save the output
Hi all,
I try to exceute a function "myfun" that should use as input "input1.csv"
and "input2.csv" .
Then I try to save the output dat33 on a csv file (on per each time I
execute input1..input 2 and so on). So my problem is how to finally obtain
several csv file with "ggt1.csv", "ggt2.csv".
The program creates ggt1.csv but
BUT when runs
2012 Aug 27
3
String Handling() for Split a word by a letter
Hi,
here im unable to run a string handle function called unpaste().
for eg:- a<- "12345_mydata"
Actually my requirement what is i need to get , only 12345. Means that , i
need the all letter as a word which is before of first " _ " - symbol of
"a". i tried to do with unpaste, it says function not found. After that i
tried with "strsplit() ". it
2011 Feb 23
3
Using string to call/manipulate an object
I am using getSymbols function from quantmod package to get price data from
internet.
Currently I have:
my.ticker <- "IBM"
getSymbols(my.ticker,src="google")
This creates an xts object named my.ticker which contains historical price
data for IBM.
How can I call and manipulating this xts object using my original string
my.ticker?
I want to do:
colnames(my.ticker) <-
2005 Aug 26
2
Unpaste Problem
Hello,
Easy ways to "unpaste"?
xp <- paste(x2, x3) # x2, x3 are two non-numeric columns.
.............
.........................
xfg <- data.frame(xp,sc1, sc2, sc3) # sc1,sc2, sc3 are numeric cols.
I want xp to be split up to form a new dataframe of the form (x3, sc1,
sc2, sc3).
IMPORTANT info : elements of xp have the form abc<space>efg, with abc
in x2 and efg in
2001 Oct 04
0
ANNOUNCE: ticker (peeper)
--lrZ03NoBR/3+SXJZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
----- Forwarded message from Collin Starkweather <collin.starkweather@color=
ado.edu> -----
--=20
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Collin Starkweather http://www.collinstarkweather.com
Consulting Software
2009 Jun 25
1
apply on xts
Hi,
I do not understand why after I called apply on a function that returns an
xts (getIdvAdjSeries) it returns a matrix whose columns are just numeric
value of time series in xts instead of a list of xts objects.
Basically, I called the following:
apply(matrix(tickers,ncol=1),1,FUN=getDivAdjSeries)
getDivAdjSeries <- function(ticker) {
seriesName <-
2012 Oct 29
2
find the Best-ticker
i need to find the best ticker from the group of some tickers.?
i also need to know on what basis we calculate the best ticker?
i have some idea about the if the risk rate low, or the market price
high we can say the ticker is best.
but i dont know is it true.
Anyone can help me .
Thank you
--
View this message in context:
2007 Jan 28
0
"[", .local and S4 methods (was: "[" operator and indexing ambiguity)
Dear Tony,
thanks for the tip with "nargs", when suitably applied, this answers the
problem.
The behaviour of "nargs" in S4 methods has some subtleties compared to
that in normal functions, as shown in the example below. I admit that
this is what had earlier created some confusion about the semantics of
"nargs". From the perspective of "nargs" and its
2001 Dec 14
2
colSums in C
Hi, all!
My project today is to write a speedy colSums(), which is a function
available in S-Plus to add the columns of a matrix. Here are 4 ways to do it,
with the time it took (elapsed, best of 3 trials) in both R and S-Plus:
m <- matrix(1, 400, 40000)
x1 <- apply(m, 2, sum) ## R=16.55 S=52.39
x2 <- as.vector(rep(1,nrow(m)) %*% m) ## R= 2.39 S= 8.52
x3 <-