Displaying 20 results from an estimated 7000 matches similar to: "How to unquote string in R"
2010 Oct 17
4
how to convert string to object?
temp = "~aparch("
temp1 = paste(temp,1, sep = "")
temp2 = paste(temp1,1, sep = ",")
temp3 = paste(temp2, ")",sep = "")
temp 3 is a character but I want to convert to formula object. How do I do
this?
--
View this message in context: http://r.789695.n4.nabble.com/how-to-convert-string-to-object-tp2999281p2999281.html
Sent from the R help mailing
2010 Oct 03
5
How to iterate through different arguments?
If I have a model line = lm(y~x1) and I want to use a for loop to change the
number of explanatory variables, how would I do this?
So for example I want to store the model objects in a list.
model1 = lm(y~x1)
model2 = lm(y~x1+x2)
model3 = lm(y~x1+x2+x3)
model4 = lm(y~x1+x2+x3+x4)
model5 = lm(y~x1+x2+x3+x4+x5)...
model10.
model_function = function(x){
for(i in 1:x) {
}
If x =1, then the list
2006 Aug 02
1
loop, pipe connection, quote/unquote
Hi all,
I have the following problem.
Inside R, I am trying to run a loop on several files.
The data are stored in these files in a peculiar way, thus, at the same time I load the data, I would like to invoke a utility. I do this with "pipe". (The utility I am using is gbget from the package gbutils. It works correctly from shell, and it is not the problem.)
The problem is that from
2006 Aug 20
3
unquoting
I would like a function to strip quotes off character strings. I should
work like this:
> A <- matrix(1:6, nrow = 2, ncol=3)
> AF <- as.data.frame(A)
> names(AF) <- c("First","Second","Third")
> AF
First Second Third
1 1 3 5
2 2 4 6
> names(AF)[2]
[1] "Second"
> attach(AF)
>
2010 Oct 07
1
how to convert list to language object
If I have a list:
list = c(~garch(1,1), ~arma(1,1)) and I run
typeof(list[1]), the output is a list object. But I want each element in the
list to be a language object. How do I transform these list objects to
language objects?
--
View this message in context: http://r.789695.n4.nabble.com/how-to-convert-list-to-language-object-tp2966813p2966813.html
Sent from the R help mailing list archive at
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
>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
2017 Oct 16
2
Re: [PATCH v2 1/2] daemon: add split_key_value_strings helper
On Mon, Oct 16, 2017 at 05:58:10PM +0200, Pino Toscano wrote:
> Add a simple helper to turn a list of strings into key/value pairs,
> splitting by '=', with the possibility to apply a function to unquote
> values.
>
> Add also a simple unquote function.
> ---
> daemon/utils.ml | 16 ++++++++++++++++
> daemon/utils.mli | 11 +++++++++++
> 2 files changed, 27
2017 Mar 17
2
RFC: (in-principle) native unquoting for standard evaluation
I love the pointer analogy. Presumably the additional complication of scope
breaks this however. * itself would have been a nice operator for this were
it not prone to ambiguity (`a * *b` vs `a**b`, from which @ does not
suffer).
Would this extension require that function authors explicitly enable
auto-quoting support? I somewhat envisioned functions seeing the resolved
unquoted object (within
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
2017 Mar 17
4
RFC: (in-principle) native unquoting for standard evaluation
(please be gentle, it's my first time)
I am interested in discussions (possibly reiterating past threads --
searching didn't turn up much) on the possibility of supporting standard
evaluation unquoting at the language level. This has been brought up in a
recent similar thread here [1] and on Twitter [2] where I proposed the
following desired (in-principle) syntax
f <-
2017 Mar 19
3
RFC: (in-principle) native unquoting for standard evaluation
Michael Lawrence (as last in long series of posters)...
> Yes, it would bind the language object to the environment, like an
> R-level promise (but "promise" of course refers specifically to just
> _lazy_ evaluation).
>
> For the uqs() thing, expanding calls like that is somewhat orthogonal
> to NSE. It would be nice in general to be able to write something like
>
2008 May 09
1
Searcher Explain
Hi,
I am unable to use the Searcher''s explain method. Anytime I call it, I get
Segmentation Faults and it kills the process I have running my Rails site.
Has anyone else had this problem? Here is some code I am trying to use it
in...
search = Search.create(:query => query)
@quotations = []
searcher = Ferret::Search::Searcher.new("index") # FerretConfig::INDEX
bq =
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 19
3
RFC: (in-principle) native unquoting for standard evaluation
Would this return a quosure? (i.e. a single sided formula that captures
both expression and environment). That's the data structure we've adopted
in tidyeval as it already has some built in support.
Hadley
On Friday, March 17, 2017, Michael Lawrence <lawrence.michael at gene.com>
wrote:
> Interesting idea. Lazy and non-standard evaluation is going to happen; the
> language
2003 Oct 13
1
extracting quoted text from character string
Hello all,
I am trying to solve a problem, and my solution is rather ugly and not very
general. The posts for "[R] help with gsub and grep functions" seemed
relevent
and gave me hope for a more refined and more general solution.
The Problem:
line <- "'this text has spaces' 'thisNot' 3 4 5 6 7 8 9 10"
bad.line <- "'this text has spaces'
2007 May 19
2
RV permissions -- can''t park in my lot!
I''m trying to setup RV and cannot get it started. I keep getting:
Permission Denied : /var/log/rv.log
I''ve tried running it as root to test and also using www-data and chrgrp of
rv.log to www-data.
Here''s the output:
nohup su -c "/usr/bin/ruby rv_harness.rb 3301 127.0.0.1 < /dev/null 2>&1 >
/dev/null" www-data < /dev/null 2>&1 >>
2017 Oct 16
3
[PATCH v2 0/2] daemon: add and use split_key_value_strings helper
Changes from v1 to v2:
- split the "simple unquoting" as helper
- pass the unquoting function to split_key_value_strings
- use right unquoting function when applying split_key_value_strings
Pino Toscano (2):
daemon: add split_key_value_strings helper
daemon: use split_key_value_strings
daemon/inspect_fs_unix.ml | 93 +++++++++++++++++++----------------------------
daemon/md.ml
2017 Mar 19
0
RFC: (in-principle) native unquoting for standard evaluation
On Mon, Mar 20, 2017 at 7:36 AM, Radford Neal <radford at cs.toronto.edu> wrote:
> Michael Lawrence (as last in long series of posters)...
>
>> Yes, it would bind the language object to the environment, like an
>> R-level promise (but "promise" of course refers specifically to just
>> _lazy_ evaluation).
>>
>> For the uqs() thing, expanding calls
2017 Oct 16
3
[PATCH v3 0/2] daemon: add and use parse_key_value_strings helper
Changes from v2 to v3:
- split_key_value_strings renamed to parse_key_value_strings
Changes from v1 to v2:
- split the "simple unquoting" as helper
- pass the unquoting function to split_key_value_strings
- use right unquoting function when applying split_key_value_strings
Pino Toscano (2):
daemon: add split_key_value_strings helper
daemon: use parse_key_value_strings