Re: [R] sub function problem

2014-03-03 Thread PIKAL Petr
Hi I also used Tinn-R but an old version 1.18.5.6 and did not experience such error. Maybe you could try to use plain Notepad for your code just to check if it is Tinn-R issue. I have no idea what the error means. However for anybody to have sensible answer you definitelly need to reveal your

[R] phlyloclim help

2014-03-03 Thread Dana Ikeda
Hello! I'm trying to run a niche.equivalency.test and keep getting the following error: Error in file(fname, "r") : cannot open the connection In addition: Warning message: In file(fname, "r") : cannot open file 'C:/Users/Dana/Desktop/NicheIDresults/out/Populus arizona_proj.asc': No such file or

Re: [R] Extracting slope coefficients for each team

2014-03-03 Thread Pascal Oettli
Hello Amanuel, The help page is made for. Please read it and you will get the answer to your question. Regards, Pascal On Tue, Mar 4, 2014 at 1:33 AM, Amanuel Tekleab wrote: > Dear R-ers, > > I am analyzing longitudinal data using R. My objective is to test a > relationship between a change i

Re: [R] How to set up the plot region

2014-03-03 Thread Jim Lemon
On 03/04/2014 12:40 AM, 张以春 wrote: Dear friends, I have a question don't know how to do. I want to plot two graphs in one column of one plot. Also, I want to make every graph to be a square with width to be 8cm, and their gap is 2cm. How do I set up in par()? Thank you very much. Yichun H

[R] From data frame to time series matrix and plot

2014-03-03 Thread Rich Shepard
I'm missing something simple here so a pointer is needed. The base data is a data frame, col.riv. That was converted to a matrix: col.riv.mat <- data.matrix(col.riv) then to a timeSeries object: col.riv.ts <- ts(col.riv.mat) class(col.riv.ts) [1] "mts""ts" "matrix" I would lik

Re: [R] Reordering Factors

2014-03-03 Thread Bert Gunter
Certainly correct, but see also ?reorder.default Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." H. Gilbert Welch On Mon, Mar 3, 2014 at 9:55 AM, arun wrote: > Hi, >

Re: [R] ggplot2: how to increase size of legend box when converting to pdf

2014-03-03 Thread Ranjan Maitra
On Mon, 3 Mar 2014 16:17:11 -0500 Duncan Murdoch wrote: > On 14-03-03 4:02 PM, Ranjan Maitra wrote: > > Hi, > > > > I have struggled with this quite a bit (all morning and afternoon) and I > > am not sure I am any close to a solution. Basically, here is my sample > > code: > > > > require(grid) >

Re: [R] Three questions about plotting

2014-03-03 Thread Greg Snow
In addition to the great answers already given, you can equalize the vertical part of each plot by having all the plots have the same margins, but creating an outer margin for the common x-axis. do something like: par(mar=c(0,4,0,2), oma=c(4,0,0,0)) then don't change the margins before the last

[R] Error Message when running Linear regression

2014-03-03 Thread sportsguy
Win 7 x64 R x64 8 Gigs RAM Data is 1,000 rows, 40 variables regression is with 3 variables. . . this doesn't appear to be big to me. . . results = lm(Est_Margin ~ Est_Material + Est_Labor + Est_Subcontractor, data=NorthEast) error msg: Warning messages: 1: In model.response(mf, "numeric") :

Re: [R] Error Message when running Linear regression

2014-03-03 Thread sportsguy
Never mind, the excel csv export had commas in the formatting, which caused " " around the values, and R didn't find any regression values. . . . thanks for reading sportsguy -- View this message in context: http://r.789695.n4.nabble.com/Error-Message-when-running-Linear-regression-tp468616

Re: [R] sub function problem

2014-03-03 Thread Massimiliano Tripoli
Hi Petr, thanks for your response. You're right. I counted incorrectly the numbers of spaces at the beginning of the sub function directly called as you can see at the end. If the string has a length more than 10 it works correctly returning the same string of input except if there are some space

[R] Extracting slope coefficients for each team

2014-03-03 Thread Amanuel Tekleab
Dear R-ers, I am analyzing longitudinal data using R. My objective is to test a relationship between a change in a variable (say X) and a change in another variable (say y). I have collected data at three time periods on both variables. I was able to run whether there was slope variability amon

Re: [R] Reordering Factors

2014-03-03 Thread arun
Hi, Check if the condition is similar to below: set.seed(28) vec1 <- factor(sample(LETTERS[1:5],20,replace=TRUE),levels=c("B","C","D","A")) levels(vec1) #[1] "B" "C" "D" "A" summary(vec1) #   B    C    D    A NA's #   2    4    5    4    5 A.K.   Hi, I am trying to reorder a set of footba

Re: [R] new column that applies function to all rows based on last row

2014-03-03 Thread arun
HI BNC, For the example you provided: CHAR1n_totalNew <- within(CHAR1n_total,Newvar <- (Freq/tail(Freq,1))*100) #If you have more than one column #For example set.seed(42)  Freq2 <- sample(4,10,replace=TRUE)  CHAR1n_total$Freq2 <- c(Freq2,sum(Freq2))  dat2 <- as.data.frame(matrix(NA,ncol=((ncol

[R] new column that applies function to all rows based on last row

2014-03-03 Thread bcrombie
I know this is a simple question, but I am having trouble generating output without errors. I want to create a column containing values for each row that are generated by dividing another column's row value by the same column's sum (last-row value):

[R] Circular density estimate to a raster for mapping in GIS - help

2014-03-03 Thread Raphaël Lavoie
Hi all, I created a circular density estimate using package "circular" from bearings (directions) from 0 to 360° assuming a von Mises distribution. # library(circular) Bearing<- c(186,197,158,206,206,185,186,224,183,173,175,240,201,197, 175,173,226,227,233,193,175,217,171,193,190,186,

Re: [R] include sql statements

2014-03-03 Thread Streng Ge-heim
Thanks a lot. The hint with readLines worked :) Then I got it to work like this: sql <- paste(readLines(con = "stmnt.sql"), collapse = " ") result <- sqlQuery(db,sql) Michel 2014-03-02 17:52 GMT+01:00 Gabor Grothendieck : > On Fri, Feb 28, 2014 at 5:16 AM, Streng Ge-heim > wrote: > > Hi, > >

[R] Weighted pairwise LDA

2014-03-03 Thread ben1983
Hello All, I am doing LDA, trying to build a model to identify type of bacteria. Unfortunately the training group sizes are very smalln=4 for each groupof which there are 10. I have noticed that LDA is highly influenced by outlying groups and 'pulls' the LDs towards them (as yo

[R] dependence of a variable from the others

2014-03-03 Thread pepe
I would like to study how one variable depends on others. i tried with techniques liko glm and with this code: mod=lm(Variable ~.,data=...) step(mod) but i have some problems when i try with no-numerical variables. in particular i have this table

Re: [R] ggplot2: how to increase size of legend box when converting to pdf

2014-03-03 Thread Duncan Murdoch
On 14-03-03 4:02 PM, Ranjan Maitra wrote: Hi, I have struggled with this quite a bit (all morning and afternoon) and I am not sure I am any close to a solution. Basically, here is my sample code: require(grid) require(ggplot2) X <- data.frame(x = c(rnorm(10), rnorm(10, mean = 2, sd = 2), rnorm

[R] ggplot2: how to increase size of legend box when converting to pdf

2014-03-03 Thread Ranjan Maitra
Hi, I have struggled with this quite a bit (all morning and afternoon) and I am not sure I am any close to a solution. Basically, here is my sample code: require(grid) require(ggplot2) X <- data.frame(x = c(rnorm(10), rnorm(10, mean = 2, sd = 2), rnorm(10, mean =5)), group = c(rep("Ellipse", 10)

[R] "Error: attempt to apply non function" and reference classes

2014-03-03 Thread Dave Mitchell
Hello, Currently I'm using a reference class in my script to manage data exporting. Sometimes, when I run my script things will be progressing as expected when (seemingly mysteriously) every method in the object will return "Error: attempt to apply non-function". Attempting to recreate the object

Re: [R] include sql statements

2014-03-03 Thread MacQueen, Don
One way would be sql <- scan('stmt.sql', what='') Then sql <- paste(sql, collapse=' ') or sql <- paste(sql, collapse='\n') After which you can check with cat(sql, '\n') I do this sort of thing when I want to maintain an SQL template in an external file, then modify it in R before using o

Re: [R] gamm design matrices

2014-03-03 Thread Jarrod Hadfield
Hi Simon, Sorry, I spoke too soon. I now have the basic spline code working but with `by' variables I get an error in smoothCon: Error in ExtractData(object, data, knots) : 'names' attribute [1] must be the same length as the vector [0] and a segfault with smooth.construct (see example co

Re: [R] gamm design matrices

2014-03-03 Thread Jarrod Hadfield
Hi Simon, That's perfect - the matrices now agree. Thanks, Jarrod Quoting Simon Wood on Mon, 03 Mar 2014 13:35:04 +: Dear Jarrod, I've only managed to have a very quick look at this, but I wonder if the difference is to do with identifiability constraints? It looks to me as if your

[R] Replacing a plotting function in a package with a ggplot2 version

2014-03-03 Thread Tom Hopper
I’ve been working on a home-brewed version of the plot function in the package qcc that would be more compatible with grid graphics. I’d like to share this with the R community, in the hopes that this reference helps some of my fellow learners. The issues that I overcame were all documented else

Re: [R] Recognizing patterns in time series data

2014-03-03 Thread PIKAL Petr
Hi I am not able to see the picture but from what you write maybe you can consult ?strucchange or ?segmented packages Regards Petr > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of James Courtier-Dutton > Sent: Friday, Februa

Re: [R] installing package 'rqpd' (Regression quantiles for panel data)

2014-03-03 Thread fe_jasa
Dear Manish I have installed from the file I send you. Doing directly from CRAN doesn't result. After installation you can see the help (help(rqpd). Sincerely PS: it works on last version of R in Linux (ubtuntu) -- ><><><><><><><><><><><><><><> João Sousa Andrade jasa04011...@gmail.com ><><><>

[R] How to set up the plot region

2014-03-03 Thread 张以春
Dear friends, I have a question don't know how to do. I want to plot two graphs in one column of one plot. Also, I want to make every graph to be a square with width to be 8cm, and their gap is 2cm. How do I set up in par()? Thank you very much. Yichun [[alternative HTML versi

Re: [R] gamm design matrices

2014-03-03 Thread Simon Wood
Dear Jarrod, I've only managed to have a very quick look at this, but I wonder if the difference is to do with identifiability constraints? It looks to me as if your smooth.construct call does not have sum to zero constraints applied to the smooth, but by default 'gamm' will impose these (even

Re: [R] Data Rearrangement

2014-03-03 Thread PIKAL Petr
No. As Arun pointed OP wants melt but with some result polishing. Petr > -Original Message- > From: JiHO [mailto:jo.li...@gmail.com] > Sent: Friday, February 28, 2014 6:04 PM > To: PIKAL Petr > Cc: dila radi; r-help@r-project.org > Subject: Re: [R] Data Rearrangement > > You actually wan

Re: [R] Difficulty with what is probably a basic function to retrieve data from a data frame.

2014-03-03 Thread Ivan Calandra
Hi, First, if you want a precise answer, provide a precise question. That is, provide a reproducible example. A good function for that is dput(), with which you can copy/paste your own data. If your data is too long, create a relevant subset (with head() for example). Regarding your question

Re: [R] sub function problem

2014-03-03 Thread PIKAL Petr
Hi Everything works for me as expected. Nothing happens R starts as usual. You can shorten your function corregge2 <- function(stringa){ nc <- nchar(stringa) stringa <- sub("^ ", "", stringa) stringa <- sub(" +$", "", stringa) if (nc <9) stringa <- NA if (nc == 9) stringa <- paste("0",

[R] Help with Sequences.ind.0, package Biograph

2014-03-03 Thread Annalisa Stacchini
Dear R users,I do not know if I'm right using the function Sequences.ind.0() of the package Biograph:I run the following code (data in csv attached, they are a sub-sample of a bigger sample): PICCOLO<-read.csv("PICCOLO.csv")TRANSpiccolo<-data.frame(as.Date(PICCOLO$S, origin= PICCOLO$S, format("%

[R] Help with Sequences.ind.0, package Biograph

2014-03-03 Thread Annalisa Stacchini
Dear R users,I do not know if I'm right using the function Sequences.ind.0() of the package Biograph:I run the following code (data in csv attached, they are a sub-sample of a bigger sample): PICCOLO<-read.csv("PICCOLO.csv")TRANSpiccolo<-data.frame(as.Date(PICCOLO$S, origin= PICCOLO$S, format(

Re: [R] Multilevel analysis for ordinal responses

2014-03-03 Thread shkingdom
I forgot to add. How can I estimate cluster-robust standard errors and 95% confidence intervals for odds ratios? Thank you, Wander -- View this message in context: http://r.789695.n4.nabble.com/Multilevel-analysis-for-ordinal-responses-tp4686057p4686127.html Sent from the R help mailing list a

Re: [R] Pattern Matching

2014-03-03 Thread arun
Hi, You could try: as.numeric(gsub(".*[(]([0-9]+)[)]","\\1",aa)) #[1] 472 445 431 431 415 405   1 #or library(gsubfn)  strapply(aa,"[(]([0-9]+)[)]",as.numeric,simplify=TRUE) #[1] 472 445 431 431 415 405   1 A.K. On Sunday, March 2, 2014 2:57 PM, "Doran, Harold" wrote: Suppose I have a chara

Re: [R] Multilevel analysis for ordinal responses

2014-03-03 Thread shkingdom
Thanks for your prompt responses. I will look at the readings you sugggest. One quick question, sampling weights can be applied in clmm2? Thank you, Wander -- View this message in context: http://r.789695.n4.nabble.com/Multilevel-analysis-for-ordinal-responses-tp4686057p4686125.html Sent from

[R] Difficulty with what is probably a basic function to retrieve data from a data frame.

2014-03-03 Thread KarlSmithByrne
I have a large genotype dataset. Each person can take the value Hom or Het (Homozygous or Heterozygous variant), for example. There is also a column variable that tells me if each "Hom" is also damaging or activating, for example. I am trying to write a function that will tell me how many "Hom" a

Re: [R] Time Series Data Analysis

2014-03-03 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Kapil Shukla > Sent: Saturday, March 01, 2014 6:23 PM > To: r-help@r-project.org > Subject: [R] Time Series Data Analysis > > Hi All > > I am totally new to R so this question

[R] rpostgresql - write table to specific tablespace?

2014-03-03 Thread julian.bothe
Hello everybody, is there a possibility to write a data.frame as a table to a postgresql-database on a specific table_space? As I see it, the normal dbWriteTable() function does not provide this functionality. Can I do it using a form of dbSendQuery? Lamentably, I did not find any infor