similar to: data.frame with a column containing an array

Displaying 20 results from an estimated 10000 matches similar to: "data.frame with a column containing an array"

2023 May 09
1
data.frame with a column containing an array
I think the following may provide a clearer explanation: subs <- c(1,3) DFA <- data.frame(id = 1:3) ar <- array(1:12, c(3,2,2)) ## yielding > ar , , 1 [,1] [,2] [1,] 1 4 [2,] 2 5 [3,] 3 6 , , 2 [,1] [,2] [1,] 7 10 [2,] 8 11 [3,] 9 12 ## array subscripting gives > ar[subs,,] , , 1 [,1] [,2] [1,] 1 4 [2,] 3 6 , , 2
2023 May 25
1
data.frame with a column containing an array
So is this an expected behavior or is it a bug which should be reported somewhere else? Thanks! Georg? ? ? Gesendet:?Dienstag, 09. Mai 2023 um 19:28 Uhr Von:?"Bert Gunter" <bgunter.4567 at gmail.com> An:?"Georg Kindermann" <Georg.Kindermann at gmx.at> Cc:?"Rui Barradas" <ruipbarradas at sapo.pt>, r-help at r-project.org Betreff:?Re: [R] data.frame
2023 May 25
3
data.frame with a column containing an array
I really don't know. I would call it a request for extended capabilities of [.data.frame, rather than a feature or bug. But maybe wiser heads than mine who monitor this list can sort it out. -- Bert On Wed, May 24, 2023 at 8:52?PM Georg Kindermann <Georg.Kindermann at gmx.at> wrote: > So is this an expected behavior or is it a bug which should be reported > somewhere else? >
2017 Jun 04
0
New var
# read.table is NOT part of the data.table package #library(data.table) DFM <- read.table( text= 'obs start end 1 2/1/2015 1/1/2017 2 4/11/2010 1/1/2011 3 1/4/2006 5/3/2007 4 10/1/2007 1/1/2008 5 6/1/2011 1/1/2012 6 10/5/2004 12/1/2004 ',header = TRUE, stringsAsFactors = FALSE) # cleaner way to compute D DFM$start <- as.Date( DFM$start, format="%m/%d/%Y" ) DFM$end
2017 Jun 04
0
New var
Since the number of choices is small (6), how about this? Starting with Jeff's initial DFM: DFM <- structure(list(obs = 1:6, start = structure(c(16467, 14710, 13152, 13787, 15126, 12696), class = "Date"), end = structure(c(17167, 14975, 13636, 13879, 15340, 12753), class = "Date"), D = c(700, 265, 484, 92, 214, 57), bin = structure(c(6L, 3L, 5L, 1L, 3L, 1L), .Label
2017 Jun 04
2
New var
Thank you Jeff and All, Within a given time period (say 700 days, from the start day), I am expecting measurements taken at each time interval;. In this case "0" means measurement taken, "1" not taken (stopped or opted out and " -1" don't consider that time period for that individual. This will be compared with the actual measurements taken (Observed-
2011 Aug 27
2
Am having trouble calling a function
In my main R program, I have source("retaanalysis/Functions/doAirport.R") .... stuff to read data and calculate ads sapply(ads, function(x) {doAirport(x, base)} ) And doAirport has # analyze the flights for a given airport doAirport = function(df, base) { # Get rid of unused runway factor levels (from other airports) df$lrw <- drop.levels(df$lrw) # In gdata package #
2017 Jan 17
2
bug in rbind?
I suspect there may be a bug in base::rbind.data.frame Below there is minimal example of the problem: m <- matrix (1:12, 3) dfm <- data.frame (c = 1 : 3, m = I (m)) str (dfm) m.names <- m rownames (m.names) <- letters [1:3] dfm.names <- data.frame (c = 1 : 3, m = I (m.names)) str (dfm.names) rbind (m, m.names) rbind (m.names, m) rbind (dfm, dfm.names) #not working rbind
2017 Jul 16
0
About doing figures
Hi lily, As I have no idea of what the "true record" is, I can only guess. Maybe this will help: # get some fairly distinct colors rainbow_colors<-rainbow(9) # this should sort the numbers in dfm$A dfm$Acolor<-factor(dfm$A) plot(dfm$B,dfm$C,pch=ifelse(dfm$DF==1,1,19), col=rainbow_colors[as.numeric(dfm$Acolor)]) legend("bottom",legend=sort(unique(dfm$A)),
2017 Jul 16
2
About doing figures
Hi Jim, For true color, I meant that the points in the figure do not correspond to the values from the dataframe. Also, why to use rainbow(9) here? And the legend is straight in the middle, is it possible to reformat it to the very bottom? Thanks again. On Sun, Jul 16, 2017 at 2:50 AM, Jim Lemon <drjimlemon at gmail.com> wrote: > Hi lily, > As I have no idea of what the "true
2017 Jul 16
0
About doing figures
For more than 10 records, how to reformat the colors? Also, how to show the first legend only, but at the bottom, while the second legend in your code is not necessary? In all, the same A values have the same color, but different symbols in DF==1 and DF==2. Thanks for your help. On Sun, Jul 16, 2017 at 9:28 AM, lily li <chocold12 at gmail.com> wrote: > Hi Jim, > > For true color,
2017 Jul 16
2
About doing figures
Hi R users, I still have the problem about plotting. I wanted to put the datasets on one figure, x-axis represents values B, y-axis represents values C, while different colors label column A. Each record uses a circle on the figure, while hollow circles represent DF=1 and solid circles represent DF=2. I put my code below, but the A labels do not correspond to the true record, so I don't know
2014 Mar 06
1
Create dataframe in C from table and return to R
Hi , I am trying to create a dataframe in C and sebd it back to R. Can anyone point me to the part of the source code where it is doing , let me explain the problem I am having . -------------------------------------------------------------------- My simple implementation is like this SEXP formDF() { SEXP dfm ,df , dfint , dfStr,lsnm; char *ab[3] =
2017 Jun 03
2
New var
Thank you all for the useful suggestion. I did some of my homework. library(data.table) DFM <- read.table(header=TRUE, text='obs start end 1 2/1/2015 1/1/2017 2 4/11/2010 1/1/2011 3 1/4/2006 5/3/2007 4 10/1/2007 1/1/2008 5 6/1/2011 1/1/2012 6 10/5/2004 12/1/2004',stringsAsFactors = FALSE) DFM DFM$D =as.numeric(difftime(as.Date(DFM$end,format="%m/%d/%Y"),
2012 Jun 28
3
[LLVMdev] [llvm-commits] [PATCH] Refactoring the DFA generator
I missed last 2 commits made by Alexey. Following his advices, I updated the patch. It should be ok now. Ivan On 27/06/2012 21:42, Anshuman Dasgupta wrote: > Committed in r159281. > > -Anshu > > > On 6/26/2012 3:04 AM, Ivan Llopard wrote: >> Hi Anshu, >> >> I don't have commit access. It applies correctly on trunk, I've just >> checked it.
2018 May 23
1
legend order in ggplot2
Hi, I ran your code, but the results were not as expected. After I ran the code by "source", it return No id variables; using all as measure variables > p2 and no line or legend is on the graph (as attached) Am I doing anything wrong? John library(ggplot2) library(reshape2) dfm<-melt(df) dfm$variable<-factor(dfm$variable, levels=levels(dfm$variable)[c(2,1,3,4)])
2008 Nov 23
1
Help in Programming using Methods
I WROTE THIS FUNCTION BELOW test <- function(x, ...) UseMethod('test', x) test.data.frame = function(x, model, which, error, ...) { av <- aov(formula(model), data = x) res <- test.aovlist(av, which = which, error = error) return(res) } test.aovlist <- function(x, which, error, ...) { mm <- model.tables(x, "means") tabs <- mm$tables[-1]
2012 Jun 25
2
[LLVMdev] [llvm-commits] [PATCH] Refactoring the DFA generator
Hi Anshu, Just in case you have forgotten this thread ;-). Is this patch ok to commit or does it not apply to trunk properly ? I can fix it if that's the problem. Ivan On 20/06/2012 19:33, Anshuman Dasgupta wrote: > > > Thanks for reviewing this. I added a top comment for AddInsnClass > and I fixed the violation of column numbers. > > Great. Looks good to me. > >
2012 Jun 18
2
[LLVMdev] [llvm-commits] [PATCH] Refactoring the DFA generator
Hi Anshu, Thanks for reviewing this. I added a top comment for AddInsnClass and I fixed the violation of column numbers. On 15/06/2012 21:31, Anshuman Dasgupta wrote: > Hi Ivan, > > The patch looks good to me. I have a couple of minor comments: > > +void State::AddInsnClass(unsigned InsnClass, > Add a top level comment describing the function > > + std::map<State*,
2012 Jun 20
0
[LLVMdev] [llvm-commits] [PATCH] Refactoring the DFA generator
> Thanks for reviewing this. I added a top comment for AddInsnClass and I fixed the violation of column numbers. Great. Looks good to me. > IMO, it wil be nice to keep it alive for performance comparisons. Given the overall performance > is rather determined by transition searches on the current state, for small DFA tables may not be a win > and it may still be the case for