Re: [R] graphs

2009-07-25 Thread Radha Krishna
Hi Mary, One can use arrows too... Here is the code : x<-seq(75,225,0.1) plot(x,dnorm(x,mean=140, sd=15), type='l', col='navy') *arrows(149,0,149,dnorm(149,140,15),length=0) *par(new=T) plot(x,dnorm(x,mean=150, sd=15), type='l', col='orange',axes=F) Regards Radha On Sun, Jul 26, 2009 at 5:09

Re: [R] graphs

2009-07-25 Thread Poersching
Mary A. Marion schrieb: > Hello, > > I am plotting two distributions and want to draw a vertical line at > the critical point 149. > How can I stop it from going further up than the norm(140,15) curve? > > x<-seq(75,225,0.1) > plot(x,dnorm(x,mean=140, sd=15), type='l', col='navy') > abline(v = 149,

Re: [R] yaxp problem for more irregular time series in one plot

2009-07-25 Thread Poersching
lanc...@fns.uniba.sk schrieb: > Good day, > > I'm trying to get more time series in one plot. As there are bigger > differences in values of variables I need logaritmic y axis. > > The code I use is the following: > > nvz_3_data <- read.csv('/home/tomas/R_outputs/nvz_3.csv') > date <- (nvz_3_data$d

[R] How to add 95% confidence intervals in the calibration plot?

2009-07-25 Thread zhu yao
Dear experts: I am a newbie to R. Recently, I try to make prediction models with R and the Design library. I have read Prof. Harrell's excellent book. But I did not quite understand. I have two problems about the validation and calibration of prediction models: 1. Can someone explain the results o

Re: [R] Sweave, cacheSweave, and data frame

2009-07-25 Thread Gabor Grothendieck
Another thing you can do to save time is to use the --no-vignettes switch when you build the package. On Sat, Jul 25, 2009 at 11:05 PM, Shige Song wrote: > Dear All, > > I have been using Sweave (mainly via the Sweave.sh script) and really like > it. I am working a paper (using Sweave, of course)

[R] Sweave, cacheSweave, and data frame

2009-07-25 Thread Shige Song
Dear All, I have been using Sweave (mainly via the Sweave.sh script) and really like it. I am working a paper (using Sweave, of course) which includes several time-consuming computations, and it gets tedious to re-compile the whoel thing every time I made changes. Then I discover the "cacheSweave"

Re: [R] Entire Organization Switching from SAS to R - Any experience?

2009-07-25 Thread dave fournier
It is true that R does not offer support for custom likelihood functions in nonlinear mixed models. However you can switch to R and use AD Model Builder's random effects module http://admb-project.org This is freely available software and it is more flexible than proc nlmixed. I'm sure there are pe

Re: [R] Assessing standard errors of polynomial contrasts

2009-07-25 Thread Daniel Malter
I should have mentioned that I am using the lmer library for my analyses, just in case other methods provide results differently. Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-he

[R] Assessing standard errors of polynomial contrasts

2009-07-25 Thread Daniel Malter
Hi, using polynomial contrasts for the ordered factors in an experiment leads to much nicer covariance structure than using treatment contrasts. It is easy to assess the mean effect for each of the experimental groups. However, standard errors are provided only for the components of the orthogonal

Re: [R] More complicated multi-plot layouts?

2009-07-25 Thread Mark Knecht
Thanks guys! I appreciate the pointers. Cheers, Mark On Sat, Jul 25, 2009 at 5:57 PM, Gabor Grothendieck wrote: > See ?layout > > opar <- par(mar = c(2, 2, 2, 2)) > m <- matrix(c(1, 1, 1, 2, 2, 2, >       1, 1, 1, 2, 2, 2, >       3, 4, 5, 9, 10, 11, >       6, 7, 8, 12, 13, 14), 4, byrow = TRUE)

Re: [R] More complicated multi-plot layouts?

2009-07-25 Thread Gabor Grothendieck
See ?layout opar <- par(mar = c(2, 2, 2, 2)) m <- matrix(c(1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 3, 4, 5, 9, 10, 11, 6, 7, 8, 12, 13, 14), 4, byrow = TRUE) layout(m) for(i in 1:14) plot(i) On Sat, Jul 25, 2009 at 8:34 PM, Mark Knecht wrote: > Hi, >   I made the attached pictur

Re: [R] More complicated multi-plot layouts?

2009-07-25 Thread jim holtman
Use 'layout' to define the regions: may need to change the 'mar' layout(rbind(c(1,1,2,2), c(3,4,7,8), c(5,6,9,10)), height=c(2,1,1)) layout.show(10) plot(0) plot(1) for (i in 1:4) plot(i) for (i in 11:14) plot(i) On Sat, Jul 25, 2009 at 8:34 PM, Mark Knecht wrote: > Hi, >   I made the atta

Re: [R] zoo plot: yearly marks on X-Axis

2009-07-25 Thread Gabor Grothendieck
There is an example of this in the examples section of ?plot.zoo after the comment: shade a portion of a plot and make axis fancier On Sat, Jul 25, 2009 at 8:36 PM, stvienna wiener wrote: > Hi all, > > I am plotting a financial time series, but I need a more detailed X-Axis. > > Example: > x <- zo

[R] zoo plot: yearly marks on X-Axis

2009-07-25 Thread stvienna wiener
Hi all, I am plotting a financial time series, but I need a more detailed X-Axis. Example: x <- zoo(rnorm(1:6000), as.Date("1992-11-11")+c(1:6000)) plot(x) The X-Axis is labeled "1995", "2000" and "2005". I would need either "1995", "1997", etc. or maybe yearly I used google first, then look a

Re: [R] r2 question

2009-07-25 Thread Ronggui Huang
summary(lm1) will show you R2 and adjusted R2 too. Ronggui 2009/7/26 Steve Lianoglou : > Hi Sarah, > > On Jul 25, 2009, at 8:25 AM, Buckmaster, Sarah wrote: > >> Hi everyone, >> >> I have a question about calculating r-squared in R. I have tried searching >> the archives and couldn't find what I

Re: [R] Determine the dimension-names of an element in an array in R

2009-07-25 Thread Gabor Grothendieck
Try this: > ix <- c(1, 3, 4, 2) > mapply("[", dimnames(mydatastructure), ix) [1] "S1" "T3" "U4" "V2" On Sat, Jul 25, 2009 at 5:12 PM, Sauvik De wrote: > Hi: > How can I extract the dimension-names of a pre-defined element in a > multidimensional array in R ? > > A toy example is provided below:

Re: [R] labelling points plotted in a 2D plan

2009-07-25 Thread Khaled OUANES
Thanks for the answer Tal! But I can't get it to work correctly! :( Please bear with me this is the first time I am using R! and I am in a rush to correct a paper in fact on the plane I am plotting a table > fullpointed=read.table("fullpoints_backup.txt",h=F) > plot(range(-2.5,0.95),range(0.00,1.0

Re: [R] labelling points plotted in a 2D plan

2009-07-25 Thread Khaled OUANES
hey thanks for the answer but I couldn't achieve it? would you explain a bit more? I have like 300 points to label! thanks [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLE

[R] yaxp problem for more irregular time series in one plot

2009-07-25 Thread lanczos
Good day, I'm trying to get more time series in one plot. As there are bigger differences in values of variables I need logaritmic y axis. The code I use is the following: nvz_3_data <- read.csv('/home/tomas/R_outputs/nvz_3.csv') date <- (nvz_3_data$date) NO3 <- (nvz_3_data$NO3) NH4 <- (nvz_3_da

Re: [R] A Harder Score Test Question

2009-07-25 Thread Sean
Thanks so much. You saved me a lot of programming time. FYI, here is the code that produces what I need. library(survival) ### Data time<-rexp(100) grp<-rep(0:1,times=50) cens<-rbinom(100,size=1,p=.9) ### Score Test From iter.max=0 fit0 <- coxph( Surv(time,cens)~grp , iter.max = 0 ) vcov(fit0)

Re: [R] A Harder Score Test Question

2009-07-25 Thread Charles C. Berry
On Sat, 25 Jul 2009, Sean wrote: Does anyone know how get the score and information under the null from coxph? I know that I can get the chi-square value of the score from coxph, but I need the two components separately. I have a function that computes the two components when I do not have ties

[R] Determine the dimension-names of an element in an array in R

2009-07-25 Thread Sauvik De
Hi: How can I extract the dimension-names of a pre-defined element in a multidimensional array in R ? A toy example is provided below: I have a 4-dimensional array with each dimension having certain length. In the below example, "mydatastructure" explains the structure of my data. mydatastructure

Re: [R] graphs

2009-07-25 Thread Steve Lianoglou
Hi Mary, On Jul 25, 2009, at 7:39 PM, Mary A. Marion wrote: Hello, I am plotting two distributions and want to draw a vertical line at the critical point 149. How can I stop it from going further up than the norm(140,15) curve? x<-seq(75,225,0.1) plot(x,dnorm(x,mean=140, sd=15), type='l',

Re: [R] graphs

2009-07-25 Thread baptiste auguie
Try with ?segments, x<-seq(75,225,0.1) plot(x,dnorm(x,mean=140, sd=15), type='l', col='navy') #abline(v = 149, col = "black") segments(149, 0, 149, dnorm(149,140,15)) curve(dnorm(x,mean=150, sd=15),from=75, to=225, col='orange', add=TRUE) HTH, baptiste 2009/7/26 Mary A. Marion > Hello, > >

[R] graphs

2009-07-25 Thread Mary A. Marion
Hello, I am plotting two distributions and want to draw a vertical line at the critical point 149. How can I stop it from going further up than the norm(140,15) curve? x<-seq(75,225,0.1) plot(x,dnorm(x,mean=140, sd=15), type='l', col='navy') abline(v = 149, col = "black") curve(dnorm(x,mean=15

[R] A Harder Score Test Question

2009-07-25 Thread Sean
Does anyone know how get the score and information under the null from coxph? I know that I can get the chi-square value of the score from coxph, but I need the two components separately. I have a function that computes the two components when I do not have ties but I would like to leverage the op

Re: [R] how to avoid a for looping break after an error message

2009-07-25 Thread cls59
Victor Landeiro wrote: > > Hi all, > I wrote a piece of code that generates simulated variables. after variable > generation I use them in several analyzes. > However, when I use a for to repeat the procedure 1000 times I get an erro > message in one of the "for" steps, precisely at this time:

Re: [R] ROCR package question

2009-07-25 Thread Tobias Sing
Waverley, if you want to modify components of the ROCR plot, you need to direct the parameters to the component functions by prefixing them with the name of that component function. In your case, you should add "boxplot.outline=FALSE" as follows: plot(perf, avg= "vertical", spread.estimate="boxpl

[R] how to avoid a for looping break after an error message

2009-07-25 Thread Victor Landeiro
Hi all, I wrote a piece of code that generates simulated variables. after variable generation I use them in several analyzes. However, when I use a for to repeat the procedure 1000 times I get an erro message in one of the "for" steps, precisely at this time: gls.temp<- gls(y2 ~ x2,correlation=corE

Re: [R] Deleting .RData files

2009-07-25 Thread milton ruser
Be carefull with this, but: rm(list=ls()) q("yes") :-) milton On Sat, Jul 25, 2009 at 7:19 AM, Paul Emberson wrote: > Hi John, > > You can use > > rm(object) > > to delete a specific object from the current environment and then save > your workspace again without those objects > > ls() > > to s

Re: [R] ROCR package question

2009-07-25 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Waverley > Sent: Saturday, July 25, 2009 10:38 AM > To: r-help; r-help@r-project.org > Subject: [R] ROCR package question > > Thanks for the quick reply. That is very clear for

[R] ROCR package question

2009-07-25 Thread Waverley
Thanks for the quick reply. That is very clear for my question 1, 2. How about question 3? When I plot, is there way not to show the whisker plot outliers for evaluating the multiple runs? I have tried to put the option from boxplot command outline=FALSE, however, it did not work. Can you help?

Re: [R] Specifying package dependencies

2009-07-25 Thread Uwe Ligges
Christopher Bare wrote: Hi, I'm trying to put together an R package. My library has dependencies on three other libraries: RSQLite, gaggle (a component of Bioconductor), and another package that is available as a download from the author's website. Is it possible to specify each of those depe

Re: [R] spline regression

2009-07-25 Thread Greg Snow
Natural splines (nsin the splines package rcs in the Hmisc or Design package) are linear outside of the range of the knots. You could use those and just specify the knots to be within the portion that you want to allow to be non-linear. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statis

Re: [R] r2 question

2009-07-25 Thread Steve Lianoglou
Hi Sarah, On Jul 25, 2009, at 8:25 AM, Buckmaster, Sarah wrote: Hi everyone, I have a question about calculating r-squared in R. I have tried searching the archives and couldn't find what I was looking for - but apologies if there is somewhere I can find this... I carried out a droughtin

Re: [R] labelling points plotted in a 2D plan

2009-07-25 Thread Tal Galili
Sure, Here is an example: # get some random data to play with x <- runif(100) y <- runif(100) labels.to.plot <- sample(c("A","B"), 100, replace = T) # set up the window, play them one by one to see what they do plot.window(ylim = c(0,1), xlim = c(0,1)) plot.new() axis(1) axis(2) box() # plot th

Re: [R] ROCR package question

2009-07-25 Thread Tobias Sing
Waverley, see help('performance-class') for a description of the slots. Your AUCs will be in p...@y.values, which itself is a list (one list element per run). Thus, you can use functions like unlist or s/lapply to access them, e.g. mean(unlist(p...@y.values)) Kind regards, Tobias On Sat, Jul

[R] NAs in Time-Series after building differences

2009-07-25 Thread Lynn Weber
I want to estimate a VAR-model with 4 endogenous variables. One of the included times series is stationary, two are stationary in first differences and the last is stationary in second differences. By building the differences I obtained NAs for the first one or two observations. So my first idea w

[R] ROCR package question

2009-07-25 Thread Waverley
Thanks for the reply. I am not sure I am following: 1. for the sample code. I tried p...@auc but get auc object not found 2. I am SPECIFICALLY interested in the averaged auc value of the multiple runs. How to get that out? I typed perf and it comes out as a list. 3. as for the plot using whisk

Re: [R] a question about replacing a column that is factor

2009-07-25 Thread Berend Hasselman
jlfmssm wrote: > > Sorry, I didn't get it. > I made a simple example to explain what I want > >> x=c(1,2,4,4) >> y=c("A",1,2,"A") >> test<-as.data.frame(cbind(x,y)) >> test > x y > 1 1 A > 2 2 1 > 3 4 2 > 4 4 A >> test[test$x==4,]$y<-'B' > Warning message: > In `[<-.factor`(`*tmp*`, iseq, val

Re: [R] a question about replacing a column that is factor

2009-07-25 Thread Paul Emberson
Hi, You can add extra levels using levels(). e.g. > test <- data.frame(x=c(1,2,4,4), y=c("A", 1, 2, "A")) > levels(test$y) <- c(levels(test$y), 'B') > levels(test$y) [1] "1" "2" "A" "B" > test[test$x==4,]$y<-'B' > test x y 1 1 A 2 2 1 3 4 B 4 4 B Regards, Paul jlfmssm wrote: Sorry, I didn

Re: [R] suggestion for paired t-tests

2009-07-25 Thread Juliet Hannah
Hi Jack, Maybe this helps. # make some data set.seed(123) condition <- factor(rep(c("a","b"), each = 5)) score <- rnorm(10); lg <- data.frame(condition, score) # Carry out commands a <- subset(lg,condition=="a")["score"] b <- subset(lg,condition=="b")["score"] t.test(a,b,paired=TRUE) #Error

Re: [R] a question about replacing a column that is factor

2009-07-25 Thread jlfmssm
Sorry, I didn't get it. I made a simple example to explain what I want > x=c(1,2,4,4) > y=c("A",1,2,"A") > test<-as.data.frame(cbind(x,y)) > test x y 1 1 A 2 2 1 3 4 2 4 4 A > test[test$x==4,]$y<-'B' Warning message: In `[<-.factor`(`*tmp*`, iseq, value = c("B", "B")) : invalid factor level,

Re: [R] labelling points plotted in a 2D plan

2009-07-25 Thread Tal Galili
Hi Khaled. I believe using "text" on an empty plot would do the trick... Tal On Sat, Jul 25, 2009 at 3:13 PM, Khaled OUANES wrote: > I created a 2 D plan: > > > plot(range(-2.5,0.95),range(0.00,1.00),type="n",axes=TRUE) > > I made a projection of points with their coordonates (X,Y) in that

Re: [R] Most elegant way to use formals() in building functions

2009-07-25 Thread Frank E Harrell Jr
Duncan Murdoch wrote: On 24/07/2009 6:35 PM, Frank E Harrell Jr wrote: Dear Group: I want to create a function having a ... argument and to have the default arguments evaluated, as thus: g <- function(a, b, ...) a+b formals(g) <- alist(a=,b=2+3,...=) g function (a, b = 2 + 3, ...) a + b But

Re: [R] regex expression to select row or column

2009-07-25 Thread Gabor Grothendieck
Try this. The last function removes everything but the last part, i.e. the part after the -. Then we order the columns, except the first column, by their last part and finally split the result by the last part of the ID. This gives a list of data frames, two in this case: > last <- function(x) s

Re: [R] regex expression to select row or column

2009-07-25 Thread jim holtman
Does this do what you want: > x ID S1-a S1-b S2-a S2-b 1 001-A1234 2 001-B5678 3 002-A9 10 11 12 4 002-B 13 14 15 16 > # split the column names > t.n <- strsplit(names(x)[-1], '-') > t.n <- sort(sapply(t.n, function(a) paste(a[2],a[1]))) > # c

Re: [R] FW: Qury Related With R

2009-07-25 Thread Romain Francois
Hi, The file did not make it through the mailing list. Maybe you are looking for ?read.dcf Can you describe the way your application interacts with R. Romain On 07/25/2009 10:35 AM, bed.si...@oracle.com wrote: Hi, I am using the R-2.9.1 with Window XP. Queries: 1. I am r

[R] labelling points plotted in a 2D plan

2009-07-25 Thread Khaled OUANES
I created a 2 D plan: > plot(range(-2.5,0.95),range(0.00,1.00),type="n",axes=TRUE) I made a projection of points with their coordonates (X,Y) in that plan > fullpoints=read.csv2("fullpoints.csv",h=T) > plot(fullpoints) The points are listed in that .csv file it is organized this way: 0,4887

[R] spline regression

2009-07-25 Thread serbring
i have a trend that it is linear at first and then it has a particular trend. There is a mathematic model, but it describes only the linear part. I have tried to use a spline regressione, but i have obtained a particular fit trend that it is unreal. Can i create a spline regression that it is of a

Re: [R] how to smooth timeseries without the lagging?

2009-07-25 Thread stephen sefick
Have you thought about fourier filtering? here is some code that may help. library(StreamMetabolism) library(mFilter) data(DOTemp) #this makes it the same everytime set.seed(100) #making a time series with the frequency = 96 #reading in one unit in other words this is 15min data #so there are 9

[R] FW: Qury Related With R

2009-07-25 Thread bed.si...@oracle.com
Hi, I am using the R-2.9.1 with Window XP. Queries: 1. I am running the java application which needs to load property file in R. So can you please tell me how I can load my property file in R session so that my application can find that property file? A

[R] r2 question

2009-07-25 Thread Buckmaster, Sarah
Hi everyone, I have a question about calculating r-squared in R. I have tried searching the archives and couldn't find what I was looking for - but apologies if there is somewhere I can find this... I carried out a droughting experiment to test plant competition under limited water. I had: -

Re: [R] Deleting .RData files

2009-07-25 Thread Paul Emberson
Hi John, You can use rm(object) to delete a specific object from the current environment and then save your workspace again without those objects ls() to see a list of objects could also be useful Regards, Paul John Seppänen wrote: > Hi all! I have accidentially saved few objects when I hav

[R] Deleting .RData files

2009-07-25 Thread John Seppänen
Hi all! I have accidentially saved few objects when I have closed workspace and clicked from "save workspace image" "Yes". Now I would like to delete the .RData files so that workspace wouldnt restore the unwanted objects everytime I open the workspace. I know i could delete the corresponding .RDa

Re: [R] matplot in two axis

2009-07-25 Thread Jim Lemon
Oscar Bayona wrote: Hell, I want to plot two column vectors in a plot, line type, but they have different scale, how can I plot both series on the same graph but one on the left axis and the other scale reflecting on the right axis? Hi Oscar, See if twoord.plot in the plotrix package does w

Re: [R] CI wiskers

2009-07-25 Thread Jim Lemon
mfreidin wrote: I have a matrix containing means and CIs (lower and upper in two columns, so three columns for every data point) for several points. I have to build a graph of these means accompained by the CIs (as wiskers). No problems with making the graph of means, but I don't know how to intr

Re: [R] how to smooth timeseries without the lagging?

2009-07-25 Thread Gabor Grothendieck
On Sat, Jul 25, 2009 at 5:07 AM, Dieter Menne wrote: > > > > losemind wrote: >> >> If I use a moving average, it will smooth the choppy time series, but >> it will lead to lagging... >> > > The lagging can only be removed if you look into the future, otherwise you > run into causality problems. > S

Re: [R] Lists

2009-07-25 Thread Linlin Yan
How about like this: for (i in seq_along(a)) { result <- as.list(a[1:i]) cat("iterator", i, ":\n") print(result) } On Sat, Jul 25, 2009 at 6:48 AM, Alberto Lora M wrote: > Hi Everybody > > I have the following problem > > suppose that we > > a<-c("uno","dos","tres") > > I am working with a

Re: [R] ROCR package question

2009-07-25 Thread Tobias Sing
Waverley, use @ (instead of $) to extract the slots from the performance object (it's S4 class system). HTH, Tobias On Sat, Jul 25, 2009 at 8:20 AM, Waverley wrote: > I use ROCR to plot multiple runs' performance.  Using the sample code > as example: > > # plot ROC curves for several cross-val

Re: [R] regex expression to select row or column

2009-07-25 Thread Junqian Gordon Xu
You're right. Using read.csv, the first column is a factor, not string (or should I use str?). The following is a 2x2 version of the data frame after read.csv IDS1-a S1-b S2-a S2-b 1 001-A1 2 3 4 2 001-B5 6 7 8 3 002-A9 101112 4

Re: [R] how to smooth timeseries without the lagging?

2009-07-25 Thread Dieter Menne
losemind wrote: > > If I use a moving average, it will smooth the choppy time series, but > it will lead to lagging... > The lagging can only be removed if you look into the future, otherwise you run into causality problems. So the easiest way is to center your output data on half the window

Re: [R] matplot in two axis

2009-07-25 Thread Dieter Menne
osbacan wrote: > > I want to plot two column vectors in a plot, line type, but they > have different scale, how can I plot both series on the same graph but one > on the left axis and the other scale reflecting on the right axis? > See http://markmail.org/thread/tdlsk3rpao7t6k7z but make s

Re: [R] ROCR package question

2009-07-25 Thread Dieter Menne
waverley palo wrote: > > I use ROCR to plot multiple runs' performance. Using the sample code > as example: > > I can follow the code and plot without any problem. However, I don't > know how to extract the averaged ROC area under curve value. > > See the documentation of performance. Amo

Re: [R] How to test frequency independence (in a 2 by 2 table) withmany missing values

2009-07-25 Thread Tal Galili
Hello Daniel, Thank you for the extended answer. You gave me one more reason to delve into mixed models in the future. I will be honest and say that I believe I will explore Roberts approach more due to the simplicity of it. But nevertheless, I am very grateful for your reply. With best regards,

Re: [R] regex expression to select row or column

2009-07-25 Thread jim holtman
Are you using 'read.csv'? At least include an 'str' of the object you are wanting to convert so that we know the structure of it, since we can not guess at what it is. On Sat, Jul 25, 2009 at 4:32 AM, Junqian Gordon Xu wrote: > Actually when I read the spreadsheet from cvs file, "S1-[abcd]" are t

Re: [R] regex expression to select row or column

2009-07-25 Thread Junqian Gordon Xu
Actually when I read the spreadsheet from cvs file, "S1-[abcd]" are the header and "T1-[abcd]" are the strings in first column of the data frame. Gordon On 07/25/2009 03:13 AM, jim holtman wrote: It it not entirely clear what the format of your data is. If you have a dataframe that you would l

Re: [R] Lists

2009-07-25 Thread jim holtman
Here is one way: > a<-c("uno","dos","tres") > x <- list() > a<-c("uno","dos","tres") > x <- list() > for (i in seq_along(a)){ + # add to the list + x[[i]] <- a[i] + str(x) + } List of 1 $ : chr "uno" List of 2 $ : chr "uno" $ : chr "dos" List of 3 $ : chr "uno" $ : chr "dos" $ : chr "t

Re: [R] How to convert a matrix to a dataframe and makes its first row be the column name

2009-07-25 Thread jim holtman
If what you are showing is a 'matrix' (you did not include a reproducible script, nor did you show an 'str' of the data), then it is a character matrix. I took your data, read it in as a dataframe and then converted it to 'matrix' (x.mat). You can see below that this is a character matrix. If I

Re: [R] regex expression to select row or column

2009-07-25 Thread jim holtman
It it not entirely clear what the format of your data is. If you have a dataframe that you would like to separate into several different one based on the value in a column, then something like this will work: df.list <- split(yourDF, yourDF$column) This will create a list of dataframes, split acc

[R] matplot in two axis

2009-07-25 Thread Oscar Bayona
Hell, I want to plot two column vectors in a plot, line type, but they have different scale, how can I plot both series on the same graph but one on the left axis and the other scale reflecting on the right axis? Thanks in advance. [[alternative HTML version deleted]] __