Re: [R] twitteR location?

2012-08-14 Thread Sachinthaka Abeywardana
Did you mean the Vignette for twitteR? there is no FAQ section that I can see and I could not get the following to work either: a<-searchTwitter("sydney", n=100, geocode='-33.871841,151.206709, 1mi') returns with a null list. Is there some sort of registration I need to do for this to work?

Re: [R] lm without intercept

2012-08-14 Thread citynorman
The cor(mtcars$mpg, fitted(m0))^2 method works great - thanks so much Josh! I've had another instance (also ex intercept) where it actually gave the correct number, odd behavior. Thanks for the other posts also. As an aside, in my application a zero intercept makes economic sense and I'm using R

Re: [R] twitteR location?

2012-08-14 Thread Sachinthaka Abeywardana
That worked but how do you get the location of one particular tweet. So from that list of 10, say the first tweet, is there a way to say at exactly what location it was tweeted? Thanks, Sachin On Wed, Aug 15, 2012 at 2:36 PM, Bhupendrasinh Thakre wrote: > There is something wrong in your geo co

Re: [R] twitteR location?

2012-08-14 Thread Sachinthaka Abeywardana
what am I doing wrong here? Increased the radius to 10,000 miles and the dates are for the last two years. Surely this should get some tweets? a<-searchTwitter("sydney", n=100, geocode='-33.871841,151.206709, 1mi', since="2010-01-01", until="2012-08-01") Thanks, Sachin On Wed, Aug 15, 201

Re: [R] to remove columns and rows

2012-08-14 Thread David L Carlson
This should work if your data consist of integer values: > dput(file1) # This is the preferred way to send your data structure(list(V1 = c(1L, 1L, 1L, 1L, 1L, 1L), V2 = c(0L, 0L, 0L, 0L, 0L, 0L), V3 = c(2L, 2L, 2L, 2L, 2L, 2L), V4 = c(2L, 2L, 2L, 2L, 2L, 2L), V5 = c(1L, 1L, 1L, 1L, 1L, 1L), V6

[R] to remove columns and rows

2012-08-14 Thread Fabiane Silva
Dear, I am using R I'm trying to identify and remove columns and rows in a data frame that are has elements equals. For example in dataframe below. The columns 1, 2,3,4,5 ,6 and 10 (file1) has elements equal then should be removed. How can I ask R to remove those columns with same elements in ne

[R] twitteR location?

2012-08-14 Thread Sachinthaka Abeywardana
Hi all, Is it possible to get the latitude and longitude of the location of a tweet? If I do tweets<- searchTwitter("#obama", n=200) #get tweets df <- twListToDF(tweets) #converts to data frame for ease of viewing it does not seem to be getting the location of where tha

Re: [R] bootstrapped CI for nonlinear models using nlsBoot from nlstools

2012-08-14 Thread Bill Pikounis
Hello Francisco: I am not familiar with nlsBoot, but if things cannot be solved there, another option is the example shown in Chapter 8, page 225-226 of the Venables & Ripley MASS book (2002) which uses nls and the boot recommended package from R. The MASS package has a scripts subfolder for this b

Re: [R] Subsetting rows by multiple levels of selected values

2012-08-14 Thread nalluri pratap
merge(df1,df2) --- On Wed, 15/8/12, Jun Shen wrote: From: Jun Shen Subject: [R] Subsetting rows by multiple levels of selected values To: "R-help" Date: Wednesday, 15 August, 2012, 12:35 AM Dear list, Let's say we have a data frame as follows, >expand.grid(a=1:5,b=c(1,5,10,20),DV=c(0.1,0.

Re: [R] Not able to filter factor, class

2012-08-14 Thread nalluri pratap
I agree with John. Can you check that?   length(which(inclusion$Value == 0)) Pratap --- On Wed, 15/8/12, John Kane wrote: From: John Kane Subject: Re: [R] Not able to filter factor, class To: "Sri krishna Devarayalu Balanagu" , "r-help@r-project.org" Date: Wednesday, 15 August, 2012, 12:37

[R] igraph: Turn multiple edges into weights

2012-08-14 Thread Jonas Michaelis
Dear all, I have some network data - about 300 vertices and several thousand edges. I am looking for a way to turn multiple edges into weights of the edges. I looked around and - surprisingly? - haven't found anything. Is there an easy way to do this? Best, Jonas [[alternative HTML ver

Re: [R] What package to use to calculate odds ratio and the confidence interval?

2012-08-14 Thread arun
Hi, Please check this link: http://www.r-bloggers.com/computing-odds-ratios-in-r/  Also,  http://rgm2.lab.nig.ac.jp/RGM2/func.php?rd_id=HH:odds.ratio A.K. - Original Message - From: C W To: r-help Cc: Sent: Tuesday, August 14, 2012 2:18 PM Subject: [R] What package to use to calcul

Re: [R] Graphing question(basic)

2012-08-14 Thread R. Michael Weylandt
On Tue, Aug 14, 2012 at 2:39 AM, Mohan Radhakrishnan wrote: > > Apology. Will investigate ?segments. But this is simpler than that ? > > > think<-20 > > xc<-c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, > 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, > 34, 35, 36,

Re: [R] Error; contrasts can be applied only to factors with 2 or more levels

2012-08-14 Thread R. Michael Weylandt
On Tue, Aug 14, 2012 at 5:54 AM, grace wrote: > Hi, > > I have been running the same code without problem for the last few days, > changing data sets etc with no issue. > Today I changed the covariates for the model and am now getting this error > message: > Error in `contrasts<-`(`*tmp*`, value =

Re: [R] merge counts from table()

2012-08-14 Thread Francois Pepin
Thanks for all the replies. The merge solution is what I was groping toward but the factor solution is much cleaner since I do know in advance what the possible categories are. François On Aug 14, 2012, at 2:39 , PIKAL Petr wrote: > Hi > > If your x and y are factors it seems to be easy, jus

Re: [R] Can we interlink these three if conditions?

2012-08-14 Thread MacQueen, Don
Perhaps you are looking for this? if () { ## whatever } else if () { ## whatever } else if () { ## whatever } else { cat('none of the conditions was met\n') } Suggestion: study this example to see that your first if() condition is more complicated than necessary > if (identical(1,1) ==

Re: [R] What package to use to calculate odds ratio and the confidence interval?

2012-08-14 Thread Nordlund, Dan (DSHS/RDA)
What you presented below is not an odds ratio, but simply the odds of disease when some measure is less than 40%. But you can use the oddsratio() function from the epitools package to do the calculations that you want. Hope this is helpful, Dan Daniel J. Nordlund Washington State Department o

Re: [R] What package to use to calculate odds ratio and the confidence interval?

2012-08-14 Thread Viechtbauer Wolfgang (STAT)
This is not an odds ratio. You simply calculated 27/131 = .206, which is the odds of having the disease given <40%. You can calculate a confidence interval for this with: exp(log(27/131) - 1.96 * sqrt(1/27 - 1/(27+131))) exp(log(27/131) + 1.96 * sqrt(1/27 - 1/(27+131))) which yields (0.146, 0.2

Re: [R] Subsetting rows by multiple levels of selected values

2012-08-14 Thread Rui Barradas
Hello, Try the following. df3 <- merge(df2, df1) Hope this helps, Rui Barradas Em 14-08-2012 20:05, Jun Shen escreveu: Dear list, Let's say we have a data frame as follows, expand.grid(a=1:5,b=c(1,5,10,20),DV=c(0.1,0.2,0.3))->df1 df1$DV<-rgamma(60,shape=10) columns a and b are two levels

Re: [R] Subsetting rows by multiple levels of selected values

2012-08-14 Thread Ista Zahn
Hi Jun, I think merge(df1, df2) should do it. Best, Ista On Tue, Aug 14, 2012 at 3:05 PM, Jun Shen wrote: > Dear list, > > Let's say we have a data frame as follows, > >>expand.grid(a=1:5,b=c(1,5,10,20),DV=c(0.1,0.2,0.3))->df1 >>df1$DV<-rgamma(60,shape=10) > > columns a and b are two levels.

Re: [R] What package to use to calculate odds ratio and the confidence interval?

2012-08-14 Thread C W
The table did not come out on rich text format. So what I wrote was, <40%>40% Total No disease 131 75 206 Have diease 27 6 33 239 My odds ratio: 27/(27+131))/(131/(27+131)) = 0.206 I am lo

Re: [R] Not able to filter factor, class

2012-08-14 Thread John Kane
Are you sure that you are not confusing the number of levels with the length of the vector? John Kane Kingston ON Canada > -Original Message- > From: balanagudevaray...@gvkbio.com > Sent: Tue, 14 Aug 2012 12:40:26 + > To: r-help@r-project.org > Subject: [R] Not able to filter factor

[R] Subsetting rows by multiple levels of selected values

2012-08-14 Thread Jun Shen
Dear list, Let's say we have a data frame as follows, >expand.grid(a=1:5,b=c(1,5,10,20),DV=c(0.1,0.2,0.3))->df1 >df1$DV<-rgamma(60,shape=10) columns a and b are two levels. DV is the column with values we are interested in. Then another data frame df2 with values as follows data.frame(a=c(2,2,

Re: [R] What package to use to calculate odds ratio and the confidence interval?

2012-08-14 Thread C W
Suppose my results comes out like this, <40% >40% Total No disease 131 75 206 Have disease 27 6 33 239 My odds ratio: 27/(27+131))/(131/(27+131)) = 0.206 I want to calculate the confidence interval for it. Mike On Tue, Aug 14, 2012 at 2:52 PM, Nordlund, Dan (DSHS/RDA) < nord.

[R] bootstrapped CI for nonlinear models using nlsBoot from nlstools

2012-08-14 Thread Francisco Mora Ardila
Hi all I´m trying to get confidence intervals for parameters from nls modeling. I fitted a nls model to the following variables: > x [1] 2 1 1 5 4 6 13 11 13 101 101 101 > y [1] 1.281055090 1.563609934 0.001570796 2.291579783 0.841891853 [6] 6.553951324 14.243274230 14.5

Re: [R] Communative Matrix Multiplcation

2012-08-14 Thread Doran, Harold
No, not at all actually. I gave small enough matrices so you can eyeball it, but they are way off. It seems to be a problem (ahem, maybe even a bug) with some matrix operations in older version of R. Newer R yields true for the comparison. > -Original Message- > From: r-help-boun...@r-p

Re: [R] What package to use to calculate odds ratio and the confidence interval?

2012-08-14 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of C W > Sent: Tuesday, August 14, 2012 11:18 AM > To: r-help > Subject: [R] What package to use to calculate odds ratio and the > confidence interval? > > Hi list, > I am trying to

Re: [R] All combinations possible in a mutliple regression

2012-08-14 Thread zel7223
Leaps works :) Thanks a lot! JMF - Jean-Michel Fortin Étudiant au premier cycle en Biologie/ Undergraduate in Biology Lab Currie Université d'Ottawa/ Currie Lab University of Ottawa -- View this message in context: http://r.789695.n4.nabble.com/All-combinations-possible-in-a-mutliple-reg

[R] Specifying unique random effects for different groups

2012-08-14 Thread Clark Kogan
Hello, I have a longitudinal dataset with a number of subjects that were subjected to various sleep deprivation schedules. The data is grouped by individual, and the individuals are grouped by sleep schedule. I have fit a nonlinear mixed effects model to this dataset using the command: nlme(y ~ m

[R] What package to use to calculate odds ratio and the confidence interval?

2012-08-14 Thread C W
Hi list, I am trying to calculate the sensitivity, specificity, and odds ratio(and confidence interval). Say, my data looks like this 42.53, 37.56, 40.51, 32.67, 38.19, 81.74, 41.55, 68.94, 59, 63, 54.13, 48.85, 50.46, 51.78 Is there any packages in R that does this? Espeically the odds ratio co

Re: [R] Help needed in reading matlab files

2012-08-14 Thread Rui Barradas
Sorry, it's adj_con <- file(pathnames_adj, open = "rb") Rui Barradas Em 14-08-2012 19:12, Rui Barradas escreveu: Hello, I don't have MATLAB here so this is completely untested but the help page for readMat says: Arguments |con| Binary |connection

Re: [R] Help needed in reading matlab files

2012-08-14 Thread Rui Barradas
Hello, I don't have MATLAB here so this is completely untested but the help page for readMat says: Arguments |con| Binary |connection | to which the MAT file structure should be written to. A string is interpreted as file

Re: [R] problem installing mgcv

2012-08-14 Thread Marc Schwartz
On Aug 14, 2012, at 12:06 PM, Georgiana May wrote: > Hi all, > I am running into a problem installing a package. I am using a Mac with > OSX 10.5.8 > > I have been using mgcv for gam models, it has been working fine. > The mgcv listed in my directory of R packages (Package Manager) does not > l

Re: [R] Communative Matrix Multiplcation

2012-08-14 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Doran, Harold > Sent: Tuesday, August 14, 2012 10:27 AM > To: Doran, Harold; 'r-help@r-project.org' > Subject: Re: [R] Communative Matrix Multiplcation > > Meant to also add > >

Re: [R] Communative Matrix Multiplcation

2012-08-14 Thread Doran, Harold
Thanks, Berend. I updated my R and got same result. I reposted the old sessionInfo(), which was an older version. But, same code, same matrices, different result > -Original Message- > From: Berend Hasselman [mailto:b...@xs4all.nl] > Sent: Tuesday, August 14, 2012 1:49 PM > To: Doran, Ha

Re: [R] Communative Matrix Multiplcation

2012-08-14 Thread Berend Hasselman
On 14-08-2012, at 19:26, Doran, Harold wrote: > > I'm not seeing why the following occurs: > >> T1 <- (A1 - A2) %*% D >> T2 <- (A1 %*% D) - (A2 %*% D) >> identical(T1, T2) > [1] FALSE > ... I ran this in a clean environment library(Matrix) A1 <- new("dsCMatrix" , i = c(0L, 1L, 2L, 3L

Re: [R] Communative Matrix Multiplcation

2012-08-14 Thread Doran, Harold
I just updated my R and this no longer occurs. But, below is the sessionInfo() showing details of when this doesn't occur, which I should have posted in the OP > sessionInfo() R version 2.12.2 (2011-02-25) Platform: x86_64-pc-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=English_United States.1252

Re: [R] self-starter functions for y = a + b * c^x

2012-08-14 Thread Christof Kluß
Am 14-08-2012 19:40, schrieb Peter Ehlers: > On 2012-08-14 00:09, Christof Kluß wrote: >> But now I search a self-starter for y = a + b * c^x > Can't you just reparameterize with c^x = exp(x * log(c)) ? oh, I've missed this... thank you very much! Greetings Christof

Re: [R] self-starter functions for y = a + b * c^x

2012-08-14 Thread Peter Ehlers
On 2012-08-14 00:09, Christof Kluß wrote: Hi there are some predefined self-start functions, like SSmicmen, SSbiexp, SSasymp, SSasympOff, SSasympOrig, SSgompertz, SSflp, SSlogis, SSweibull, Quadratic, Qubic, SSexp (nlrwr) Btw, do you know graphic examples for this functions? The SSexpDecay (ex

[R] Communative Matrix Multiplcation

2012-08-14 Thread Doran, Harold
Friends I'm not seeing why the following occurs: > T1 <- (A1 - A2) %*% D > T2 <- (A1 %*% D) - (A2 %*% D) > identical(T1, T2) [1] FALSE Harold > dput(A1) new("dsCMatrix" , i = c(0L, 1L, 2L, 3L, 0L, 1L, 4L, 2L, 3L, 5L) , p = c(0L, 1L, 2L, 3L, 4L, 7L, 10L) , Dim = c(6L, 6L) , Dimna

Re: [R] Communative Matrix Multiplcation

2012-08-14 Thread Doran, Harold
Meant to also add library(Matrix) for reproducing From: Doran, Harold Sent: Tuesday, August 14, 2012 1:26 PM To: r-help@r-project.org Subject: Communative Matrix Multiplcation Friends I'm not seeing why the following occurs: > T1 <- (A1 - A2) %*% D > T2 <- (A1 %*% D) - (A2 %*% D) > identical(

Re: [R] Alternating between "for loops"

2012-08-14 Thread Claudia Penaloza
Thank you all for your help... below is the code that worked as I intended: J <- 48 N <- 1000 S <- 0.9 PsiADD <- 0.6 PsiAA <- 0.4 PsiaA <- 0.3 p <- 0.5 c <- p y <- matrix(0,N,J) y[,1]="A" dtp <- rep(c(TRUE, TRUE, FALSE, FALSE), 12)[seq_len(J)] for (q in 1:N){ (observable <- TRUE) for(j in wh

Re: [R] qpcR propagate problem

2012-08-14 Thread robertkeamsv
The problem was that I did not enter a square variance-covariance matrix (i.e., use.cov). -- View this message in context: http://r.789695.n4.nabble.com/qpcR-propagate-problem-tp4640081p4640269.html Sent from the R help mailing list archive at Nabble.com. __

[R] random variable selection algorithms for lda?

2012-08-14 Thread Thomas Schu
Dear R-experts, I would like to find the best variable combination which are maximises the accuracy of a cross validated reclassification. My data consists of 36 samples, equal distributed to 6 groups, and each sample are characterised by 20 variables. /data<-data.frame(1:36,1:20) group<-(1,1,1,1

[R] problem installing mgcv

2012-08-14 Thread Georgiana May
Hi all, I am running into a problem installing a package. I am using a Mac with OSX 10.5.8 I have been using mgcv for gam models, it has been working fine. The mgcv listed in my directory of R packages (Package Manager) does not load up and I receive the following: Error in dyn.load(file, DLLpat

[R] reshape cast to a sparse matrix?

2012-08-14 Thread Yin Aphinyanaphongs
I am using the reshape package to convert a series of values into a binary matrix. The binary matrix is very sparse with many zeros and I'd like to use cast to generate a sparse matrix using any of the sparse matrix packages of choice. Is there functionality to support this use? Are there strategi

Re: [R] set working directory to current source directory

2012-08-14 Thread Claudia Beleites
Hi Sachin, > Is there a way to get cran R to set the working directory to be > wherever the source file is? Each time I work on a project on > different computers I keep having to set the working directory which > is getting quite annoying. a while ago I asked a somewhat similar question on stack

Re: [R] one problem

2012-08-14 Thread arun
Hello, You need to include cc: to list in your replies. Does this work for you? dat1<-list() for(i in 1:100){  dat1[[i]]<-list()  seed<-.Random.seed  dat1[[i]]<-matrix(sample(c(0.23,0.56,0.45,0.85,0.7),2500,replace=TRUE),ncol=50)  }  dat1[[1]][1] #[1] 0.56  dat1[[2]][1] #[1] 0.85  dat1[[3]][1] #[1

[R] Help needed in reading matlab files

2012-08-14 Thread jerome
Dear users, I am stucked with a programming problem: I am trying to download a squared adjacency matrix from matlab with only 0 or 1. Doing it without a loop at first, I get an error message that is, I think, related to the "mat_adj<-readMat(pathnames_adj)" line. Did anybodz encouter already

Re: [R] length of variable in mlogit

2012-08-14 Thread Lee van Cleef
Hi Michael, many thanks for the useful hints which gave me some deeper knowledge of R. It is definitely much appreciated. I think I have found the mistake - the problems did not arise from variable definitions etc. It was an intellectual mistake. The cause for the problems was that I had to di

[R] Problems with lda-CV, and collinear variables in lda

2012-08-14 Thread Hennig, Christian
Dear R-help list, two issues regarding lda. 1) I'm puzzled by the fact that lda's in-build cross-validation gives results different from the manual cross-validation routine that I run (of course mine may be wrong, but I don't think so). See here: library(MASS) set.seed(12345) n <- 50 p <- 10 #

[R] Not able to filter factor, class

2012-08-14 Thread Sri krishna Devarayalu Balanagu
After importing data from Excel through ODBC. In the inclusion dataset, class(inclusion$Value) is coming as factor. After filtering the data, length(inclusion$Value == 0),the answer is coming as 4879, but actually Value contains only 225 rows. So how can I get the length as 225. Can anyone help?

Re: [R] pass by reference

2012-08-14 Thread William Dunlap
You can write the replacement-function like [the untested[ `col2<-` <- function(x, ..., value) { x$col2[x$col1 < 2] <- value x } so you can do modifications with the syntax col2(data) <- "L" If you also write the matching extractor col2 <- function(x) x$col2[x$col1 < 2] t

Re: [R] self-starter functions for y = a + b * c^x

2012-08-14 Thread Christof Kluß
Hi Ken Am 14-08-2012 11:50, schrieb ken knoblauch: > Christof Kluß email.uni-kiel.de> writes: > >> But now I search a self-starter for y = a + b * c^x > > You might be able to adapt the SS.calib function > from the psyphy package for this. > It was designed to fit gamma functions to the > l

Re: [R] pass by reference

2012-08-14 Thread Ben Tupper
Hi, On Aug 14, 2012, at 10:07 AM, Bert Gunter wrote: > (Offlist, as my comments are not worth bothering the list about). > Almost off list! > I don't understand the purpose of this tirade (whose reasonableness I > make no judgment of). R is what it is. If you don't like it for > whatever reaso

Re: [R] how to convert variable name to string?

2012-08-14 Thread peter dalgaard
On Aug 14, 2012, at 16:54 , Jinsong Zhao wrote: > Hi there, > > In the following function: > > demo.plot <- function( obj ) plot(1:5, obj, xlab = "x") > > Then, I use this function as following: > > y <- rnorm(5) > demo.plot(y) > > It will produce a plot with ylab = "obj", however, I hope to

[R] how to convert variable name to string?

2012-08-14 Thread Jinsong Zhao
Hi there, In the following function: demo.plot <- function( obj ) plot(1:5, obj, xlab = "x") Then, I use this function as following: y <- rnorm(5) demo.plot(y) It will produce a plot with ylab = "obj", however, I hope to get a plot with ylab = "y". Is it possible to convert object/variable

Re: [R] creation of package failed

2012-08-14 Thread Uwe Ligges
On 14.08.2012 10:16, Franckx Laurent wrote: Thanks for the quick response. Concerning your first point: the spaces in " Inno Setup 5" are not spaces between different directories, this was just the name of the directory as suggested during the installation procedure. Anyway, I have now added

Re: [R] pass by reference

2012-08-14 Thread Bert Gunter
(Offlist, as my comments are not worth bothering the list about). I don't understand the purpose of this tirade (whose reasonableness I make no judgment of). R is what it is. If you don't like it for whatever reason, don't use it. As a point of order, there are several packages that "automate" pa

Re: [R] SYSTEMFIT HELP

2012-08-14 Thread Arne Henningsen
Dear Arunima On 14 August 2012 08:58, Arunima Haldar wrote: > I want to know whether systemfit can solve simultaneous equations using > panel data. systemfit cannot *solve* systems of (simultaneous) equations but it can *estimate* systems of (simultaneous) equations. Do you want to *estimate* a

Re: [R] anova in unbalanced data

2012-08-14 Thread S Ellison
> -Original Message- > Say I have the following data: > > a<-data.frame(col1=c(rep("a",5),rep("b",7)),col2=runif(12)) > > a_aov<-aov(a$col2~a$col1) > > summary(aov) > > > Note that there are 5 observations for a and 7 for b, thus is > unbalanced. What would be the correct way of d

[R] Random effects in gam (mgcv 1.7-19)

2012-08-14 Thread silje skår
Hi, I am using the gam function in the mgcv package, I have random effects in my model (bs="re") this has worked fine, but after I updated the mgcv package to version 1.7-19 I recive an error message when I run the model. > fit1<-gam(IV~s(RUTE,bs="re")+s(T13)+s(H40)+factor(AAR)+s(V3)+s(G1)+s(H1)+

[R] Error; contrasts can be applied only to factors with 2 or more levels

2012-08-14 Thread grace
Hi, I have been running the same code without problem for the last few days, changing data sets etc with no issue. Today I changed the covariates for the model and am now getting this error message: Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) : contrasts can be applied onl

Re: [R] length of variable in mlogit

2012-08-14 Thread Lee van Cleef
Hi Michael, many thanks for your time and the hint. This is much appreciated. Indeed, I managed it to get part of the dataset from which I want to develop my final logit model in the correct long format with true/false standing in the column for the choice variable,. But the problem with the v

Re: [R] pass by reference

2012-08-14 Thread Kenn Konstabel
You can use macros for this effect. Or environments: daf <- data.frame(a=1:10, b=rnorm(10)) env <- as.environment(daf) fun <- function(x) x$c <- x$a+x$b fun(daf) fun(env) daf$c env$c You can see that the same function (fun) changes one object but leaves another one unchanged. But before using i

Re: [R] creation of package failed

2012-08-14 Thread Franckx Laurent
I should add to the previous mail that the installation has worked correctly under Cygwin after I had deleted the following files in the source directory: firstccfile.o and secondccfile.o However, this does not solve the problem under Windows. -Original Message- From: Franckx Laurent Se

Re: [R] self-starter functions for y = a + b * c^x

2012-08-14 Thread ken knoblauch
Christof Kluß email.uni-kiel.de> writes: > But now I search a self-starter for y = a + b * c^x > > Do you know a package that implement such self-starter or is there a > easy way to do it myself? You might be able to adapt the SS.calib function from the psyphy package for this. It was design

Re: [R] if else elseif for data frames

2012-08-14 Thread PIKAL Petr
Hi What about creating a new column with same factor and just chase its levels. dat2$col2<-dat2$col1 > levels(dat2$col2) [1] "high""low" "Neutral" > levels(dat2$col2)<-c("H", "L","N") > dat2 col1 col2 1 highH 2 NeutralN 3 NeutralN 4 lowL 5 highH 6

Re: [R] merge counts from table()

2012-08-14 Thread PIKAL Petr
Hi If your x and y are factors it seems to be easy, just add all levels in both. x.f<-factor(x, levels=1:5) y.f<-factor(y, levels=1:5) table(x.f)+table(y.f) x.f 1 2 3 4 5 1 2 2 2 1 If you just have output from table(x) without possibility to add levels you can go with merge > mm <- merge(a

Re: [R] R table as integrable object for large Latex Documents - avoiding SWeave

2012-08-14 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 13/08/12 18:46, clangkamp wrote: > Hi, I am wondering whether some of you have a pointer to an alternative. I am > currently writing > my thesis in Latex (several documents), well grown over time, I am sure many > of you are > familiar with the si

Re: [R] pass by reference

2012-08-14 Thread Jan T Kim
On Mon, Aug 13, 2012 at 11:20:26PM -0300, Alexandre Aguiar wrote: > Sachinthaka Abeywardana escreveu: > >Think you are missing the point, > > As lover of C-style pointers, I must admit that hiding complexities > (and associated problems) of pointers is a great feature of all successful > high lev

Re: [R] creation of package failed

2012-08-14 Thread Franckx Laurent
Thanks for the quick response. Concerning your first point: the spaces in " Inno Setup 5" are not spaces between different directories, this was just the name of the directory as suggested during the installation procedure. Anyway, I have now added underscores between the individual words in th

[R] SYSTEMFIT HELP

2012-08-14 Thread Arunima Haldar
Dear Users, I want to know whether systemfit can solve simultaneous equations using panel data. Regards Arunima [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do re

Re: [R] pass by reference

2012-08-14 Thread rest
Hi Sachinthaka, You can do it in the following way: getcol2<-function(data){ data$col2[data$col1<=2]="L" data<<-data } <<- writes the result to the underlying environment. This is however generally seen as very bad programming (side effects). Greet' Frans-Oorspronkelijk bericht- Van

[R] self-starter functions for y = a + b * c^x

2012-08-14 Thread Christof Kluß
Hi there are some predefined self-start functions, like SSmicmen, SSbiexp, SSasymp, SSasympOff, SSasympOrig, SSgompertz, SSflp, SSlogis, SSweibull, Quadratic, Qubic, SSexp (nlrwr) Btw, do you know graphic examples for this functions? The SSexpDecay (exponential decay) for y = (y0 - plateau)*exp(