similar to: How to generate a matrix where each row (or column) is the same vector?

Displaying 20 results from an estimated 10000 matches similar to: "How to generate a matrix where each row (or column) is the same vector?"

2009 Sep 18
1
Lattice barplot not wokring in for-loop?
Dear List-Members, I am plotting a barplot with the lattice package. The code works, but when I execute the same code in a for-loop no plot is shown. Can't figure what the problem is. (Maybe I am missing something here, but I tried it with plot device pdf, calling windows() or X11(), testing on windows and linux, etc.) INFO: R version 2.9.1 (2009-06-26) using Windows/RGui require(lattice)
2009 Sep 16
2
I want to get a reference to this time series object
I'm trying to get a reference to this object in C SWX.RET[1:6,c("SBI,"SPI","SII")] While i am able to access and use a plain SWX.RET object, I'm getting confused on how to create an object with the array subscripts like above. Here is what I tried to do. It doesn't work because "[" is obviously not an operation or function on SWX.RET. So how do I
2009 Sep 15
2
Putting together a constantly evolving package
Hi all, I'm putting together some common code + data into a custom package, everything is working out fine, but the ``R CMD INSTALL MyPackage`` call seems to take a particularly long time in the "**data" step: $ R CMD INSTALL MyPackage/ * installing to library ?/Library/Frameworks/R.framework/Resources/ library? * installing *source* package ? MyPackage? ... ** R ** data
2009 Sep 24
3
making R print on screen
Hello! I am running a "for" loop. In the loop I am producing some intermediary results and asking R to print it (of the type below). However, I noticed - when the task is complicated and takes a lot of time, R does not print those intermediary results immediately, but prints them in batches - or does not print at all until we are done with the whole calculation. Is there any way to
2009 Oct 01
2
Rd.sty question: LaTeX expert needed
The Rd.sty LaTeX package is used when building the R manuals, and by the LaTeX pages produced from the man pages. I have tracked down some problems G?bor Cs?rdi was having recently (see "Re: [R] preformatted and '#' in manual pages" in R-help) to a LaTeX problem, and am trying to work out how to fix it. Specifically, the .Rd file he was using had a structure like \dQuote{
2009 Sep 11
4
R on Multi Core
Hi, Our discussions about 64 bit R has led me to another thought. I have a nice dual core 3.0 chip inside my Linux Box (Running Fedora 11.) Is there a version of R that would take advantage of BOTH cores?? (Watching my system performance meter now is interesting, Running R will hold a single core at 100% perfectly, but the other core sites idle.) Thanks! -- Noah
2009 Sep 23
3
retrieve certain part from html
Dear All, Can someone please guide me how to get the certain part from a long html language? e.g. "<td><a href='2005-01.html'>2005-01</a></td><td><a href='2006-01.html'>2006-01</a></td><td><a href='2007-01.html'>2007-01</a></td><td><a
2009 Nov 05
1
combine UserDefinedDatabase and regular environments
Hello, Is it possible to have the effect of UserDefinedDatabase outside of "attached" environments ? Can I disguise an environment of the sys.frames() as a UserDefinedDatabase ? This seems to suggest that it might be possible : > f <- function(){ e <- environment(); class(e) <- "UserDefinedDatabase"; ff } > f() *** caught segfault *** address (nil),
2009 Oct 09
1
celebrating revision 50000
Hello, Today, Brian Ripley commited the revision 50000 of R's svn repository. I took this as an opportunity to do some data analysis of the log and posted some code and graphics on my blog: http://romainfrancois.blog.free.fr/index.php?post/2009/10/09/celebrating-R-commit-50000 The plots of the number of commits per day (and per month) indicates a peak in 2002. Here are the top 20
2009 Oct 10
1
isFALSE
Hello, Just wondering why there is "isTRUE" and not "isFALSE". Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/BcPw : celebrating R commit #50000 |- http://tr.im/ztCu : RGG #158:161: examples of package IDPmisc `- http://tr.im/yw8E : New R package : sos -------------- next part -------------- An
2009 Nov 07
1
getConnection, R_outpstream_st
Hello, I'm trying to use the limited connections api defined in Rinternals.h. I have code that looks like this (inspired from do_serializeToConn) : SEXP serialize_to_connection( SEXP xp, SEXP connection ){ Rconnection con ; struct R_outpstream_st out; R_pstream_format_t type = R_pstream_binary_format ; SEXP (*hook)(SEXP, SEXP) = NULL ; con = getConnection(Rf_asInteger(connection));
2009 Oct 13
4
Creating a list of empty lists
Well here is one more brain-teaser related to assigning stuff into a list of list. What if I need to create a new list of empty lists? I have actually got a solution to this problem: l = list(list()) for ( i in sequence(length-1) ) { l = list(unlist(l,recursive=FALSE), list()) } But it is not very neat to do this in a loop. Are there any cuter ways to do this?
2009 Oct 12
1
unexpected behaviour of isSymmetric() (PR#14000)
Full_Name: Mike Danilov Version: 2.9.0 OS: Fedora Core 9 Submission from: (NULL) (142.103.121.198) When checking for the symmetry of a matrix, function isSymmetric.matrix() gets confused by the discrepancy of colnames/rownames if its argument. See the code snippet below. Perhaps it's a problem of the matrix product which copies colnames of the first argument but not the rownames of the
2009 Oct 28
1
how can i call R program from one java program?
Dear All I want to call the R program from one Java program because In my project R program parameters are set by one web page developed by java. Is this possible to call R program from java? many thanks in advance -- Wesley C Mathew [[alternative HTML version deleted]]
2009 Oct 13
3
Function to find prime numbers
I need to create a function to find all the prime numbers in an array. Can anyone point me in the right direction? Thank you. AJ -- View this message in context: http://www.nabble.com/Function-to-find-prime-numbers-tp25868633p25868633.html Sent from the R help mailing list archive at Nabble.com.
2009 Oct 13
1
for loop over S4
Hello, Consider this : > setClass("track", representation(x="numeric", y="numeric")) [1] "track" > o <- new( "track", x = 1, y = 2 ) > for( i in o ){ + cat( "hello\n") + } Error: invalid type/length (S4/1) in vector allocation This happens at those lines of do_for: n = LENGTH(val); PROTECT_WITH_INDEX(v =
2009 Oct 16
2
Urgent help requested to modify a script
I am hoping someone will tak up this chalenge (I am new to R) I have inheritied an R script but need to change it. The script currently includes hardcoded file locations on lines 12,166 and 167. I need to modify this script to allow the folder to be passed as a command line argument to Rscript.exe Can anybody help please? Regards, Ian http://www.nabble.com/file/p25924237/My_script.R
2009 Nov 13
2
How to show all the functions and classes that are defined in a library?
library(some_library_name) Suppose I load a library. I'm wondering what command I should use to list all the functions, classes and variables defined in the library.
2009 Aug 06
1
How to show help in the same mode as where the commands is input?
Hi, In R command line, when I type "help(something)", it will always show the help in the different mode such that I don't see command lines anymore but just the help document. If I quit from the help mode, I will only see the command lines by not the help document. I would like the help document and command lines be show in the same mode. I'm wondering how to do so. Regards,
2009 Sep 29
3
How do I access class slots from C?
Hi I'm trying to implement something similar to the following R snippet using C. I seem to have hit the wall on accessing class slots using C. library(fPortfolio) lppData <- 100 * LPP2005.RET[, 1:6] ewSpec <- portfolioSpec() nAssets <- ncol(lppData) setWeights(ewSpec) <- rep(1/nAssets, times = nAssets) ewPortfolio <- feasiblePortfolio( data = lppData, spec = ewSpec,