similar to: expand.grid using a repeated vector as a parameter

Displaying 20 results from an estimated 20000 matches similar to: "expand.grid using a repeated vector as a parameter"

2008 Oct 23
1
save an object of class "im"
I have created various "im" objects, but can't seem to save and load them. I can save them, but as small files of less than 1Kb. Therefore, when they are re-loaded, they cannot be plotted as images. Any ideas please. Thankyou. Simon Parker Imperial College -- View this message in context: http://www.nabble.com/save-an-object-of-class-%22im%22-tp20134567p20134567.html Sent from
2008 Dec 09
3
Selecting rows that are the same in separate data frames
I want to compare two matrices or data frames and select or get an index for those rows which are the same in both. I have tried the following : a = matrix ( 1:10, ncol = 2 ) a b = matrix ( c ( 2,3,4,7,8,9 ), ncol = 2 ) b a[a==b] a = as.data.frame ( matrix ( 1:10, ncol = 2 ) ) a b = as.data.frame ( matrix ( c ( 2,3,4,7,8,9 ), ncol = 2 ) ) b a[a==b] Any ideas please.
2012 Aug 15
1
hidden for() loop subsetting a matrix?
Hi, I am subsetting a matrix thus: test [,1] [,2] [,3] [1,] 1 7 13 [2,] 2 8 14 [3,] 3 9 15 [4,] 4 10 16 [5,] 5 11 17 [6,] 6 12 18 test[cbind(c(1,3,5), c(2,1,3))] [1] 7 3 17 This works fine, and is the equivalent of c(test[1,2], test[3,1], test[5,3]). cbind(c(1,3,5), c(2,1,3)) would obviously look like: [,1] [,2] [1,] 1 2 [2,]
2011 Dec 05
2
barplot ignoring col parameter
Hi All, I'm having a problem with barplot: mydata [1,] 2 108 0 0 0 1 3 0 0 0 0 0 7 18 3 4 8 20 26 20 19 7 1 1 mycol = c(rep('yellow', 2), rep('white', 3), rep('orange',2), rep('white', 5), rep('orange',3), rep('red',9)) barplot(mydata, col = mycol) gives me an uniformly yellow barplot. How do I solve this? bw Federico
2007 Nov 25
2
Install repeated library
Hello - I cannot get to www.alpha.luc.ac.be/~jlindsey/rcode.html<http://www.alpha.luc.ac.be/%7Ejlindsey/rcode.html>to obtain and install the repeated library for use of glmm(). Is the web page not active? Can you give me an alternative location to obtain the repeated library? Thank you, Becky Parker [[alternative HTML version deleted]]
2006 Feb 09
1
R, Rcmdr crash on WinXP PRO laptop (PR#8583)
My system is a Dell laptop running Win XP Pro with SP2 and all current updates. R is version 2.2.1, Rcmdr is version 1.1-6 (also happens with 1.1-5). First attempt to import data from text file (in Rcmdr) works correctly with no errors or warnings. Second, third or fourth attempt to load same data or a similar dataset will cause all R windows, including Rcmdr and R console windows, to
2006 Jun 19
3
MLE maximum number of parameters
Hi All, I would like to know, is there a *ballpark* figure for how many parameters the minimisation routines can cope with? I'm asking because I was asked if I knew. Cheers, Federico -- Federico C. F. Calboli Department of Epidemiology and Public Health Imperial College, St. Mary's Campus Norfolk Place, London W2 1PG Tel +44 (0)20 75941602 Fax +44 (0)20 75943193 f.calboli [.a.t]
2010 Feb 11
1
Sweve/cacheSweave
Hi there I have a problem with using Sweave in combination with the option driver = cacheSweave. Whichever code I try to run - when it comes to converting the tex file into pdf it comes up with the same errors (\csname \endcsname errors). Does anybody have an idea what it going wrong? > Sweave("pgfSweave-example.Rnw",driver = cacheSweaveDriver) Writing to file
2006 Feb 08
2
logical condition in vector operation
HI All, I have a data frame such as: > test x y p d [1,] 1 0 10 21 0 [2,] 2 3 11 12 0 [3,] 3 4 12 23 0 [4,] 3 5 13 24 0 and I want to perfor some operations on the first two coulums, conditional on the uneqaulity values on the 3rd and 4th columns. For instance: j = 3 test[test[,1] == j, 5] = test[test[,1] == j,2] + test[test[,2] == j,1] gives me the result: test: x y p d
2011 Sep 01
4
readBin fails to read large files
Posting for a friend Begin forwarded message: From: "Geier, Florian" <florian.geier08@imperial.ac.uk<mailto:florian.geier08@imperial.ac.uk>> Subject: Fwd: readBin fails to read large files Date: September 1, 2011 4:10:53 PM GMT+01:00 To: Begin forwarded message: Date: 1 September 2011 16:01:45 GMT+01:00 Subject: readBin fails to read large files Dear all, I am trying
2016 Apr 27
3
Create a new variable and concatenation inside a "for" loop
Hello, Suppose the you need a loop to create a new variable , i.e., you are not reading data from outside the loop. This is a simple example in Matlab code, for i=1:5 r1=randn r2=randn r=[r1 r2] c(i,:)=r; % creation of each row of c , % the ":" symbol indicates all columns. In R this would be [i,] end The output of interest is c which I'm creating inside the "for" loop
2016 Apr 27
0
Create a new variable and concatenation inside a "for" loop
"c" an extremely commonly-used function. Functions are first-class objects that occupy the same namespaces that variables do, so they can obscure each other. In short, don't use variables called "c" (R is case sensitive, so "C" has no such problem). Wherever possible, avoid incremental concatenation like the plague. If you feel you must use it, at least
2009 Jun 26
2
Matching data to a new column
Hi all, I wonder if anyone can help, I have a dataframe with columns for... 'I.D' 'age' 'mothers I.D' 01 5 03 02 6 06 03 16 NA 04 8 06 05 3 NA 06 17 NA I need to create a new column for 'mothers age' which puts the age of the individual with 'mothers i.d' into the row for her offspring (so
2016 Apr 27
3
Create a new variable and concatenation inside a "for" loop
... "(R is case sensitive, so "C" has no such problem)." Well, not quite. Try ?C To add to the previous comments, Dr. Gordon appears to need to do her/his homework and spend some time with an R tutorial or two before posting further here. There are many good ones on the web. Some recommendations can be found here: https://www.rstudio.com/online-learning/#R Cheers, Bert
2016 Apr 28
0
Create a new variable and concatenation inside a "for" loop
Maybe I wasn't clear about my query. I'm very familiar with pre-allocation and vectorization and I had already wrote an R code for this problem in this way. My question wasn't about the most efficient way to solve the problem. It was about whether in R it was possible to use the same index used in the loop to create a new variable and store the results in as in the example showed
2008 Feb 18
2
predicting memory usage
Hi All, is there a way of predicting memory usage? I need to build an array of 86000 by 2500 numbers (or I might create a list of 2 by 2500 arrays 43000 long). How much memory should I expect to use/need? Cheers, Fede -- Federico C. F. Calboli Department of Epidemiology and Public Health Imperial College, St. Mary's Campus Norfolk Place, London W2 1PG Tel +44 (0)20 75941602 Fax +44
2012 Jan 28
3
logical subsetting, indexes and NAs
Dear All, just a quick example: > x = 1:25 > x[12] = NA > x [1] 1 2 3 4 5 6 7 8 9 10 11 NA 13 14 15 16 17 18 19 20 21 22 23 24 25 > y = x[x<10] > y [1] 1 2 3 4 5 6 7 8 9 NA Is there any way of NOT getting NA for y = x[x<10]? Similarly > y = x[x<15] > y [1] 1 2 3 4 5 6 7 8 9 10 11 NA 13 14 How do I get rid of the NA (not post
2013 May 02
3
Minimal build of R ...
Hi, I'm trying to cross-compile R to javascript so that it can run in a web-browser. Take as long as you need to stop laughing. So, as I was saying - I want to try and get a build of R running in the browser. [If you're not familiar with it already, you might enjoy looking at emscripten.org. It's a remarkably capable tool for translating LLVM bitcode to javascript. Check out some of
2009 Nov 13
4
R, NIH and FDA
Dear All, I will soon be working with NIH and possibly FDA. Will I be able to use R or will I be forced to use SAS? Cheers, Federico -- Federico C. F. Calboli Department of Epidemiology and Public Health Imperial College, St. Mary's Campus Norfolk Place, London W2 1PG Tel +44 (0)20 75941602 Fax +44 (0)20 75943193 f.calboli [.a.t] imperial.ac.uk f.calboli [.a.t] gmail.com
2007 Nov 26
4
writing summary() to a text file
Hi All, I would like to output the results of a function into a text file, legible as a such. The function produces a summary quite like: summary(lm(x ~ y + w * z)) [for instance] and I am not clear how to save this summary into a text file 'automagically', because I need to be able to do it in a for() loop. Cheers, Federico -- Federico C. F. Calboli Department of Epidemiology