Thank you all , very informative, never thought of doing a str( mylist[1] )
-Original Message-
From: "Jeff Newmiller" [jdnew...@dcn.davis.ca.us]
Date: 06/15/2017 11:56 AM
To: r-help@r-project.org, "Huzefa Khalil" , "ce"
Subject: Re: [R] is.null(mylist[1])
Hi
I have a list :
mylist <- list( a = NULL, b = 1, c = 2 )
> mylist[1]
$a
NULL
> is.null(mylist[1])
[1] FALSE
> is.null(mylist$a)
[1] TRUE
why? I need to use mylist[1]
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://st
Maybe you can use .libPaths to choose a different library
.libPaths("/myhome/Documents/R/R-3.0.2/library")
Or /usr/bin/R command in linux is a shell script, you can edit some paths and
make it work. ( I haven't tried it though)
-Original Message-
From: "Bogdan Tanasa" [tan...@gmail.c
nour I didn't want to use "for loop".
ce
-Original Message-
From: "Jeff Newmiller" [jdnew...@dcn.davis.ca.us]
Date: 03/11/2017 11:23 AM
To: r-help@r-project.org, "ce" , "Rui Barradas"
Subject: Re: [R] find index in a list of list
Since the of
Sorry I rejoiced too soon. In fact original list is more complex like :
mylist <- list(list(a=10,b="x",c=1),list(a=11,b="y",c=2),list(a=12,b="z",c=5))
and I still need to find index of where a = 11 and b = "y" and I have no c
value ,
Exactly. Thanks a lot, I was trying sapply with to result.
-Original Message-
From: "Rui Barradas" [ruipbarra...@sapo.pt]
Date: 03/11/2017 10:06 AM
To: "ce" , r-help@r-project.org
Subject: Re: [R] find index in a list of list
Hello,
Something like this?
find <-
Hi all,
I have a list of lists like this :
mylist <- list(list(a=10,b="x"),list(a=11,b="y"),list(a=12,b="z"))
I want to find the index of list in mylist where a = 11 and b = "y" , so I
want to get 2 as a result
Thanks in advance
__
R-help@r-projec
I use opensuse linux with R , no problems, easy to install, added R
repositories .
-Original Message-
From: "jax200" [jax...@gmail.com]
Date: 06/09/2016 06:00 PM
To: r-help@r-project.org
Subject: [R] New installation
Hi
I'm starting off with both R and Linux Mint. During a recent R co
mp; d > 10 )
then I need to have a bunch of functions and I will forget which function I
used.
-Original Message-
From: "Rainer M Krug" [rai...@krugs.de]
Date: 06/02/2016 09:08 AM
To: "ce"
CC: "Jeff Newmiller" , r-help@r-project.org
Subject: Re: Making
Thank you all for wisdom :)
Problem is that I change the condition often and then I forget it. I wanted to
put it at the beginning of the program with the other parameters so I wouldn't
miss it.
ce
-Original Message-
From: "Rainer M Krug" [rai...@krugs.de]
Date: 06/0
Dear all,
I want to make an if condition variable like :
a = 10
CONDITION = " a > 0 "
if ( CONDITION ) print(" a is bigger" )
I tried get , getElement , eval without success ?
Thanks
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more,
Dear all,
I can't find an answer to this simple question:
a.ts <- ts(1:10, frequency = 1, start = c(1959, 1))
> a.ts
Time Series:
Start = 1959
End = 1968
Frequency = 1
[1] 1 2 3 4 5 6 7 8 9 10
Now I want to get let's say value for 1965 , how to get it ?
> a.ts["1965"]
[1] NA
doesn
sn't work with .07 milisecond but work with .079 and .0 ??
-Original Message-
From: "Huzefa Khalil" [huzefa.kha...@umich.edu]
Date: 01/18/2016 09:26 PM
To: "ce"
CC: r-help@r-project.org
Subject: Re: [R] xts/zoo index problem?
Try
a["2016-01-18 15:31:54.
1453137885.23,
1453149114.079), tzone = "", tclass = c("POSIXct", "POSIXt")), .Dim = c(2L,
1L), .Dimnames = list(NULL, "value"))
a
a["2016-01-18 12:24:45.230"]
#value
#2016-01-18 12:24:45 1
a["
This is perfect, automatically sets width even if I resize when in R .
thanks a lot.
-Original Message-
From: "Joss Wright" [j...@pseudonymity.net]
Date: 10/14/2015 10:32 AM
To: "ce"
CC: r-help@r-project.org
Subject: Re: [R] Column width in R terminal ?
On Wed, O
command works fine in R but not in .Rprofile ?
-Original Message-
From: "Sarah Goslee" [sarah.gos...@gmail.com]
Date: 10/14/2015 10:04 AM
To: "ce"
CC: "r-help"
Subject: Re: [R] Column width in R terminal ?
See ?options in particular the width option.
?
thanks
CE
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained
ow about:
> dataframe <- data.frame(A=20, B=NA)
> dataframe$A + dataframe$B
[1] NA
> ?sum
> sum(dataframe$A, dataframe$B, na.rm=TRUE)
[1] 20
Sarah
On Sun, Sep 6, 2015 at 6:48 PM, ce wrote:
>
>
> I use something like :
>
> dataframe[ is.na(dataframe) ] <
I use something like :
dataframe[ is.na(dataframe) ] <- 0
dataframe[ is.nan(dataframe) ] <- 0
dataframe[ is.infinite(dataframe) ] <- 0
-Original Message-
From: "Olu Ola via R-help" [r-help@r-project.org]
Date: 09/06/2015 06:24 PM
To: r-help@r-project.org
Subject: [R] Handling "NA" in
c"
2015-09-06 "def"
2015-09-07 "abc"
-Original Message-
From: "Joshua Ulrich" [josh.m.ulr...@gmail.com]
Date: 09/03/2015 09:43 PM
To: "ce"
CC: "R-Help"
Subject: Re: [R] merge xts objects with different data types ?
On Thu, Se
<- merge(a,b)
> d
a b
2015-09-03 "abc" "def"
> factor(d, levels = c("abc","def"))
a b
abc def
Levels: abc def
Date disappears here?
Thanks for your help
ce
__
R-help@r-project.or
Dear all,
my main problem is with miliseconds. I have an array :
library(xts)
options(digits.secs = 3)
> x
[1] "2015-06-10 10:22:06.389 EDT" "2015-06-10 10:22:07.473 EDT"
[3] "2015-06-10 10:22:08.717 EDT" "2015-06-10 10:22:09.475 EDT"
> x[1]
[1] "2015-06-10 10:22:06.38 EDT"
> x[2]
[1] "2015-06-1
Thanks a lot Bill and David.
Very few elements will be updated in the list. I think I will go for for loop
in this case. As a classic programmer I still feel uncomfortable with lapply
anyway.
ce
-Original Message-
From: "William Dunlap" [wdun...@tibco.com]
Date: 05/10/201
yes indeed :
foo <- lapply(foo, function(x) if(x[1] == 1 ) {x[2] <- 0; x }else{x} )
would work. But if the list is too long, would it be time consuming rather
than just updating elements that meet the if condition?
thx
ce
-Original Message-
From: "David Winsemiu
Dear All,
I have a list, using lapply I find some elements of the list, and then I want
to change the values I find. but it doesn't work:
foo<-list(A = c(1,3), B =c(1, 2), C = c(3, 1))
lapply(foo, function(x) if(x[1] == 1 ) x )
$A
[1] 1 3
$B
[1] 1 2
$C
NULL
lapply(foo, function(x) if(x[1]
Prof. Hydman's book is a good place to start :
https://www.otexts.org/fpp
-Original Message-
From: "randomness" [m.kof...@aew.eu]
Date: 04/28/2015 01:52 PM
To: r-help@r-project.org
Subject: [R] Forecasting prices
Hi,
apologies in advance for the generic question but I would highly appre
yes this is exactly what I want and it works. thanks.
-Original Message-
From: "JS Huang" [js.hu...@protective.com]
Date: 02/26/2015 03:22 AM
To: r-help@r-project.org
Subject: Re: [R] How many digits are there in left of dot of 0.0001 ?
Hi,
To get the number of digits to the right of
No no, I don't want scientific , I want really the number 4 in a variable or
cut the 4 out of 1e-04 . I can do it with sub what difficulty is to cut how
many characters , one or two
-Original Message-
From: "Hasan Diwan" [hasan.di...@gmail.com]
Date: 02/25/2015 09:55
are there in left of dot of 0.0001 ?
On 25 February 2015 at 17:55, ce wrote:
> Dear all,
>
> I would like to count how many digits are there on the left of a the dot
> of a numeric variable
>
Left? An infinite number... What does this have to do with R, th
Dear all,
I would like to count how many digits are there on the left of a the dot of a
numeric variable
a=0.0001
thanks
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read
Thanks Joshua,
Would you kindly explain if I have an xts array with different dates how I
change all dates to 1970-01-01 without touching the time ? I tried with
indexFormat without success. indexFormat(s) <- "1970-01-01 %H:%M:%S" . when I
plot a graph it still shows origin
Dear all,
I want to create a time series object from 00:00:00 to 23:59:00 without dates ?
I can't figure it out with xts ?
ce
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEA
Nice but as this is R forum, is there an R package related to it ?
-Original Message-
From: "John McKown" [john.archie.mck...@gmail.com]
Date: 12/18/2014 01:38 PM
To: "r-help"
Subject: [R] Your pardon: An article possibly of interest to statisticians
I do hope this doesn't upset anyone.
Thank you. I was flummoxed by late night tiredness.
getElement via ?"[" helped me. I am flubbergusted with your speedy answer.
ce
-Original Message-
From: "Bert Gunter" [gunter.ber...@gene.com]
Date: 12/17/2014 10:35 PM
To: "ce"
CC: "r-help@r-project
Dear all,
If I have a list like this how I can get an object of it with a variable :
foo<-list(A = c(1,3), B =c(1, 2), C = c(3, 1))
var <- "A"
get(paste("foo$",'A',sep=''))
Error in get(paste("foo$", "A", sep = "")) : object 'foo$A' not found
__
R-he
Thank you very much Martin and Chel Hee. Indeed both approach works but
Martin's approach covers whole function while Chel Hee's concentrates on
problem line.
Also another thanks to Martin for lesson on error handling which I desperately
need.
ce
-Original Message-
F
Dear all,
Let's say I have this script , below. tryCatch indeed catches the error but
exists, I want function to continue and stay in the loop. I found very
examples of withRestarts on internet to figure it out. Could you help me how to
do it ?
myfunc <- function()
{
while(1)
{
x <- r
you may try to increase virtual memory :
http://windows.microsoft.com/en-us/windows/change-virtual-memory-size#1TC=windows-7
-Original Message-
From: "eliza botto" [eliza_bo...@hotmail.com]
Date: 11/11/2014 02:35 PM
To: "r-help@r-project.org"
Subject: [R] R memory issues
Dear useRs,
I h
Dear all,
I have a list , and I want to get all indexes ( dates ) of xts objects in one
list:
foo<-list(A = xts(seq(2),seq(Sys.Date(),Sys.Date()+2,length.out=2)), B =
xts(seq(1),seq(Sys.Date()-2,Sys.Date()-1,length.out=1)) )
> foo
$A
[,1]
2014-10-311
2014-11-022
$B
I am trying to repeat socket example in ?socketConnection
Server process :
con1 <- socketConnection(port = 6011, server = TRUE)
while(TRUE) { writeLines("a",con1 ); Sys.sleep(1) }
Client process
con2 <- socketConnection(Sys.info()["nodename"], port = 6011)
readLines(con2, n = 1 )
while(i
that's very good , thanks.
-Original Message-
From: "John McKown" [john.archie.mck...@gmail.com]
Date: 10/11/2014 12:20 PM
To: "ce"
CC: "r-help"
Subject: Re: [R] xts array in minutes ?
On Sat, Oct 11, 2014 at 11:03 AM, ce wrote:
>
> Dea
Dear all,
I want to convert to character arrays "2014-10:10 00:00:00" and
"2014-10-10:23:59:00" to an array of minutes :
2014-10:10 00:00:00
2014-10:10 00:01:00
2014-10:10 00:02:00
What is the best way to do it ?
thanks
__
R-help@r-project.org mail
Did you try to create a file containing
#!/usr/bin/Rscript
library(mypackage)
you also need to give execute permission like chmod 755 myfile.R
-Original Message-
From: "Karim Mezhoud" [kmezh...@gmail.com]
Date: 10/08/2014 12:16 PM
To: R-help@r-project.org
Subject: [R] Desktop ic
Hello All,
Is there any IPC tools like in UNIX/Linux systems in R ?
I know there is mmap package but I am looking something more like sockets .
Any example appreciated .
Thx .
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinf
Hello,
I am looking for ANN ARIMA or ANN ES ( Artificial Neural Networks Hybrid with
ARIMA or Exponential Smoothing ) R examples or packages ?
as referenced in
http://cs.uni-muenster.de/Professoren/Lippe/diplomarbeiten/html/eisenbach/Untersuchte%20Artikel/Zhan03.pdf
regards
iles(path = "cygwin.lnk")
character(0)
-Original Message-
From: "Duncan Murdoch" [murdoch.dun...@gmail.com]
Date: 07/23/2014 09:21 AM
To: "ce" , r-help@r-project.org
Subject: Re: [R] Windows R doesn't recognize shortcuts ?
On 23/07/2014 9:08 AM, ce wrote:
Hi All,
In Windows 7 , R installation:
R version 3.1.1 Patched (2014-07-14 r66149) -- "Sock it to Me"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
it doesn't recognize shortcuts in path :
> list.files(path = "cygwin")
character(0)
cyg
Thanks Jeff et. all,
This is exactly what I needed.
-Original Message-
From: "Jeff Newmiller" [jdnew...@dcn.davis.ca.us]
Date: 07/12/2014 10:38 AM
To: "Uwe Ligges" , "ce" ,
r-help@r-project.org
Subject: Re: [R] lapply returns NULL ?
I think that rem
Dear all,
I have a list of arrays :
foo<-list(A = c(1,3), B =c(1, 2), C = c(3, 1))
> foo
$A
[1] 1 3
$B
[1] 1 2
$C
[1] 3 1
> if( foo$C[1] == 1 ) foo$C[1]
> lapply(foo, function(x) if(x[1] == 1 ) x )
$A
[1] 1 3
$B
[1] 1 2
$C
NULL
I don't want to list $C NULL in the output. How I can
There is a very good example system in
http://censix.com/download/
-Original Message-
From: "jeeth ghambole" [jeethghamb...@gmail.com]
Date: 07/01/2014 10:59 AM
To: r-help@r-project.org
Subject: [R] Order Book details in R Interactive Brokers Package
Hello All,
I am working on projec
Dear all,
I have a list of arrays :
foo<-list(A = c(1,3), B =c(1, 2), C = c(3, 1))
> foo
$A
[1] 1 3
$B
[1] 1 2
$C
[1] 3 1
I want to use all foo$A , foo$B and foo$C in a test :
> foo$A[1] == 1
[1] TRUE
> foo[[1]][1] == 1
[1] TRUE
> foo[[1:3]][1] == 1
Error in foo[[1:3]] : recursive indexi
nks.
-Original Message-
From: "William Dunlap" [wdun...@tibco.com]
Date: 06/19/2014 11:10 PM
To: "ce"
CC: r-help@r-project.org
Subject: Re: [R] as.Date(Sys.time()) returns tomorrow !
Is it a time zone issue? I get:
R> Sys.time()
[1] "2014-06-19 20:09:25 PDT&q
Dear all,
> Sys.time()
[1] "2014-06-19 22:19:17.976818 EDT"
> as.Date(Sys.time())
[1] "2014-06-20"
>
why this happens ?
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-p
I think rugarch package is doing what you need . Also it uses cluster option to
increase performance :
http://www.unstarched.net/r-examples/rugarch/a-short-introduction-to-the-rugarch-package/
-Original Message-
From: "cyl123" [505186...@qq.com]
Date: 03/26/2014 09:43 PM
To: "r-help"
successfully on my opensuse.. My question is : after make install ,
do I need to give special options to install.packages or they will be complied
with icc automatically ?
Regards
CE
-Original Message-
From: "Anspach, Jonathan P" [jonathan.p.ansp...@intel.com]
Date: 03/05/2014 12:28
Yes , indeed this is what I am looking for :
a[ a == 0.0 ] = NA
na.approx(a,na.rm="FALSE")
Thanks a lot.
-Original Message-
From: "Jeff Newmiller" [jdnew...@dcn.davis.ca.us]
Date: 02/05/2014 10:35 PM
To: "ce" , ""
Subject: Re: [R] replacing ze
ues.
Jeff proposed na.approx function , I didn't know it, looks promising , I will
look into it .
ce
-Original Message-
From: "Pascal Oettli" [kri...@ymail.com]
Date: 02/05/2014 10:20 PM
To: "ce"
CC: "r-help"
Subject: Re: [R] replacing zeros with above/bel
Dear all,
My data is :
a <- c(0.9721,0.9722,0.9730,0.9723,0.0,0.0,0.0,0.9706,0.9698,0.0,0.9710,0.9699)
I want to replace zeros with average of before and after values of them. But
sometimes there is one zero sometimes more than one. What is the most elegant
way to do this ?
Thanks a lot
_
Dear all ,
xts objects give error in if command :
Error in if :
missing value where TRUE/FALSE needed
> library(quantmod)
> getSymbols("SPY")
> SPY["2007-01-03"]$SPY.Adjusted > SPY["2007-01-04"]$SPY.Adjusted
[,1]
If I use as.numeric function it works :
> SPY["2007-01-03"]$SPY.Ad
'forecast' was built for x86_64-apple-darwin10.8.0
-Original Message-
From: "Henrik Bengtsson" [h...@biostat.ucsf.edu]
Date: 01/28/2014 12:39 PM
To: "ce"
CC: ""
Subject: Re: [R] How do you install cran mac binaries
Whether a package is install fr
a a namespace (and not attached):
[1] tools_3.0.2
-Original Message-
From: "Marcus Nunes" [marcus.nu...@gmail.com]
Date: 01/28/2014 12:30 PM
To: "ce" , "R Help"
Subject: Re: [R] How do you install cran mac binaries
ce,
Did you try to use the menu Packages &
/28/2014 12:30 AM
To: "ce"
CC: ""
Subject: Re: [R] How do you install cran mac binaries
As you install basically all CRAN packages and all OSes;
install.packages("forecast")
/Henrik
On Mon, Jan 27, 2014 at 8:18 PM, ce wrote:
> Sorry if the question is
Sorry if the question is stupid, how you you install mac os binaries like in :
http://cran.r-project.org/bin/macosx/contrib/r-release/forecast_5.0.tgz
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the
Dear all
How to test if xts date exists ? is.null doesn't work. SPY["2009-01-18"]
doesn't exist but I can't catch it in my script.
library(quantmod)
getSymbols("SPY")
> SPY["2009-01-16"]
SPY.Open SPY.High SPY.Low SPY.Close SPY.Volume SPY.Adjusted
2009-01-1685.8685.99 83.
I didn't try it myself but free Teamviewer software lets you access to any PC
linux or windows from your ipad :
http://www.teamviewer.com/
-Original Message-
From: "John Sorkin" [jsor...@grecc.umaryland.edu]
Date: 01/20/2014 09:13 AM
To: ""
Subject: [R] Setting up an R server.
Can som
Yes, it works perfect, thanks a lot.
-Original Message-
From: "Marius 't Hart" [mar...@ai178182.ai.rug.nl]
Date: 01/18/2014 04:58 PM
To: "ce"
CC: ""
Subject: Re: [R] accessing an object with a variable ?
Does this help you?
http://stackoverflow.co
I want access and object , its name is in an variable :
require(xts)
data(sample_matrix)
head(sample_matrix)
Open High LowClose
2007-01-02 50.03978 50.11778 49.95041 50.11778
2007-01-03 50.23050 50.42188 50.23050 50.39767
2007-01-04 50.42096 50.42096 50.26414 50.33236
0.23050 50.42188 50.23050 52.39767
#2007-01-04 50.42096 50.42096 50.26414 52.33236
A.K.
On Thursday, January 16, 2014 8:34 PM, ce wrote:
Dear all ,
I am getting this error while trying to change columns of an xts object with a
date range as index.
> library(xts)
Loading required package: zoo
Dear all ,
I am getting this error while trying to change columns of an xts object with a
date range as index.
> library(xts)
Loading required package: zoo
Attaching package: ‘zoo’
The following object is masked from ‘package:base’:
as.Date, as.Date.numeric
> data(sample_matrix)
Hi Pascal,
Indeed by following your advice I succeeded to install nloptr.
Thank you very much,
-Original Message-
From: "Pascal Oettli" [kri...@ymail.com]
Date: 06/17/2013 05:30 AM
To: "ce"
CC: ""
Subject: Re: [R] can't install rugarch and nloptr
70 matches
Mail list logo