Displaying 20 results from an estimated 9000 matches similar to: "help with $ and % symbols in R"
2008 Oct 14
3
gWidgets install
Hi,
I wanted to install the gWidgets package and ran the following code:
------------------------------------------
> install.packages("gWidgets")
trying URL 'http://www.ibiblio.org/pub/languages/R/CRAN/bin/windows/contrib/2.7/gWidgets_0.0-30.zip'
Content type 'application/zip' length 1354268 bytes (1.3 Mb)
opened URL
downloaded 1.3 Mb
package 'gWidgets'
2009 Nov 16
3
Error on reading an excel file
Hello everybody, here is the code I use to read an excel file containing two
rows, one of date, the other of prices:
library(RODBC)
z <- odbcConnectExcel("SPX_HistoricalData.xls")
datas <- sqlFetch(z,"Sheet1")
close(z)
It works pretty well but the only thing is that the datas stop at row 7530
and I don?t know why datas is a data frame that contains 7531 rows with the
2009 Feb 06
3
Sweave and backslashes
Hello Everyone,
I am an avid Sweave user and I am trying to pretty print floating point
numbers for latex output. For example in my document, I would like:
4.2\cdot 10^-{8}
Instead of:
4.2e-08
The Hmisc package has a nice function for doing this- but Hmisc has a ton of
dependencies and has proved very unportable to the various machines I work
on. So, I set out to write my own function that
2009 Oct 29
5
R crashes
My R crashes frequently when run with huge data.
--
View this message in context: http://www.nabble.com/R-crashes-tp26110355p26110355.html
Sent from the R help mailing list archive at Nabble.com.
2017 Mar 17
3
Support for user defined unary functions
I agree there is no reason they _need_ to be the same precedence, but
I think SPECIALS are already have the proper precedence for both unary
and binary calls. Namely higher than all the binary operators (except
for `:`), but lower than the other unary operators. Even if we gave
unary specials their own precedence I think it would end up in the
same place.
`%l%` <- function(x) tail(x, n =
2017 Mar 16
2
Support for user defined unary functions
I guess this would establish a separate "namespace" of symbolic prefix
operators, %*% being an example in the infix case. So you could have stuff
like %?%, but for non-symbolic (spelled out stuff like %foo%), it's hard to
see the advantage vs. foo(x).
Those examples you mention should probably be addressed (eventually) in the
core language, and it looks like people are already able
2009 Jul 19
4
space in column name
I read a table from Microsoft Access using RODBC. Some of the variables had
a name with a space in it.
R has no problem with it but I do.
I cannot find out how to specify the space
names(alltime)
[1] "ID" "LVL7" "Ref Pv No" "Ref Pv Name" "DOS"
"Pt Last Name" "Pt First Name" "MRN"
2017 Mar 16
2
Support for user defined unary functions
Martin,
Jim can speak directly to his motivations; I don't claim to be able to do
so. That said, I suspect this is related to a conversation on twitter about
wanting an infix "unquote" operator in the context of the non-standard
evaluation framework Hadley Wickham and Lionel Henry (and possibly others)
are working on.
They're currently using !!! and !! for things related to
2009 Sep 26
3
evaluate a set of symbols within an IF statement
Hello, writing some R code to cleanse a data set, if the following set
of symbols are identified then perform some actions. trying to write
the minimum code to do this.
tname = "VIX"
checkticker = c("VIX", "TYX", "TNX", "IRX")
if (tname == checkticker) {
//perform some operations
}
result i get is
> tname == checkticker
2017 Mar 17
2
Support for user defined unary functions
>After off list discussions with Jonathan Carrol and with
>Michael Lawrence I think it's doable, unambiguous,
>and even imo pretty intuitive for an "unquote" operator.
For those of us who are not CS/Lisp mavens, what is an
"unquote" operator? Can you expression quoting and unquoting
in R syntax and show a few examples where is is useful,
intuitive, and fits in to
2010 Oct 18
1
Incorrect positioning of raster images on Windows
I am working on dumping raster data from R into PNG files using
rasterImage(). I am working with a test matrix from the rasterImage()
example and using it to produce a PNG image with the following code:
# From the example for rasterImage(). A 3 pixel by 5 pixel b/w checkerboard.
testImage <- as.raster(0:1, nrow=3, ncol=5)
testImage
[,1] [,2] [,3] [,4] [,5]
[1,]
2010 Oct 18
1
Incorrect positioning of raster images on Windows
I am working on dumping raster data from R into PNG files using
rasterImage(). I am working with a test matrix from the rasterImage()
example and using it to produce a PNG image with the following code:
# From the example for rasterImage(). A 3 pixel by 5 pixel b/w checkerboard.
testImage <- as.raster(0:1, nrow=3, ncol=5)
testImage
[,1] [,2] [,3] [,4] [,5]
[1,]
2010 Mar 26
4
Creating a vector of categories
Hi,
I have a column in a data frame looking something like:
$sex $language $count
male english 0
male english 0
female english 32
male spanish 154
female english 11
female norweigan 7
and so on.
What I want to do is to order these in to categories, for instance one
category where count>=0 & count<10 and so on..
I want my data to turn out looking something like:
male
2017 Mar 16
4
Support for user defined unary functions
R has long supported user defined binary (infix) functions, defined
with `%fun%`. A one line change [1] to R's grammar allows users to
define unary (prefix) functions in the same manner.
`%chr%` <- function(x) as.character(x)
`%identical%` <- function(x, y) identical(x, y)
%chr% 100
#> [1] "100"
%chr% 100 %identical% "100"
#> [1] TRUE
2017 Mar 17
2
Support for user defined unary functions
Your example
x = 5
exp = parse(text="f(uq(x)) + y +z") # expression: f(uq(x)) +y + z
do_unquote(expr)
# -> the language object f(5) + y + z
could be done with the following wrapper for bquote
my_do_unquote <- function(language, envir = parent.frame()) {
if (is.expression(language)) {
# bquote does not go into expressions, only calls
2017 Mar 17
2
Support for user defined unary functions
The unquoting discussion is IMHO separate from this proposal and as
you noted probably better served by a native operator with different
precedence.
I think the main benefit to providing user defined prefix operators is
it allows package authors to experiment with operator ideas and gauge
community interest. The current situation means any novel unary
semantics either need to co-opt existing
2009 Oct 13
2
splitting dataframe, assign to new dataframe, add new rows to new dataframe
Hi, all,
My objective is to split a dataframe named "cmbine" according to the value of "classes". After the split, I will take the first instance from each class and bin them into a new dataframe, "df1". In the 2nd iteration, I will take the 2nd available instance and bin them into another new dataframe, "df2".
>cmbine$names
apple tiger pencil chicken
2012 Jan 11
1
Inconsistencies in device_Raster when axes are reflected
I noticed some undocumented and inconsistent behavior in device_Raster when a
plot is produced with reflected axes such as:
image(volcano, xlim = c(1,0), useRaster = TRUE)
image(volcano, ylim = c(1,0), useRaster = TRUE)
The `pdf` device will perform horizontal and vertical reflections, while
`quartz` will ignore the transformations when plotting to the screen, but
when plotting to a
2007 Nov 01
3
Curry: proposed new functional programming, er, function.
Hi all (especially R-core) I suppose,
With the introduction of the new functional programming functions into
base I thought I'd ask for a Curry() function. I use a simple one that
looks this:
Curry = function(FUN,...) { .orig = list(...);function(...)
do.call(FUN,c(.orig,list(...))) }
This comes in really handy when using say, heatmap():
2010 Apr 22
1
Rtools for building 64 bit windows packages
Hello R developers,
I sincerely apologize if the answer to this question is clearly documented
somewhere, but I was unable to figure it out over my morning coffee.
I just downloaded today's release of R 2.11.0 and installed it on my Windows
7 64 bit VM. I also downloaded the latest version of Rtools211 from
Professor Murdoch's site. The first thing I attempted to do was build some
of