[R] mapply on multiple data frames

2013-06-10 Thread Webb,Elizabeth E
Hi all- I am wondering about using the mapply function to multiple data frames. Specifically, I would like to do a t-test on a subset of multiple data frames. All data frames have the same structure. Here is my code so far: f<-function(x,y) { test<-t.test(x$col1[x$col3=="num",],v$col2[x$col3=

Re: [R] How can we access an element in a structure

2013-06-10 Thread Pascal Oettli
Hello, Already asked and answered here: http://stackoverflow.com/questions/4034436/extract-the-gradient-from-the-deriv-command Regards, Pascal 2013/6/11 jpm miao > Hi, > > I have a structure, which is the result of a function > How can I access the elements in the gradient? > > > dput(te

Re: [R] Fwd: Problem with ODBC connection

2013-06-10 Thread Duncan Mackay
Try library(RODBC) Channel1 <- odbcConnectExcel2007("MyFile.xls", readOnly = TRUE) Channel1 RODBC Connection 1 Details: case=nochange DBQ=g:\1\MyFile.xls DefaultDir=g:\1 Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)} DriverId=1046 MaxBufferSize=2048 PageTimeout=5

Re: [R] How can we access an element in a structure

2013-06-10 Thread Jorge I Velez
Hi Miao, Try attributes(test1)[[1]] HTH, Jorge.- On Tue, Jun 11, 2013 at 3:49 PM, jpm miao wrote: > Hi, > > I have a structure, which is the result of a function > How can I access the elements in the gradient? > > > dput(test1) > structure(-1.17782911684913, gradient = structure(c(-0.0

[R] How can we access an element in a structure

2013-06-10 Thread jpm miao
Hi, I have a structure, which is the result of a function How can I access the elements in the gradient? > dput(test1) structure(-1.17782911684913, gradient = structure(c(-0.0571065371783791, -0.144708170683529), .Dim = 1:2, .Dimnames = list(NULL, c("x1", "x2" > test1[[1]] [1] -1.177829 >

Re: [R] Fwd: Problem with ODBC connection

2013-06-10 Thread jwd
On Tue, 11 Jun 2013 02:19:14 +0545 Christofer Bogaso wrote: Any real answer would be contingent on a reader being provided a reproducible example. Since you don't provide that, there's not a lot of point to an answer. However, to tilt at a windmill, depending on the size and complexity of your da

Re: [R] Fwd: Problem with ODBC connection

2013-06-10 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Jeff Newmiller > Sent: Monday, June 10, 2013 9:45 PM > To: Christofer Bogaso; r-help > Subject: Re: [R] Fwd: Problem with ODBC connection > > Given the resounding silence, I would

Re: [R] Fwd: Problem with ODBC connection

2013-06-10 Thread Jeff Newmiller
Given the resounding silence, I would venture to guess that no-one here is interested in troubleshooting ODBC connections to Excel. The problem is most likely in the ODBC driver for Excel (not in R or RODBC), and Excel is NOT a database (so any data format problem is unlikely to be detected). --

Re: [R] Substituting the values on the y-axis

2013-06-10 Thread Jim Lemon
On 06/11/2013 12:26 AM, diddle1...@fastwebnet.it wrote: Hello, I plotted a graph on R showing how salinity (in ‰, y-axis) changes with time(in years, x-axis). However, right from the beginning on the Excel spreadsheet the v alues for salinity appeared as, for example, 35000‰ instead of 35‰, whic

Re: [R] Help with R loop for URL download from FRED to create US time series

2013-06-10 Thread jim holtman
This should do it for you: > base <- "http://research.stlouisfed.org/fred2/data/"; > > files <- lapply(state.abb, function(.state){ + cat(.state, "\n") + input <- read.table(paste0(base, .state, "RGSP.txt") + , skip = 11 + , header = TRUE +

Re: [R] padding specific missing values with NA to allow cbind

2013-06-10 Thread William Dunlap
Try adding the argument na.action = na.exclude to your call to lm(). See help("na.exclude") for details. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Rob Forsyt

[R] Help with R loop for URL download from FRED to create US time series

2013-06-10 Thread arum
I am downloading time series data from FRED. I have a working download, but I do not want to write out the download for all 50 states likes this: IDRGSP <- read.table('http://research.stlouisfed.org/fred2/data/IDRGSP.txt', skip=11, header=TRUE) IDRGSP$DATE <- as.Date(IDRGSP$DATE, '%Y-%m-%d') IDRGS

[R] padding specific missing values with NA to allow cbind

2013-06-10 Thread Rob Forsyth
Dear list Getting very frustrated with this simple-looking problem > m1 <- lm(x~y, data=mydata) > outliers <- abs(stdres(m1))>2 > plot(x~y, data=mydata) I would like to plot a simple x,y scatter plot with labels giving custom information displayed for the outliers only, i.e. I would like to def

Re: [R] Combining CSV data

2013-06-10 Thread arun
HI, I am not sure about your DataN1 column.  If there is any identifier to differentiate the comments (in this case 1,2,3), then it will easier to place that in the correct column.   My previous solution is not helpful in situations like these: dat2<-read.table(text=" Row_ID_N,  Src_Row_ID,  Data

Re: [R] Apply a PCA to other datasets

2013-06-10 Thread Thomas Stewart
Short answer: Yes. Long answer: Your question does not provide specific information; therefore, I cannot provide a specific answer. On Mon, Jun 10, 2013 at 1:23 PM, edelance wrote: > I have run a PCA on one data set. I need the standard deviation of the > first > two bands for my analysis. I

Re: [R] Speed up or alternative to 'For' loop

2013-06-10 Thread arun
Hi, Some speed comparisons: df <- data.frame(TreeID=rep(1:6000,each=20), Age=rep(seq(1,20,1),6000)) df$Height <- exp(-0.1 + 0.2*df$Age) df1<- df df3<-df library(data.table) dt1<- data.table(df) df$HeightGrowth <- NA system.time({  #Rui's 2nd function df2 <- data.matrix(df) for(i in seq_len(nro

Re: [R] Speed up or alternative to 'For' loop

2013-06-10 Thread MacQueen, Don
Well, speaking of hasty... This will also do it, provided that each tree's initial height is less than the previous tree's final height. In principle, not a safe assumption, but might be ok depending on where the data came from. df$delta <- c(NA,diff(df$Height)) df$delta[df$delta < 0] <- NA -Don

Re: [R] Combining CSV data

2013-06-10 Thread arun
Hi, Try this: dat1<-read.table(text=" Row_ID_CR,  Data1,    Data2,    Data3 1,  aa,  bb,  cc 2,  dd,  ee,  ff ",sep=",",header=TRUE,stringsAsFactors=FALSE) dat2<-read.table(text=" Row_ID_N,  Src_Row_ID,  DataN1 1a,  1,   

Re: [R] Speed up or alternative to 'For' loop

2013-06-10 Thread MacQueen, Don
Sorry, it looks like I was hasty. Absent another dumb mistake, the following should do it. The request was for differences, i.e., the amount of growth from one period to the next, separately for each tree. for (ir in unique(df$TreeID)) { in.ir <- df$TreeID == ir df$HeightGrowth[in.ir] <- c(NA

Re: [R] Speed up or alternative to 'For' loop

2013-06-10 Thread David Winsemius
On Jun 10, 2013, at 10:28 AM, Trevor Walker wrote: > I have a For loop that is quite slow and am wondering if there is a faster > option: > > df <- data.frame(TreeID=rep(1:500,each=20), Age=rep(seq(1,20,1),500)) > df$Height <- exp(-0.1 + 0.2*df$Age) > df$HeightGrowth <- NA #intialize with NA >

Re: [R] help needed! RMSE

2013-06-10 Thread Ben Bolker
mansor nad hotmail.com> writes: > i need HELPPP!! how do i calculate the RMSE value for two GEV > models?first GEV is where the three parameters are constant.2nd GEV > model a 4 parameter model with the location parameter is allowed to > vary linearly with respect to time while holding the othe

Re: [R] please check this

2013-06-10 Thread arun
Sorry, I forgot to paste some lines and change the names: res10Percent<- fun1(final3New,0.1,200) res10PercentSub1<-subset(res10Percent[duplicated(res10Percent)|duplicated(res10Percent,fromLast=TRUE),],dummy==1) indx1<-as.numeric(row.names(res10PercentSub1)) res10PercentSub2<-res10PercentSub1[or

Re: [R] Speed up or alternative to 'For' loop

2013-06-10 Thread MacQueen, Don
How about for (ir in unique(df$TreeID)) { in.ir <- df$TreeID == ir df$HeightGrowth[in.ir] <- cumsum(df$Height[in.ir]) } Seemed fast enough to me. In R, it is generally good to look for ways to operate on entire vectors or arrays, rather than element by element within them. The cumsum() funct

Re: [R] Combining CSV data

2013-06-10 Thread jim holtman
try this: > fileA <- read.csv(text = "Row_ID_CR, Data1,Data2,Data3 + 1, aa, bb, cc + 2, dd, ee, ff", as.is = TRUE) > > fileB <- read.csv(text = "Row_ID_N, Src_Row_ID, DataN1 + 1a, 1,

Re: [R] Speed up or alternative to 'For' loop

2013-06-10 Thread Rui Barradas
Hello, One way to speed it up is to use a matrix instead of a data.frame. Since data.frames can hold data of all classes, the access to their elements is slow. And your data is all numeric so it can be hold in a matrix. The second way below gave me a speed up by a factor of 50. system.time(

Re: [R] please check this

2013-06-10 Thread arun
Hi, Try this: res10Percent<- fun1(final3New,0.1,200) res10PercentSub1<-subset(res10Percent[duplicated(res10Percent)|duplicated(res10Percent,fromLast=TRUE),],dummy==1) indx1<-as.numeric(row.names(res10PercentSub1)) res10PercentSub2<-res10PercentSub1[order(res10PercentSub1$dimension),] indx11<-as.n

Re: [R] How sum all possible combinations of rows, given 4 matrices

2013-06-10 Thread Estigarribia, Bruno
It works, Arun. Thanks! (FYI, a couple a the matrices I am dealing with have 1000+ rows, so I had to do in on a supercomputer at work. For the curious, I am trying to find all possible scores in a model f language mixing described in: Title: Structured Variation in Codeswitching: Towards an Empiric

[R] Combining CSV data

2013-06-10 Thread Shreya Rawal
Hello R community, I am trying to combine two CSV files that look like this: File A Row_ID_CR, Data1,Data2,Data3 1, aa, bb, cc 2, dd, ee, ff File B Row_ID_N, Src_Row_ID, DataN1 1a, 1,

[R] Speed up or alternative to 'For' loop

2013-06-10 Thread Trevor Walker
I have a For loop that is quite slow and am wondering if there is a faster option: df <- data.frame(TreeID=rep(1:500,each=20), Age=rep(seq(1,20,1),500)) df$Height <- exp(-0.1 + 0.2*df$Age) df$HeightGrowth <- NA #intialize with NA for (i in 2:nrow(df)) {if(df$TreeID[i]==df$TreeID[i-1]) {df$Hei

[R] Apply a PCA to other datasets

2013-06-10 Thread edelance
I have run a PCA on one data set. I need the standard deviation of the first two bands for my analysis. I now want to apply the same PCA rotation I used in the first one to all my other data sets. Is there any way to do this in r? Thanks. -- View this message in context: http://r.789695.n4

[R] Fwd: Problem with ODBC connection

2013-06-10 Thread Christofer Bogaso
Any response please? Was my question not clear to the list? Please let me know. Thanks and regards, -- Forwarded message -- From: Christofer Bogaso Date: Sat, Jun 8, 2013 at 9:39 PM Subject: Re: Problem with ODBC connection To: r-help Hello All, My previous post remains unans

Re: [R] Selecting divergent colors

2013-06-10 Thread Ben Tupper
Hi, On Jun 10, 2013, at 3:46 PM, Adams, Jean wrote: > It will be hard to come up with 20 clearly distinguishable colors. Check > out the website http://colorbrewer2.org/ and the R package RColorBrewer. > It does not have a 20-color palette, but it does have some 8- to 12-color > palettes that ar

[R] parameters estimation of a normal-lognormal multivariate model

2013-06-10 Thread Hertzog Gladys
Dear all, I have to create a model which is a mixture of a normal and log-normal distribution. To create it, I need to estimate the 2 covariance matrixes and the mixing parameter (total =7 parameters) by maximizing the log-likelihood function. This maximization has to be performed by the nlm ro

Re: [R] reshaping a data frame

2013-06-10 Thread Abhishek Pratap
Thanks everyone for your quick reply. I think my contrived example hid the complexity I wanted to show by using only one variable. @Arun: I think your example is exactly what I was looking for. Very cool trick with 'ave' and 'seq_along'...just dint occur to me. Best, -Abh > > On Mon, Jun 10, 201

Re: [R] Selecting divergent colors

2013-06-10 Thread Adams, Jean
It will be hard to come up with 20 clearly distinguishable colors. Check out the website http://colorbrewer2.org/ and the R package RColorBrewer. It does not have a 20-color palette, but it does have some 8- to 12-color palettes that are very nice. library(RColorBrewer) display.brewer.all(n=NULL

Re: [R] Where Query in SQL

2013-06-10 Thread MacQueen, Don
Do this cat(sql.select,'\n') and then decide whether the query is what it should be according to standard SQL syntax. (If it is not, then fix it.) -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 6/10/13 11:47 AM, "Sneh

Re: [R] woby2 (Odds Ratio) for variables with 3 or more levels

2013-06-10 Thread James C. Whanger
You may want to consider a cumulative logit model which effectively bifurcates an ordinal variable by utilizing the odds of being in a given level or below (depending on your coding). On Mon, Jun 10, 2013 at 12:27 PM, Vlatka Matkovic Puljic wrote: > Dear all, > > I am using Epi package to calcu

[R] Where Query in SQL

2013-06-10 Thread Sneha Bishnoi
Hey all I am trying to use where in clause in sql query in R here is my code: sql.select<-paste("select PERSON_NAME from UNITS where UNIT_ID in ('",cathree,"')",sep="") where cathree is 1 variable with 16 observations as follows UNIT_ID 1 205 2 209 3 213 4 217 5 228 6 232 7 236 8 240 9 245 10 2

Re: [R] woby2 (Odds Ratio) for variables with 3 or more levels

2013-06-10 Thread David Winsemius
On Jun 10, 2013, at 9:27 AM, Vlatka Matkovic Puljic wrote: > Dear all, > > I am using Epi package to calculate Odds ratio in my bivariate analysis. > How can I make *twoby2 *in variables that have 3 or more levels. I hope looking at that again you will see how odd it sounds to be requesting ad

Re: [R] read.csv timing

2013-06-10 Thread ivo welch
here are some small benchmarks on an i7-2600k with an SSD: input file: 104,126 rows with 76 columns. all numeric. linux> time bzcat bzfile.csv.bz2 > /dev/null --> 1.8 seconds R> d <- read.csv( pipe( bzfile ) ) --> 6.3 seconds R> d <- read.csv( pipe( bzfile ), colClasses="numeric") --> 4.2 s

[R] Selecting divergent colors

2013-06-10 Thread Brian Smith
Hi, I was trying to make a density plot with 13 samples. To distinguish each sample, it would be good if each color is as different as possible from the other colors. I could use the built in function, but that does not do more than 8 colors and then goes back to recycling the cols. If I use a pal

Re: [R] How to expand.grid with string elements (the half!)

2013-06-10 Thread William Dunlap
Perhaps the OP wants the unique combinations of V1 and V2, as in R> d <- expand.grid(V1=c("x","y","z"),V2=c("x","y","z")) R> d[ as.numeric(d$V1) <= as.numeric(d$V2), ] V1 V2 1 x x 4 x y 5 y y 7 x z 8 y z 9 z z or R> V <- letters[24:26] R> rbind(t(combn(V,m=2)), c

Re: [R] Substituting the values on the y-axis

2013-06-10 Thread John Kane
Hi Emanuela, Welcome to R It can be hard finding even relatively simple things when you are just starting. You might want to have a look at http://www.unt.edu/rss/class/Jon/R_SC/ or http://www.burns-stat.com/documents/tutorials/impatient-r/ if ou have not already seen them. Patrick Burn's s

[R] woby2 (Odds Ratio) for variables with 3 or more levels

2013-06-10 Thread Vlatka Matkovic Puljic
Dear all, I am using Epi package to calculate Odds ratio in my bivariate analysis. How can I make *twoby2 *in variables that have 3 or more levels. For example: I have 4 level var (Age) m=matrix(c(290, 100,232, 201, 136, 99, 182, 240), nrow=4, ncol=2) library (Epi) twoby2(m) R gives me only Comp

Re: [R] Rcmdr seit heute nicht mehr ladbar

2013-06-10 Thread John Fox
Dear Bastian, I'm afraid that I don't read German, but (as near as I can tell) since you say that you're using the most recent version of R and have X11 installed, you should have the software you need. Just in case, you might check the Rcmdr installation notes for Mac users at

Re: [R] Substituting the values on the y-axis

2013-06-10 Thread Emanuela
I did look into tutorials but I could not find the exact request I am looking for. I just started using R so I am still a beginner. If you then know where I can find it, can you please redirect me to it -- View this message in context: http://r.789695.n4.nabble.com/Substituting-the-values-on

Re: [R] Substituting the values on the y-axis

2013-06-10 Thread John Kane
Just calculate a new sequence if those percentages are in an orderly sequence. See ?seq v <- seq(25, 200, by = 10) or perhaps the values are actually text ?substr x <- substr(v, 1,2) John Kane Kingston ON Canada > -Original Message- > From: diddle1...@fastwebnet.it > Sent: Mon, 1

Re: [R] Substituting the values on the y-axis

2013-06-10 Thread Bert Gunter
Sounds like you have made no effort to learn R, e.g. by reading the Intro to R tutorial packaged with R or other online tutorial (there are many). Don't you think you need to do some homework first? -- Bert On Mon, Jun 10, 2013 at 7:26 AM, wrote: > Hello, > > I plotted a graph on R showing how

[R] Rcmdr seit heute nicht mehr ladbar

2013-06-10 Thread Bastian Wimmer
Wenn man ihn mal braucht ist er tot. folgende Fehlermeldung ereilt mich seit heute beim starten des R Commander auf dem Mac: > library(Rcmdr) Lade nötiges Paket: car Lade nötiges Paket: MASS Lade nötiges Paket: nnet Error : .onAttach in attachNamespace() für 'Rcmdr' fehlgeschlagen, Details:   Auf

[R] Substituting the values on the y-axis

2013-06-10 Thread diddle1990
Hello, I plotted a graph on R showing how salinity (in ‰, y-axis) changes with time(in years, x-axis). However, right from the beginning on the Excel spreadsheet the v alues for salinity appeared as, for example, 35000‰ instead of 35‰, which I gues sed must have been a typing error for the websi

[R] twoby2 (Odds Ratio) for variables with 3 or more levels

2013-06-10 Thread Vlatka Matkovic Puljic
Dear all, I am using Epi package to calculate Odds ratio in my bivariate analysis. How can I make *twoby2 *in variables that have 3 or more levels. For example: I have 4 level var (Age) m=matrix(c(290, 100,232, 201, 136, 99, 182, 240), nrow=4, ncol=2) twoby2(m) R gives me only Comparing : Row 1

Re: [R] How to expand.grid with string elements (the half!)

2013-06-10 Thread MacQueen, Don
If you can explain why those particular six combinations out of the complete set of nine, then perhaps someone can tell you how. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 6/9/13 10:25 PM, "Gundala Viswanath" wrote

Re: [R] recode: how to avoid nested ifelse

2013-06-10 Thread Paul Johnson
Thanks, guys. On Sat, Jun 8, 2013 at 2:17 PM, Neal Fultz wrote: > rowSums and Reduce will have the same problems with bad data you alluded > to earlier, eg > cg = 1, hs = 0 > > But that's something to check for with crosstabs anyway. > > This "wrong data" thing is a distraction here. I guess I

Re: [R] please check this

2013-06-10 Thread arun
Hi, Try this: which(duplicated(res10Percent)) # [1] 117 125 157 189 213 235 267 275 278 293 301 327 331 335 339 367 369 371 379 #[20] 413 415 417 441 459 461 477 479 505 res10PercentSub1<-subset(res10Percent[which(duplicated(res10Percent)),],dummy==1)   #most of the duplicated are dummy==1 res10Pe

Re: [R] reshaping a data frame

2013-06-10 Thread arun
Hi,If your dataset is similar to the one below: set.seed(24) temp1_df<- data.frame(names=rep(c('foo','foo1'),each=6),variable=rep(c('w','x'),times=6),value=sample(25:40,12,replace=TRUE),stringsAsFactors=FALSE) library(reshape2)   res<-dcast(within(temp1_df,{Seq1<-ave(value,names,variable,FUN=seq_

Re: [R] All against all correlation matrix with GGPLOT Facet

2013-06-10 Thread John Kane
No image. The R-help list tends to strip out a lot of files. A pdf or txt usually gets through. In any case I understand what you want this may do it. library(ggplot2) dat1 <- data.frame( v = rnorm(13), w = rnorm(13), x = rnorm(13), y = rnorm(13), z = rnorm(13)) plotmatrix(dat1) John Kane Ki

Re: [R] reshaping a data frame

2013-06-10 Thread John Kane
Unless I completely misunderstand what you are doing you don't need to aggregate, just drop the one column and rename things newtemp <- temp_df[, c(1,3)] names(newtemp) <- c("names", "w") newtemp John Kane Kingston ON Canada > -Original Message- > From: abhishek@gmail.com > Sen

Re: [R] reshaping a data frame

2013-06-10 Thread Adams, Jean
Abhi, In the example you give, you don't really need to reshape the data ... just rename the column "value" to "w". Here's a different example with more than one category ... tempdf <- expand.grid(names=c("foo", "bar"), variable=letters[1:3]) tempdf$value <- rnorm(dim(tempdf)[1]) tempdf library(r

Re: [R] agnes() in package cluster on R 2.14.1 and R 3.0.1

2013-06-10 Thread Martin Maechler
> Hugo Varet > on Sun, 9 Jun 2013 11:43:32 +0200 writes: > Dear R users, > I discovered something strange using the function agnes() of the cluster > package on R 3.0.1 and on R 2.14.1. Indeed, the clusterings obtained are > different whereas I ran exactly the same cod

Re: [R] cannot load pbdMPI package after compilation

2013-06-10 Thread Antoine Migeon
Thank you, I will try contact the developper. Antoine Migeon Université de Bourgogne Centre de Calcul et Messagerie Direction des Systèmes d'Information tel : 03 80 39 52 70 Site du CCUB : http://www.u-bourgogne.fr/dsi-ccub Le 10/06/2013 08:19, Prof Brian Ripley a écrit : > On 10/06/2013 03:17,

Re: [R] modify and append new rows to a data.frame using ddply

2013-06-10 Thread Berend Hasselman
On 10-06-2013, at 11:49, Santiago Guallar wrote: > Hi, > > I have a data.frame that contains a variable act which records the duration > (in seconds) of two states (wet-dry) for several individuals (identified by > Ring) over a period of time. Since I want to work with daytime (i.e. from > s

[R] Estimation of covariance matrices and mixing parameter by a bivariate normal-lognormal model

2013-06-10 Thread hertzogg
Dear all, I have to create a model which is a mixture of a normal and log-normal distribution. To create it, I need to estimate the 2 covariance matrixes and the mixing parameter (total =7 parameters) by maximizing the log-likelihood function. This maximization has to be performed by the nlm routin

[R] modify and append new rows to a data.frame using ddply

2013-06-10 Thread Santiago Guallar
Hi, I have a data.frame that contains a variable act which records the duration (in seconds) of two states (wet-dry) for several individuals (identified by Ring) over a period of time. Since I want to work with daytime (i.e. from sunrise till sunset) and night time (i.e. from sunset till next s

Re: [R] Not sure this is something R could do but it feels like it should be.

2013-06-10 Thread Jim Lemon
On 06/09/2013 11:14 PM, Calum Polwart wrote: ... What we are trying to do is determine the most appropriate number to make the capsules. (Our dosing is more complex but lets stick to something simple. I can safely assure you that vritually no-one actually needs 250 or 500mg as a dose of amoxicill

Re: [R] How to expand.grid with string elements (the half!)

2013-06-10 Thread Rolf Turner
Your question makes no sense at all. The grid expansion has 9 rows. In case you hadn't noticed, 9 is an odd number (i.e. not divisible by 2). There are no "halves". Do not expect the list to read your mind. Instead, ask a meaningful question. cheers, Rolf Turner On 10/06/13 17

Re: [R] Error Object Not Found

2013-06-10 Thread Rui Barradas
Hello, Please quote context. The message you get means that package foreign is installed on your computer, you need to load it in the R session: library(foreign) Hope this helps, Rui Barradas Em 09-06-2013 23:07, Court escreveu: Hi, I think that they are loaded. Here is the response that

Re: [R] problems with setClass or/and setMethod

2013-06-10 Thread David Winsemius
On Jun 9, 2013, at 11:37 PM, andreas betz wrote: > Hello, > > I am working my way through "A (not so) Short introduction to S4" > > I created a class > > setClass(Class = "Trajectories", > representation = representation(times = "numeric",traj = "matrix")) > > and tried to build a met

[R] Create a package with "package.skeleton"

2013-06-10 Thread jpm miao
Hi, I am trying to build a package with package.skeleton function. I already have the function "quadprod2.R" in the current folder. After running the program, library(frontier) source("quadprod2.R") package.skeleton(name="sfa_ext") > package.skeleton(name="sfa_ext") Creating directories .

[R] problems with setClass or/and setMethod

2013-06-10 Thread andreas betz
Hello, I am working my way through "A (not so) Short introduction to S4" I created a class setClass(Class = "Trajectories", representation = representation(times = "numeric",traj = "matrix")) and tried to build a method using setMethod( f = "plot", signature = "Tra

Re: [R] Identifying breakpoints/inflection points?

2013-06-10 Thread dchristop
You can try this: library(inflection) #you have to instsall package inflection first a<-findiplist(cbind(year),cbind(piproute),1) a The answer: [,1] [,2] [,3] [1,]5 35 1986.0 [2,]5 30 1983.5 shows that the total inflection point is between 1983 and 1986, if we treat d