similar to: Help in Programming using Methods

Displaying 20 results from an estimated 900 matches similar to: "Help in Programming using Methods"

2006 Oct 20
2
CORRESPONDENCE ANALYSIS
Enio Jelihovschi" eniojelihovs@gmail.com Date: Fri, 20 Oct 2006 11:28:12 -0200 Subject: CORRESPONCE ANALYSIS Dear All I am new R user, trying to do correspondence analysis using the function mca of the package MASS. My question is: In the following example farms.mca <- mca(farms, abbrev = T) # Use levels as names plot(farms.mca, cex = rep(0.7, 2), axes = F) How can I change the
2011 Dec 22
1
mtrace function
I use windows xp. When trying to use the function mtrace from package debug the window that should open with the function to be debugged do not show any text at all. It shows only a part of my desktop. Does anyone know why. Is there any imcompatibility between windows xp and debug package. Thanks in advance. Enio Jelihovschi [[alternative HTML version deleted]]
2010 Mar 28
1
Fwd: col.axis
I need a help in the following code. I could not find any hint at the help files m <- c( 58, 47, 51, 57, 48) plot(1:5, m, pch=19, col=1:5, axes=FALSE) axis(1, at=1:length(m), labels=LETTERS[1:5], col.axis=2) The labels A B C D E appear in this case with the red color. What I really want is that thay get the same color as the circles, but if I try the line axis(1, at=1:length(m),
2011 Aug 03
4
Convert matrix to numeric
I have a matrix that looks like this: structure(c("0.0376673981759913", "0.111066500741386", "1", "1103", "18", "OPEN", "DEPR", "0.0404073656092023", "0.115186044704599", "1", "719", "18", "OPEN", "DEPR", "0.0665342096693433",
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
2005 Jan 13
1
how to use solve.QP
At the risk of ridicule for my deficient linear algebra skills, I ask for help using the solve.QP function to do portfolio optimization. I am trying to following a textbook example and need help converting the problem into the format required by solve.QP. Below is my sample code if anyone is willing to go through it. This problem will not solve because it is not set up properly. I hope I
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"),
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 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
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)])
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? >