[R] Unbalance to balance panel

2013-04-09 Thread Akhil dua
Is there any package to balance the unbalance panel data? -- Akhil Dua Mo:+91-7827-662-202 Consultant National Institute of Public Finance and Policy [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Question on Stopword Removal from a Cyrillic (Bulgarian)Text

2013-04-09 Thread Ventseslav Kozarev, MPP
Hi, I bumped into a serious issue while trying to analyse some texts in Bulgarian language (with the tm package). I import a tab-separated csv file, which holds a total of 22 variables, most of which are text cells (not factors), using the read.delim function:

[R] Behaviors of diag() with character vector in R 3.0.0

2013-04-09 Thread Mike Cheung
Dear all, According to CHANGES IN R 3.0.0: o diag() as used to generate a diagonal matrix has been re-written in C for speed and less memory usage. It now forces the result to be numeric in the case diag(x) since it is said to have 'zero off-diagonal entries'. diag(x) does

Re: [R] Tablet and executing R

2013-04-09 Thread Rainer M. Krug
Trying To learn again tryingtolearnag...@gmail.com writes: Hi all, Have any of you instaled R on a Tablet, in this case, which Tablet. My family wants me to gift a Tablet but I suposse R can not be instaled on a Tablet. And my few free time I pass mainly trying to improve in R. Can yoy

Re: [R] fitting a hyperbola to data points

2013-04-09 Thread PIKAL Petr
Hi It seems that some linearisation can be done by with(dat,plot(exp(Requests), log(1/Time))) it can be fitted by fit-lm(log(1/Time)~exp(Requests), data=dat) or library(MASS) fit.r-lqs(log(1/Time)~exp(Requests), data=dat) coef(fit.r) (Intercept) exp(Requests) -7.137549922 -0.002378384

Re: [R] problems with text in plots when using illustrator

2013-04-09 Thread Paul Murrell
Hi What you are seeing may be the effect of kerning. Try pdf(..., useKerning=FALSE) Also, make sure that you actually need to use Illustrator. It is possible that you might be able to do your customisations or refinements in R, which will greatly improve the chances of being able to

Re: [R] Importing from file to graphic window

2013-04-09 Thread S Ellison
Can I import the content of a pdf (or jpg) and put it in the graphic window?. jpeg: not in base R, but you could look at the CRAN jpeg package which says it reads and writes jpegs. PDF: Not in base R. But you can create a PDF with a known filename and then open it in the default PDF

[R] sem: S is numerically singular: expect problems

2013-04-09 Thread Amarnath Bose
Dear Users, I am a new user of the sem package. I have a model that is being flagged by sem as S is numerically singular: expect problems I have checked John Fox's response to a similar problem. Obviously the variance-covariance matrix is singular, but none of the possible reasons seems to hold

[R] USSL diagram

2013-04-09 Thread Amit Ghosh
is there any package available which can be be used to draw us salinity diagram? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] quotes in cat() within function

2013-04-09 Thread Daniel Caro
Hello all, Sorry if this question has been answered in the past, but I could not find an answer. I am trying to print quotes within a cat output. The arguments are: file= Data labels directory= /home/mylaptop/ The function returns: cat(The file, file, is located in directory, directory, sep= )

[R] Remove data 3 standard deviatons from the mean using R?

2013-04-09 Thread Lorna
Hi Everyone, I have a very long list of data-points (+2300) and i know from my histogram that there are outliers which are affecting my mean. I was wondering if anyone on here knows a way i can quickly get R to calculate and remove data which is 3 standard deviations from the mean? I am hoping

Re: [R] cbind for list of zoo objects

2013-04-09 Thread Harry Mamaysky
Thanks for the explanations. Wouldn't the following bit of checking in do.call() make it easier to figure such things out in the future? my.call - function(what,args,...) { ## Get the name of the function to call. if (!is.character(what)) whatStr - deparse(substitute(what))

Re: [R] predict.lm (Michael Haenlein)

2013-04-09 Thread marKo
Michael Haenlein wrote Dear all, I would like to use predict.lm to obtain a set of predicted values based on a regression model I estimated. When I apply predict.lm to two vectors that have the same values, the predicted values will be identical. I know that my

Re: [R] quotes in cat() within function

2013-04-09 Thread Adrian Duşa
Try: directory= \/home/mylaptop/\ Hope this helps, Adrian On Tue, Apr 9, 2013 at 1:06 PM, Daniel Caro dca...@gmail.com wrote: Hello all, Sorry if this question has been answered in the past, but I could not find an answer. I am trying to print quotes within a cat output. The arguments

Re: [R] quotes in cat() within function

2013-04-09 Thread arun
file- \Data labels\  directory=\/home/mylaptop/\  cat(The file, file,is located in directory,directory,sep= ) The file Data labels is located in directory /home/mylaptop/ A.K. - Original Message - From: Daniel Caro dca...@gmail.com To: r-help@r-project.org Cc: Sent: Tuesday, April 9,

Re: [R] cbind for list of zoo objects

2013-04-09 Thread Joshua Ulrich
On Tue, Apr 9, 2013 at 7:31 AM, Harry Mamaysky h.mamay...@gmail.com wrote: Thanks for the explanations. Wouldn't the following bit of checking in do.call() make it easier to figure such things out in the future? Sure, it would have helped you figure out your issue, but you don't want a

Re: [R] USSL diagram

2013-04-09 Thread Ben Tupper
Hi, On Apr 9, 2013, at 6:12 AM, Amit Ghosh wrote: is there any package available which can be be used to draw us salinity diagram? If you have CTD data and are looking to plot temperature-salinity diagrams, then I highly recommend Dan Kelley's oce package. Cheers, Ben Ben Tupper Bigelow

Re: [R] cbind for list of zoo objects

2013-04-09 Thread Harry Mamaysky
That's true. So perhaps there should be a flag that turns on this error checking. Often args is just a list that gets generated automatically and you don't know what all of its elements are. It just leads to a bit of non-deterministic behavior. It would be useful to have the option of flagging

Re: [R] Remove data 3 standard deviatons from the mean using R?

2013-04-09 Thread Berend Hasselman
On 09-04-2013, at 13:12, Lorna lor...@essex.ac.uk wrote: Hi Everyone, I have a very long list of data-points (+2300) and i know from my histogram that there are outliers which are affecting my mean. I was wondering if anyone on here knows a way i can quickly get R to calculate and

Re: [R] sem: S is numerically singular: expect problems

2013-04-09 Thread John Fox
Dear Amarnath Bose, S is the observed-variables covariance or moment matrix and thus doesn't really have to do with the model that you're fitting, nor with the sem software per se; rather, S is computed directly from the data. It's not possible without the data to know why S is numerically

Re: [R] Remove data 3 standard deviatons from the mean using R?

2013-04-09 Thread David Winsemius
On Apr 9, 2013, at 4:12 AM, Lorna wrote: Hi Everyone, I have a very long list of data-points (+2300) and i know from my histogram that there are outliers which are affecting my mean. I was wondering if anyone on here knows a way i can quickly get R to calculate and remove data which is 3

Re: [R] quotes in cat() within function

2013-04-09 Thread Hadley Wickham
On Tue, Apr 9, 2013 at 3:06 AM, Daniel Caro dca...@gmail.com wrote: Hello all, Sorry if this question has been answered in the past, but I could not find an answer. I am trying to print quotes within a cat output. The arguments are: file= Data labels directory= /home/mylaptop/ The

Re: [R] cbind for list of zoo objects

2013-04-09 Thread Gabor Grothendieck
On Tue, Apr 9, 2013 at 9:15 AM, Harry Mamaysky h.mamay...@gmail.com wrote: That's true. So perhaps there should be a flag that turns on this error checking. Often args is just a list that gets generated automatically and you don't know what all of its elements are. It just leads to a bit of

Re: [R] cbind for list of zoo objects

2013-04-09 Thread Harry Mamaysky
That's a nice solution. Thanks. Sent from my iPhone On Apr 9, 2013, at 10:00 AM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Tue, Apr 9, 2013 at 9:15 AM, Harry Mamaysky h.mamay...@gmail.com wrote: That's true. So perhaps there should be a flag that turns on this error checking.

Re: [R] Behaviors of diag() with character vector in R 3.0.0

2013-04-09 Thread arun
Hi, You could try this: v - c(a, b) mat1-diag(length(v))  diag(mat1)- v  mat1 # [,1] [,2] #[1,] a  0 #[2,] 0  b  v1- letters[1:5] mat2- diag(length(v1))  diag(mat2)- v1 mat2 # [,1] [,2] [,3] [,4] [,5] #[1,] a  0  0  0  0 #[2,] 0  b  0  0  0 #[3,] 0  0  c  0  0 #[4,] 0  0  0  d  0

[R] Mistake in German Error message for friedman.test

2013-04-09 Thread Kaisers
There are two misspellings in the german Error message for friedman test: Fehler in friedman.test.default(cont$score, group = cont$goup, blocks = cont$cont) : y, Gruppen und blöcke müssen die sekbe Länge haben The correct spelling would be: Fehler in friedman.test.default(cont$score, group

[R] Boxplot Labels

2013-04-09 Thread Beatriz González Domínguez
#Dear all, #Could anyone help me with the following? #DATA num - as.numeric(seq(100:125)) ave - c(0.5, 1, 1.6, 2, 2, 2.3, 2.5, 2.4, 3, 3.2, 3.3, 4, 4.8, 3.5, 2.7, 3.1, 2.8, 3.5, 4.1, 2.0, 2.5, 2.1, 3.4, 2.5, 2.6, 7) DATA - data.frame(cbind(num, ave)) rm(num, ave) #BOXPLOT x11() bp -

[R] sorting the VAR model output according to variable names??

2013-04-09 Thread londonphd
I was wondering if one can have the coefficients of VAR model sorted according to variable names rather than lags. If you notice below, the output is sorted according to lags. VAR(cbind(fossil,labour),p=2,type=const) VAR Estimation Results: === Estimated coefficients for

[R] Boxplot Labels

2013-04-09 Thread Beatriz González Domínguez
#Dear all, #Could anyone help me with the following? #DATA num - as.numeric(seq(100:125)) ave - c(0.5, 1, 1.6, 2, 2, 2.3, 2.5, 2.4, 3, 3.2, 3.3, 4, 4.8, 3.5, 2.7, 3.1, 2.8, 3.5, 4.1, 2.0, 2.5, 2.1, 3.4, 2.5, 2.6, 7) DATA - data.frame(cbind(num, ave)) rm(num, ave) #BOXPLOT x11() bp -

Re: [R] Boxplot Labels

2013-04-09 Thread Jose Iparraguirre
Estimada Beatriz, If you use the Box.plot function in the car package (notice that here it's Box.plot, not box.plot), and add the argument id.method=c(identify), it should work. You only need one instruction: R library(car) R bp - Boxplot(DATA$ave, data= DATA, main= Average

Re: [R] Boxplot Labels

2013-04-09 Thread John Kane
p - boxplot(dat1$ave, data= dat1, main= Average Size, yaxt = n) text(1.1, , y = max(dat1$ave), label = 26, cex = .7) but I don't understand #I would like the labels that appear in the boxplot to be DATA$num values. You want 26 values potted? John Kane Kingston ON Canada

Re: [R] Mistake in German Error message for friedman.test

2013-04-09 Thread P Ehlers
On 2013-04-09 7:35, kais...@med.uni-duesseldorf.de wrote: There are two misspellings in the german Error message for friedman test: Fehler in friedman.test.default(cont$score, group = cont$goup, blocks = cont$cont) : y, Gruppen und blöcke müssen die sekbe Länge haben The correct

[R] rep() fails at times=0.29*100

2013-04-09 Thread Jorge Fernando Saraiva de Menezes
Dear list, I have found an unusual behavior and would like to check if it is a possible bug, and if updating R would fix it. I am not sure if should post it in this mail list but I don't where is R bug tracker. The only mention I found that might relate to this is If times is a computed quantity

[R] Boxplot Labels OK

2013-04-09 Thread Beatriz González Domínguez
Dear all, I have just sent an enquiry but probably I hadn’t expressed myself properly. Could anyone help me with the following? When I run the code on my data I get a boxplot with outliers identified by numbers 200 201. However, what I would like is to label these outliers with their

Re: [R] rep() fails at times=0.29*100

2013-04-09 Thread Henrik Bengtsson
FYI, (0.29*100) 29 [1] TRUE See R FAQ 7.31 for why. /Henrik On Tue, Apr 9, 2013 at 9:11 AM, Jorge Fernando Saraiva de Menezes jorgefernandosara...@gmail.com wrote: Dear list, I have found an unusual behavior and would like to check if it is a possible bug, and if updating R would fix it.

Re: [R] Boxplot Labels

2013-04-09 Thread Rui Barradas
Hello, The construct data.frame(cbind(...)) is not at all needed, the following is much better. dat1 - data.frame(num, ave) Also, I've modified the text() call a bit, in order to have R tell the dat1$num corresponding to the (unique) max of ave, and with an extra argument, pos. This would

Re: [R] Text Encoding

2013-04-09 Thread Emily Ottensmeyer
Dear Milan and David, Thank you both very much for your help! I finally figured it out. Text on the website was UTF-8, but in the process of downloading it using RDF, it got converted to the java/javascript encoding. To convert it back to UTF-8: test - 4.5\\u00B5g of cDNA was used

Re: [R] Behaviors of diag() with character vector in R 3.0.0

2013-04-09 Thread R. Michael Weylandt
On Tue, Apr 9, 2013 at 7:15 AM, Mike Cheung mikewlche...@gmail.com wrote: Dear all, According to CHANGES IN R 3.0.0: o diag() as used to generate a diagonal matrix has been re-written in C for speed and less memory usage. It now forces the result to be numeric in the case

Re: [R] Boxplot Labels

2013-04-09 Thread David L Carlson
The problem is that identify() is designed for a scatterplot not a boxplot. You can use it but you have to feed it the correct x and y coordinates: identify(rep(1, nrow(DATA)), DATA$ave, cex=.7) This will give you 26 as you requested if you click on the outlying point. That is the row name for

Re: [R] rep() fails at times=0.29*100

2013-04-09 Thread arun
Possibly R FAQ 7.31 length(rep(TRUE,signif(0.29*100,2))) #[1] 29 A.K. - Original Message - From: Jorge Fernando Saraiva de Menezes jorgefernandosara...@gmail.com To: r-help@r-project.org Cc: Sent: Tuesday, April 9, 2013 12:11 PM Subject: [R] rep() fails at times=0.29*100 Dear list, I

Re: [R] rep() fails at times=0.29*100

2013-04-09 Thread Ted Harding
[See at end] On 09-Apr-2013 16:11:18 Jorge Fernando Saraiva de Menezes wrote: Dear list, I have found an unusual behavior and would like to check if it is a possible bug, and if updating R would fix it. I am not sure if should post it in this mail list but I don't where is R bug tracker. The

[R] Confirmatory Factor Analysis

2013-04-09 Thread Laura Thomas
Hi, I have used R to run a confirmatory factor analysis using the sem package. The analysis has run ok, but I am missing some information (e.g., Tucker Lewis Index, RMSEA) I was wondering if there was a reason for this, I have though it may be due to the low sample size? Any help would be

Re: [R] rep() fails at times=0.29*100

2013-04-09 Thread Jorge Fernando Saraiva de Menezes
Thank for your help, and sorry for posting before reading the FAQ, I know it is one of the basic rules. Though, knowing myself I would never relate the error in rep with 0.29*100!=29 2013/4/9 arun smartpink...@yahoo.com Possibly R FAQ 7.31 length(rep(TRUE,signif(0.29*100,2))) #[1] 29 A.K.

[R] sensitivity for grouped data

2013-04-09 Thread Endy BlackEndy
I could not locate any package (using RSeek.org) to compute sensitivity, specificity and related measures, for logistic regression models with grouped data. (For ungrouped data I know one, the SMDTools). Any suggestion will be greatly appreciated. Many thanks Endy [[alternative HTML

Re: [R] Boxplot Labels OK

2013-04-09 Thread Rui Barradas
Hello, The answers you had in another thread could lead you to bp - boxplot(DATA$ave, data= DATA, main= Average Size) idx - which(DATA$ave %in% bp$out) text(x= bp$group, y= bp$out, labels= DATA$num[idx], cex = 0.7, pos = 4) Hope this helps, Rui Barradas Em 09-04-2013 17:31, Beatriz González

[R] R crash

2013-04-09 Thread Tasnuva Tabassum
I have a generalized linear model to solve. I used package geepack. When I use the correlation structure unstructured, I get a messeage that- R GUI front-end has stopped working. Why this happens? What is the solution? The r codes are as follows: a-read.table(d:/bmt.txt,header=T)

Re: [R] Confirmatory Factor Analysis

2013-04-09 Thread John Fox
Dear Laura, In the current version of the Rcmdr package, output of fit indices beyond the LR test, AIC, and BIC is optional, and is controlled by the fit.indices argument to the summary() method (see ?summary.objectiveML) or by the fit.indices option. Everyone seems to have different preferences

Re: [R] Question on Stopword Removal from a Cyrillic (Bulgarian)Text

2013-04-09 Thread Milan Bouchet-Valat
Le mardi 09 avril 2013 à 10:10 +0300, Ventseslav Kozarev, MPP a écrit : Hi, I bumped into a serious issue while trying to analyse some texts in Bulgarian language (with the tm package). I import a tab-separated csv file, which holds a total of 22 variables, most of which are text cells

[R] Simple GLS regression with CAPER

2013-04-09 Thread Xavier Prudent
Dear R experts, I hope this is the right list for my question. As a newcomer in R, I am testing the R CAPER package, applying a simple regression on a phylogeny tree with three binary traits: (t1, t2, t3). My goal is to test the sensitivity to a correlation between t1 and t3. But if a

[R] calculating number of peaks from acf

2013-04-09 Thread Aimee Kopolow
Hi, Is there a way to calculate the number of peaks produced when running acf on time series data? What I'm looking for is a way to calculate the number of peaks that are greater than the confidence limits if the lag is preset and constant. thanks for any help you are able to give, Aimee.

[R] Confirmatory Factor Analysis

2013-04-09 Thread Laura Thomas
Hi, I have used sem package to run confirmatory factor analysis. The analysis has run ok, but I am missing some information (e.g., Tucker Lewis Index, RMSEA) I was wondering if there was a reason for this, I have though it may be due to the low sample size? Any help would be appreciated. Many

[R] How does clusplot exactly make use of cmdscale?

2013-04-09 Thread Junru Wu
Dear people, I used clusplot to plot a partition result. The partition result was from pamk with a distance object as input. Then I applied cmdscale on the same distance object for coordinates to make another scatterplot. My problem is this: the coordinates from the cmdscale calculation, though

Re: [R] R problem and help

2013-04-09 Thread arun
Hi, Try this: source(catalin2.txt) dat2$year- as.numeric(row.names(dat2))  indx-findInterval(dat2$year,seq(1591,1700,by=10))  #based on the last row in the dataset group-seq(1590,1700,by=10) ind-seq(1,length(group),by=1) labl1-paste(group[ind],group[ind+1],sep=-) labl1- labl1[-length(labl1)]

[R] str on large data.frame is slow on factors with many levels

2013-04-09 Thread Sam Steingold
str() takes 2+ minutes to print --8---cut here---start-8--- 'data.frame': 9445743 obs. of 25 variables: $ share.id: Factor w/ 1641168 levels 387059b61ffef5cf,..: 7 118 118 209 242 242 254 254 263 291 ... ... --8---cut

Re: [R] Boxplot Labels OK

2013-04-09 Thread Rui Barradas
Hello, I'm glad it help. You should cc the list, maybe it will be of use to others. Rui Barradas Em 09-04-2013 21:00, Beatriz González Domínguez escreveu: I have solved it, many thanks! -Original Message- From: Rui Barradas Sent: Tuesday, April 09, 2013 7:33 PM To: Beatriz González

[R] Converting matrix to data frame without losing an assigned dimname

2013-04-09 Thread Paul Miller
Hello All, Would like to be able to convert a matrix to a dataframe without losing an assigned dimname. Here is an example that should illustrate what I'm talking about. tableData - state.x77[c(7, 38, 20, 46), c(7, 1, 8)] names(dimnames(tableData)) - c(State, ) tableData State Frost

Re: [R] quotes in cat() within function

2013-04-09 Thread Duncan Murdoch
On 13-04-09 6:06 AM, Daniel Caro wrote: Hello all, Sorry if this question has been answered in the past, but I could not find an answer. I am trying to print quotes within a cat output. The arguments are: file= Data labels directory= /home/mylaptop/ The function returns: cat(The file, file,

Re: [R] Mistake in German Error message for friedman.test

2013-04-09 Thread Duncan Murdoch
On 13-04-09 9:35 AM, kais...@med.uni-duesseldorf.de wrote: There are two misspellings in the german Error message for friedman test: Fehler in friedman.test.default(cont$score, group = cont$goup, blocks = cont$cont) : y, Gruppen und blöcke müssen die sekbe Länge haben The correct

[R] Error when using fitdist function in R

2013-04-09 Thread Paul Bernal
Hello everyone, I was trying to do some distribution fitting with a numerical field called Tolls. The sample size = 999 rows. Basically I assigned the Toll data to a new variable K by doing: k-dtest$Toll After that, tried to fit a gamma distribution by doing: fitG-fitdist(k, gamma) Then the

Re: [R] Error when using fitdist function in R

2013-04-09 Thread Paul Bernal
Hello everyone, I was trying to do some distribution fitting with a numerical field called Tolls. The sample size = 999 rows. Basically I assigned the Toll data to a new variable K by doing: k-dtest$Toll After that, tried to fit a gamma distribution by doing: fitG-fitdist(k, gamma)

Re: [R] Converting matrix to data frame without losing an assigned dimname

2013-04-09 Thread Gabor Grothendieck
On Tue, Apr 9, 2013 at 4:52 PM, Paul Miller pjmiller...@yahoo.com wrote: Hello All, Would like to be able to convert a matrix to a dataframe without losing an assigned dimname. Here is an example that should illustrate what I'm talking about. tableData - state.x77[c(7, 38, 20, 46), c(7,

Re: [R] R crash

2013-04-09 Thread Duncan Murdoch
On 13-04-09 2:41 PM, Tasnuva Tabassum wrote: I have a generalized linear model to solve. I used package geepack. When I use the correlation structure unstructured, I get a messeage that- R GUI front-end has stopped working. Why this happens? What is the solution? Presumably geepack has a bug.

[R] Dengrogram Help (Custom Make)

2013-04-09 Thread gunturus
Hi I am tring to making a dengrogram. I know how to make a normal dengrogram. But I want to know if there is certain option. My dengrogram will be clustered using a value called MatchPrint. But now I want another value called matchscore displayed next to the leaves. The value matchscore next to

Re: [R] Converting matrix to data frame without losing an assigned dimname

2013-04-09 Thread Rolf Turner
Interesting. The problem is that only ***arrays*** are allowed to have a dimnames attribute, and data frames are not arrays (they are lists). The only way that I can see to achieve the effect that you want is to make the row names into the first column of your data frame and wipe out the row

[R] count by value

2013-04-09 Thread catalin roibu
Hello all! I have a big problem now. I want a data frame like this: dput(head(test,100)) structure(c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,

Re: [R] Converting matrix to data frame without losing an assigned dimname

2013-04-09 Thread arun
Hi, library(plyr) library(reshape2)  df2-mutate(dcast(melt(tableData),State~Var2), State=factor(State,levels=rownames(tableData))) dfNew-df2[as.numeric(df2$State),c(1,3:4,2)] dfNew$State- as.character(dfNew$State)  dfNew # State Frost Population  Area #1  Connecticut   139   3100 

Re: [R] Dengrogram Help (Custom Make)

2013-04-09 Thread mlell08
Hi, please give a *small* working example or everyone will have to guess what could be right. see text for drawing text and rect(x1,y1,x2,y2,col,...) for drawing colred rectangles. Regards, Moritz On 09.04.2013 23:34, gunturus wrote: Hi I am tring to making a dengrogram. I know how to make

Re: [R] [R-SIG-Finance] EM algorithm with R manually implemented?

2013-04-09 Thread R. Michael Weylandt
Moved to R-help because there's no obvious financial content. Michael On Sat, Apr 6, 2013 at 10:56 AM, Stat Tistician statisticiangerm...@gmail.com wrote: Hi, I want to implement the EM algorithm manually, with my own loops and so. Afterwards, I want to compare it to the normalmixEM output of

[R] Problem with ode

2013-04-09 Thread Bingzhang Chen
Hi, I am trying to run a 1D nutrient-phytoplankton-zooplankton model in R using the package 'deSolve'. The code is shown below: DEPTH = seq(2.5, 147.5, 5) NPZ = function(t, state, params){ with(as.list(params), { P - state[1:NB] Z - state[(NB + 1): (2*NB)] N - state[(2*NB + 1):

[R] problem with the image command

2013-04-09 Thread cassie jones
Hello R-users, I am trying to do an image plot where I have been given latitudes, longitudes and the values at the corresponding locations. A sample of the data is given as follows: values=c(0,1,0,0,0,0,2,2,0,0)

Re: [R] problem with the image command

2013-04-09 Thread Pascal Oettli
Hi, Did you carefully read the help for image ? ## Default S3 method: image(x, y, z, zlim, xlim, ylim, col = heat.colors(12), add = FALSE, xaxs = i, yaxs = i, xlab, ylab, breaks, oldstyle = FALSE, useRaster, ...) Regards, Pascal On 04/10/2013 10:07 AM, cassie jones wrote: Hello

[R] Plot two separate curves in R Graphics and R Lattice package

2013-04-09 Thread jpm miao
Hi, How can I plot two curves with distinct x and y vectors? I would like to join one of them by regular lines and plot the other just by points (no lines). Can it be done in regular R graphic tools, say plot function? Can it be done in Lattice package, say xyplot function? Thanks, Miao

Re: [R] problem with the image command

2013-04-09 Thread cassie jones
Yes, I did. But I get the following error with the command image(x=long,y=lat,z=values) Error in image.default(x=long,y=lat,z=values): error in evaluating the argument 'x' in selecting a method for function 'image': Error in long: recursive indexing failed at level 2 Thanks, Cassie On Tue,

Re: [R] Plot two separate curves in R Graphics and R Lattice package

2013-04-09 Thread Janesh Devkota
Hi, This should be fairly easy by using base R graphics. Lets suppose your first data is represented by (x1,y1) and second data is represented by (x2,y2) You can use the following command. plot(x1,y1,type=l) points(x2,y2) Hope it helps. On Tue, Apr 9, 2013 at 8:24 PM, jpm miao

Re: [R] problem with the image command

2013-04-09 Thread Pascal Oettli
Hello, In the case: image(x=long,y=lat,z=values)), long is not in (strictly) ascending order, according to the sample you provided: plot(long) Regards, Pascal On 04/10/2013 10:28 AM, cassie jones wrote: Yes, I did. But I get the following error with the command

Re: [R] Behaviors of diag() with character vector in R 3.0.0

2013-04-09 Thread Mike Cheung
Thanks, A.K. I managed to create diagonal matrices for character vectors. Since this new behavior broke a package that I have written, I would like to make sure that this new behavior was not introduced by mistakes. If this new behavior is final, I will modify my code to fit it. Mike On Tue,

Re: [R] Plot two separate curves in R Graphics and R Lattice package

2013-04-09 Thread jpm miao
Thank you very much. Could it be done in Lattice package? Thanks, Miao 2013/4/10 Janesh Devkota janesh.devk...@gmail.com Hi, This should be fairly easy by using base R graphics. Lets suppose your first data is represented by (x1,y1) and second data is represented by (x2,y2) You can

[R] Error while displaying help page of a function existing inside two different loaded libraries

2013-04-09 Thread Pascal Oettli
Dear R users, I recently upgraded R from version 2.15.3 to version 3.0.0 (after removing version 2.15.3 and cleaning installation directory) using the package provided by openSUSE (R-base). I am now running into an issue when two loaded packages share the same name for a function. For

[R] Not enough predicted values from pscl package?

2013-04-09 Thread Noah Silverman
Hi, I'm used the pscl library to fit a zero inflated poisson model. My data has 25,327 rows (no missing values.) zeroinfl(y ~ x) works fine. I get coefficients, etc. Now, I want to see the fitted values and do some comparisons to the truth. So I used: predict(mod, type=count) The

Re: [R] Plot two separate curves in R Graphics and R Lattice package

2013-04-09 Thread David Winsemius
On Apr 9, 2013, at 8:21 PM, jpm miao wrote: Thank you very much. Could it be done in Lattice package? Your example was not presented in a form that lent itself to easy editing. Please learn to use dput to present data structures: xyplot( 4:6 ~ 1:3, panel=function(x,y) {