similar to: Vectorization instead of loops problem

Displaying 20 results from an estimated 20000 matches similar to: "Vectorization instead of loops problem"

2011 Jun 03
2
tkrplot Newbie
Hello, I am trying to write a tcltk based program that plots/manipulates xts/xoo time series objects. I have the code I used from ## http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/tkrplot.html : ## require(quantmod) require(tcltk) library(tkrplot) Sys.setenv(TZ="GMT") getSymbols("^GSPC", from = "1960-01-01") Myhscale <- 2.5 # Horizontal scaling
2005 Jan 11
2
Changing the ranges for the axis in image()
Dear all, I can not find/understand the solution to this from the help pages: Say we have the following script: x<-matrix(c(1,1,0,1,0,1,0,1,1),3,3) image(x) How can I change the ranges on the vertical and horizontal axis to a range of my own or at least place a box frame around the image if I choose to use "axes=FALSE"? Apologies for such a bsic question and thanks beforehand
2010 Mar 22
4
Playwith on Mint
Hello, I am having trouble installing the package playwith on the latest Mint "helena", running R version 2.10.1 (2009-12-14). I suspect it has to do with the GTK library but as far as I can tell there is nothing wrong with it. Any help extremely appreciated. I include the output: > install.packages("playwith") Warning in install.packages("playwith") :
2012 Nov 28
2
hhmm time format, strptime and %k
Hello, I am having trouble with the conversion specifications as described in the strptime help page. > head(dat) Date Time Open High Low Close Up Down Volume 1 11/19/2012 935 137.89 138.06 137.82 138.05 3202541 3013215 0 2 11/19/2012 940 138.04 138.40 138.02 138.38 2549660 2107595 4657255 3 11/19/2012 945 138.38 138.40 138.18 138.19 1627379 1856318 3483697 4
2007 Jun 14
1
names() after library(RDCOMClient) problem(?)
Hello, Try example(names) in R 2.5.0 after library(RDCOMClient) and you get > example(names) names> # print the names attribute of the islands data set names> names(islands) Error in names(islands) : no applicable method for "names" > Is this normal? Any way round it??? Best regards, Costas ---------------------------------- Costas Vorlow
2011 Apr 10
3
open.exe Virus W32.ATRAPS
Hello, I am not sure if this is the correct mailing list to send this email... I was trying to install on windows XP latest R-2.12.2 and my unvirus program (Immunet 3.0) reports a virus at open.exe while this is unpacked: W32.ATRAPS Has anyone come across the same problem? Best, Costas [[alternative HTML version deleted]]
2011 Apr 10
3
open.exe Virus W32.ATRAPS
Hello, I am not sure if this is the correct mailing list to send this email... I was trying to install on windows XP latest R-2.12.2 and my unvirus program (Immunet 3.0) reports a virus at open.exe while this is unpacked: W32.ATRAPS Has anyone come across the same problem? Best, Costas [[alternative HTML version deleted]]
2004 Jun 14
1
Matrix_0.8-8 and norm() function
Hello and apologies if this is a stupid question (just rejoined the list): Has anything changed with the norm() function with the latest update of the Matrix library? My old code seems not to be working properly even for very simple tests of the norm function. I get too many "No direct or inherited method for function "norm" for this call" messages. I am using windows, R
2004 Nov 18
1
Time series plot orientation
Hello, I am trying to rotate by 90 degrees a time series plot. So I need the time axis to be the vertical one. Is there an easy way? I couldn't guess anything from the help pages. Apologies for a silly question. Regards, Costas -- ================================================================= This e-mail contains information intended for the addressee only. It may be confidential and
2011 Mar 10
1
tryCatch - Continuing for/next loop after error
Dear all, I am not sure I understand fully the functionality of "tryCatch" and "try" commands and how these are used to continue a for/next loop if an error occurs within the loop. Can somebody point me to material (or share some code) with more extensive examples than the ones in the help/FAQ pages? Do explain my problem in more detail: for (i in 100:1000) { ## do
2011 Jan 22
1
R - Vectorization and Functional Programming Constructs
Hello, I am new to R (coming from Perl) and have what is, at least at this point, a philosophical question and a request for comment on some basic code. As I understand it - R emphasizes ,or at least supports, the functional programming model. I've come across some code that was markedly absent in for loops - and have been seeing some constructs that relate to functional programming and
1999 Feb 17
3
Variable Names
Dear R users, That's probably a silly question even for a newbie but : Is it possible to assign variable prices as variable names ? For instance, would something like the following work : for (i in 1:4) { error.i <- some_calculation } so "error.i" variables would be created for i=1,2,3,4 i.e. error.1 error.2 error.3 etc. etc. Costas --
2008 Jun 19
1
How can I shade the background area of a zoo time series object between specific dates?
Dear list members, How can I shade the background area of a zoo time series object between specific dates? eg. library(tseries) library(zoo) SP500<-get.hist.quote("^GSPC", start = "1990-01-01", quote = "Close") plot(SP500) How can I produce the same plot but with a (say) red background between 2007-04-12 and 2008-05-14 ?
2013 May 13
2
reduce three columns to one with the colnames
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt. Name: nicht verf?gbar URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130513/fe848ce7/attachment.pl>
2012 May 20
5
removeing only rows/columns with "na" value from square ( symmetrical ) matrix.
I have some square matrices with na values in corresponding rows and columns. M<-matrix(1:2,10,10) M[6,1:2]<-NA M[10,9]<-NA M<-as.matrix(as.dist(M)) print (M) 1 2 3 4 5 6 7 8 9 10 1 0 2 1 2 1 NA 1 2 1 2 2 2 0 1 2 1 NA 1 2 1 2 3 1 1 0 2 1 2 1 2 1 2 4 2 2 2 0 1 2 1 2 1 2 5 1 1 1 1 0 2 1 2 1 2 6 NA NA 2 2 2 0 1 2 1 2 7 1 1 1 1 1 1 0 2 1 2 8
2008 Apr 14
1
ctv, install.views, install.packages (& update.packages)
Dear all, Wouldn't it be helpful if the install.views install.packages update.packages had a "downloadonly=TRUE" flag which would allow us to download the packages and install them later (or put them in a USB stick and take them for installation on anothe PC). I am behind a firewall (Bank) and I have serious plroblem updating R or installing views (Finance, Econometrics etc.
2012 Mar 31
3
clear console
hi, I use R - 2.15(32bit), and want to make a code to clear a console. Actually, I used to run following code to do that but after update the version of R from 2.14 to 2.15, it doesn't work. cls <- function (t) { require(RDCOMClient) wsh <- COMCreate("Wscript.Shell") wsh$SendKeys("\f") invisible(wsh) } cls() or cls <-
2012 Sep 12
4
[LLVMdev] PDB debug info
Hi people, Unlike GCC, LLVM has seemingly good support for interoperability with MSVC built windows code. This makes LLVM particularly attractive to my company/project, but it seems LLVM doesn't support writing PDB debug into into it's COFF output. It seems Win64 exception handling has been added recently, which perhaps makes PDB the only outstanding feature for effective use with
2012 Feb 13
3
Change dataframe-structure
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt. Name: nicht verf?gbar URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120213/d2a5afa6/attachment.pl>
2007 Aug 02
2
plot to postscript orientation
Hi I am trying to save some plots in a postscript file. When I generate the plots in the main window, they appear correctly - their orientation is landscape (i.e., horizontal). However, when I open the .ps file with GSview, the whole page appears vertically, and the plot appears horizontally, which means that the plot is only partially visible (example here