similar to: Composing two n-dimensional arrays into one n+1-dimensional array

Displaying 20 results from an estimated 6000 matches similar to: "Composing two n-dimensional arrays into one n+1-dimensional array"

2011 Oct 11
2
replicate data.frame n times
Hi, is there a way to replicate a data.frame like you can replicate the entries of a vector (with the repeat-function)? I want to do this: x <- data.frame(x, x) (where x is a data.frame). but n times. And it should be as cpu / memory efficient as possible, since n is pretty big in my case. thanks for any suggestions!
2011 May 12
3
assigning creating missing rows and values
I have a dataset where I have missing times (11:00 and 16:00). I would like the outputs to include the missing time so that the final time vector looks like "realt" and has the previous time's value. Ex. If meas at time 15:30 is 0.45, then the meas for time 16:00 will also be 0.45. meas are the measurements and times are the times at which they were taken. meas<-runif(18)
2011 Jul 14
5
Adding rows based on column value
Dear all, I have one problem and did not find any solution.(I have also attached the problem in text file because sometimes column spacing is not good in mail) I have a file(file.txt) attached with this mail.I am reading it using this code to make a data frame (file)- file=read.table("file.txt",fill=T,colClasses = "character",header=T) file looks like this- Chr Pos
2011 Jun 28
4
how to print "<=" in plot title
Hi, how can I print "<=" (I mean the symbol of just one character) in the main title of a plot? for example: plot(1:10, main=paste("x <=", x)) where variable x is some number generated on the fly. Thanks John
2011 Aug 15
2
Regression - how to deal with past values?
Dear R-users I need to fit a nonlinear model to a piece of data. The model to be fitted uses past values of the input and the ouput - something like y(k) ~ f(y(k-1),y(k-2),u(k),u(k-1) ....) (k is time index). As far as I know I could use earth(MARS), nnet and etc but I am not sure how to deal with the past values since most, if not all, examples I saw formula does not take in account past
2011 May 18
3
R Style Guide -- Was Post-hoc tests in MASS using glm.nb
Thanks Bill. Do you and others think that a link to this guide (or another)should be included in the Posting Guide and/or R FAQ? -- Bert On Tue, May 17, 2011 at 4:07 PM, <Bill.Venables at csiro.au> wrote: > Amen to all of that, Bert. ?Nicely put. ?The google style guide (not perfect, but a thoughtful contribution on these kinds of issues, has avoiding attach() as its very first line.
2011 Jul 26
5
Help with boxplot
Hi guys, I need your help with the boxplot. I've to create a boxplot starting from a table (.csv) in which there are the result of a test. Each column is a question and the rows are the answer of the respondents (from 0 to 5). Some answer is missing and has been filled with NA. the table has been loaded in R with the function read.csv I created the boxplot with the function boxplot and all
2008 Nov 29
2
Using grep() to subset lines of text
I have two vectors, a and b. b is a text file. I want to find in b those elements of a which occur at the beginning of the line in b. I have the following code, but it only returns a value for the first value in a, but I want both. Any ideas please. a = c(2,3) b = NULL b[1] = "aaa 2 aaa" b[2] = "2 aaa" b[3] = "3 aaa" b[4] = "aaa 3 aaa"
2011 Dec 27
2
How to create a matrix with 3 dimensions from several 2 dimensional matrice?
Hi every one, How is it possible to create a matrix with 3 dimensions from several 2 dimensional matrice? Is it possible that each of "elementary/building block" matrices could be called by its corresponding original name? Thanks alot. -- View this message in context:
2008 Nov 21
1
Bug in Kendall for n<4?
> library(Kendall) > Kendall(1:3,1:3) WARNING: Error exit, tauk2. IFAULT = 12 <<<<<< tau = 1, 2-sided pvalue =1 I believe Kendall tau is well-defined for this case and the reported value is correct; isn't it a bug to give a warning? (And if, e.g., the pvalue is not well-defined in this case, wouldn't it be better to return NA or NaN or something?) Also,
2009 Feb 17
2
cumsum vs. sum
I recently traced a bug of mine to the fact that cumsum(s)[length(s)] is not always exactly equal to sum(s). For example, x<-1/(12:14) sum(x) - cumsum(x)[3] => 2.8e-17 Floating-point addition is of course not exact, and in particular is not associative, so there are various possible reasons for this. Perhaps sum uses clever summing tricks to get more accurate results? In some
2009 Jul 29
3
Object equality for S4 objects
To test two environments for object equality (Lisp EQ), I can use 'identity': > e1 <- environment(local(function()x)) > e2 <- environment(local(function()x)) > identical(e1,e2) # compares object identity [1] FALSE > identical(as.list(e1),as.list(e2)) # compares values as name->value mapping [1] TRUE # (is there a
2011 Jun 24
4
What does class "call" mean? How do I make class "formula" into a "call"?
I have a list called "tabs" that I would like to have the same structure as my list "eqSystem." The two look like they have the same format but they are different because when I look at their attributes, class(eqSystem[[1]]) is "call" but class(tabs[[1]]) is "formula". I want to have class(tabs[[1]]) as a call too. So what does "call" mean? And how
2009 Mar 09
3
E`<`<rrors in recursive default argument references
Tested in: R version 2.8.1 (2008-12-22) / Windows Recursive default argument references normally give nice clear errors. In the first set of examples, you get the error: Error in ... : promise already under evaluation: recursive default argument reference or earlier problems? (function(a = a) a ) () (function(a = a) c(a) ) () (function(a = a) a[1] ) () (function(a = a)
2009 May 20
2
Class for time of day?
What is the recommended class for time of day (independent of calendar date)? And what is the recommended way to get the time of day from a POSIXct object? (Not a string representation, but a computable representation.) I have looked in the man page for DateTimeClasses, in the Time Series Analysis Task View and in Spector's Data Manipulation book but haven't found these. Clearly I can
2011 Jul 06
1
elegant way of removing NA's and selecting specific values from a data.frame
I have a data.frame "e" and would like to extract the 23rd column, remove any NA's and then remove any values >= 30. I can do it in steps such as this but have failed to figure out how to do it in a single line .... any suggestions? first <- e[,23] second <- first[!is.na(first)] third <- second[second<=30] thanks a bunch J -- Dr. Jim Maas University of East
2011 Aug 20
1
How to abort function execution after x-seconds
Hello all, I'm running a parameter grid optimization ( ksvm, kernlab package) and the optimizer seems not to converge for certain parameters and stays in a infinity loop. Would it be possible to abort the execution after x-seconds and continue with the next parameter set? Which R function do need to use to accomplish this? I had a look at, try() etc. but they didn't seem so fit my
2011 May 24
1
ANOVA Residual SS and MS of 0
I am trying to run an ANOVA on my soil respiration data, but I keep getting residual sum of squares and mean square of zero. As I understand it that would mean that the model terms explain all of the variation in the response variable. That should be virtually impossible, should it not? Where do I begin troubleshooting such a problem? -- View this message in context:
2011 Apr 09
1
Robust Statistics for Outlier Detection
Hi Dear All, Can someone give me a suggestion about which robust statistics are most appropriate for outlier detection in linear models, and is available with R ? Thanks for any idea. -- View this message in context: http://r.789695.n4.nabble.com/Robust-Statistics-for-Outlier-Detection-tp3438493p3438493.html Sent from the R help mailing list archive at Nabble.com.
2011 May 19
1
Converting Variable Name into String
Hello, I would like to create lagged and delta variables from a set of variables and then add them to a dataframe Suppose that GDPPcSa is a variable. I would like to be able to do this QuarterlyData$D1GdpPcSa = diff(GDPPcSa , 1) in an automated fashion so that I loop over Quartely data to compute the first difference of its variables and add them to the dataframe. .It would be great to get a