Displaying 8 results from an estimated 8 matches for "irafuch".
Did you mean:
irafuchs
2009 Mar 05
1
listing functions in base package
How can I print the definition of a function that is in the base
package?
for example, if I type:
which.min
I get
function (x)
.Internal(which.min(x))
<environment: namespace:base>
How can I see the definition of this function?
Thanks.
2009 Feb 05
4
eval and as.name
I'm sure there is a more general way to ask this question but how do
you use the elements of a character vector as names of objects in an
expression?
For example, say you have:
a = c(1,3,5,7)
b = c(2,4,6,8)
n=c("a","b")
and you want to use the names a and b in a function (e.g. sum)
sum(eval(as.name(n[1])),eval(as.name(n[2])))
works but
what is a simpler way to
2013 Nov 18
3
Sending a matrix in an email
I have a matrix which has colnames and I would like to send this matrix using sendmailR. How can I convert this simple matrix to a format which can be used as the body variable in sendmailR? I see how I can create a file attachment using mime_part but I would like to send the matrix in the body of the email.
The matrix looks like:
ABD DEF GHI JKL MNO TOT
[1,] 0.44 0.81 1.67 0.37
2012 Oct 11
2
simple parsing question?
I am using the getQuote function in the Quantmod package to retrieve the % change for a stock as follows:
> getQuote("aapl",what=yahooQF(c("Change Percent (Real-time)")))
Trade Time %Change (RT)
aapl 2012-10-11 03:41:00 N/A - -1.67%
How can I extract the numeric "change %" which is being returned as a factor so that I can use it in other
2009 Feb 09
3
pause in function execution
I would like to have a function which gets data, does a calculation
and prints a result and then waits some number of seconds and
repeats. If I use Sys.sleep, the execution is pausing but the
function output is buffered so that it all comes out when the function
terminates. How can I get output while the function continues to
execute?
2009 Mar 05
3
character string as object name
Can someone please tell me why the following (last line) doesn't work
(as I expect it to :-)
library(quantmod)
a = getSymbols("MSFT",from="2009-3-01")
a
MSFT
eval(as.name(a))
MSFT$MSFT.Adjusted
b=paste(a,'$MSFT.Adjusted',sep='')
b
eval(as.name(b))
Why does this last line not work the way the earlier eval does?
Thanks.
2009 Feb 25
8
learning R
I was wondering why the following doesn't work:
> a=c(1,2)
> names(a)=c("one","two")
> a
one two
1 2
>
> names(a[2])
[1] "two"
>
> names(a[2])="too"
> names(a)
[1] "one" "two"
> a
one two
1 2
I must not be understanding some basic concept here.
Why doesn't the 2nd name change to
2009 Feb 25
8
learning R
I was wondering why the following doesn't work:
> a=c(1,2)
> names(a)=c("one","two")
> a
one two
1 2
>
> names(a[2])
[1] "two"
>
> names(a[2])="too"
> names(a)
[1] "one" "two"
> a
one two
1 2
I must not be understanding some basic concept here.
Why doesn't the 2nd name change to