[R] How to convert month-day-year to Julian data number?

2012-06-14 Thread Paloma Moya
Hello, I am trying to convert calendar dates (Month, Day, Year) into Julian Days   Product code Bureau of Meteorology station number Month Day Year Date_mdy Date 4102001 70014 1 1 1939 1/01/1939 1/01/1939 4102001 70014 1 2 1939 1/02/1939 2/01/1939 4102001 70014 1 3 1939 1/03/1939 3/01/1939 410

[R] spelling correction using R

2012-06-14 Thread raishilpa
hello I want a code which can correct the spelling mistakes as well as grammatical mistakes in the sentences...that is if I am writing following sentence: I want too meet my frnd bt due to hectic shcedule I cant I want output in following way: I want to met my friend but due to hectic schedule

Re: [R] Tukey Kramer with ANOVA (glm)

2012-06-14 Thread David Winsemius
On Jun 14, 2012, at 2:17 PM, Alaska_Man wrote: Dr. Winsemius, Really quick, a BACI is a Before-After-Control-Impact approach. I have a long time series of sea cucumber density estimates, which are taken at the same location(s) through time. Some are in areas Impacted by sea otters and

[R] Syntax for nls optimization function

2012-06-14 Thread HC
I am working on minimization of sum of squared errors for a problem that has 2 box-constrained parameters. I got the solution for this problem using "L-BFGS-B" method in optim function using an R code as res<-optim(par=c(parInit), fn=myFunction, method = c("L-BFGS-B"), lower = parMin, upper = par

[R] decomposing decompose(), issue?

2012-06-14 Thread Peter L
Hi I'm just stepping through the decompose() function, in "stats". Does this contained line of code not work if you have a time series ending "unevenly" (i.e., middle of the year), or am I missing something? season <- na.omit(c(as.numeric(window(season, start(x) + c(1, 0), end(x))), as.numer

[R] POSIXlt and trunc

2012-06-14 Thread James Long
Hi, I'm having trouble understanding how trunc is operating on vectors of POSIXlt objects. Why does dates[1:4] in the last line return a bunch of NAs even though dates look like it has all the right elements? This worries me that something is off with my use of trunc. Is trunc not suppose to be ve

[R] Customizing a Plot in Correspondence Analysis

2012-06-14 Thread Salvador Ramirez
Hello, Using the Correspondence Analysis package (ca), I wonder if there is a way to further customize the plot beyond the options given in plot.ca provided by the mentioned package. The correspondence analysis I am doing consists of two datasets sharing only the rows, so the plot draw the total

Re: [R] gWidgets - gtable returning multiple values

2012-06-14 Thread michaelyb
To whoever is looking for the same thing as I was, I found a solution, or sort of. Here is the code: flavors<-c("vanilla", "chocolate", "strawberry") w <- gwindow("checkbox example") gp <- ggroup(container=w) glabel("Favorite flavors:",cont=gp) cbg <- gtable(flavors, cont=gp, multiple=T) #

[R] Using Sub

2012-06-14 Thread Lopez, Dan
Hi, I have been trying to get the sub function to work but can't for the life of me figure it out. I tried looking at ?sub but I think there is something that I am just not understanding. Example failed attempts > sub("\\","/","G:\Compensation Audits_Reports\Step Audit\Steps off Step.accdb") E

Re: [R] Cholesky decomposition error

2012-06-14 Thread nataraj
Thanks for your reply. To my surprise I can find one more strange behavior of my 15X15 matrix "A", that is if I call the function chol(A) in the terminal it decompose the matrix fine without any errors or warnings. But if I call the function chol() within a function, which I have written in o

Re: [R] Divide all rows of a data frame by the first row.

2012-06-14 Thread Jeff Newmiller
a) Avoid mixing Date objects and POSIXt objects. The timezones will mess you up in the conversions. Just eliminate the as.Date conversion entirely. b) By the time you reach the do.call function call, amortsByYears is a matrix. While a data.frame is a special kind of list, a matrix is not. Hence,

[R] Divide all rows of a data frame by the first row.

2012-06-14 Thread Keith Weintraub
Folks, I call the function calcAmorts like so: calcAmorts(prevAm, amort, myDates) Note that I use the package lubridate. The last line where do.call is called to first divide all the rows by the first row and then rbind gives the following error: Error in do.call("rbind", apply(amor

[R] (no subject)

2012-06-14 Thread Michael Sumner
-- Michael Sumner Hobart, Australia e-mail: mdsum...@gmail.com [[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 http://www.R-project.org/post

Re: [R] Transform date - style

2012-06-14 Thread arun
Hi, Try this: date1<-"X01.11.2010" date2<-strftime(strptime(date1,"X%d.%m.%Y"),"%d.%b.%y")  date2 [1] "01.Nov.10" A.K. - Original Message - From: juliane0212 To: r-help@r-project.org Cc: Sent: Thursday, June 14, 2012 10:09 AM Subject: [R] Transform date - style Hello, is there any

Re: [R] need help

2012-06-14 Thread Rui Barradas
Hello arun, Thinking about it, I believe this one is reasonably solid. I've added a 'txt0' just in case it wouldn't like shorter. txt0 <- "my name name is micky" txt1 <- "my name name name is micky" txt2 <- "my name name name name is micky" pat <- "(\\w+\\s)\\1+" gsub(pat, "\\1", txt0) gsub(p

Re: [R] Tukey Kramer with ANOVA (glm)

2012-06-14 Thread Alaska_Man
Dr. Winsemius, Really quick, a BACI is a Before-After-Control-Impact approach. I have a long time series of sea cucumber density estimates, which are taken at the same location(s) through time. Some are in areas Impacted by sea otters and some are in areas Not Impacted by sea otters (two leve

[R] Animation problem

2012-06-14 Thread Tlellami
Using the animation package, I am trying to show fish movement over a jpeg of our study area. I want to show fish detection at each of 5 sites on each day they are detected. Each of the five fish species will have their own color (not coded yet). I am able to create the animation, though the data i

[R] Query about TSRV

2012-06-14 Thread Shivam
Hi All, This question may not belong here, but I asked this on the R-SIG-FINANCE list and so far have not got any reply, so was hoping someone here may help. I have a basic query about TSRV and was hoping you all can shed some light on the issue. I have 22500 records for each day. So if I take t

Re: [R] Median line with stripchart

2012-06-14 Thread Luigi
Thank you! This works much better. Best regards, Luigi -Original Message- From: David L Carlson [mailto:dcarl...@tamu.edu] Sent: 14 June 2012 16:44 To: 'Luigi' Cc: r-help@r-project.org Subject: RE: [R] Median line with stripchart This automates things a bit once we re-organize your data

[R] Rootogram for flexmix function

2012-06-14 Thread arunkumar1111
Hi I use the flexmix function for clustering. when i give the command plot(flexmixobjext) , it gives the rootogram plot can anyone help me to understand the plot - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/Rootogram-for-flexmix-function-t

Re: [R] cointegration, changing time span, incorrect results

2012-06-14 Thread phillen
problem solved. if one adjusts in r the time span the way i did it, r really only has data available for this time span. to the opposite in eviews. if one sets in eviews a time span via adjusting the sample size, it still uses the observations outside the sample size i.e. in cointegrationn tests wh

[R] cointegration, changing time span, incorrect results

2012-06-14 Thread phillen
I just tried to figure out why R does not calculate the same johansen test statistics as eviews does: I imported data: sy=read.csv("sy.csv",sep=";",header=TRUE) si=read.csv("si.csv",sep=";",header=TRUE) merged them. swe=merge.zoo(si,sy) when i test swe for cointegration with the johansen test, i

Re: [R] Time difference between two dates/timing

2012-06-14 Thread arun
Hi, If you need the difference between two dates from the dataset, Try this:  >dat1<-data.frame(DATETIME=c("1/1/2010 0:10","1/1/2010 0:20","1/1/2010 0:30"),HEADER1=c(197.19,203.88,206.56),HEADER2=c(100.08,100.10,100.04))  >dat1$DATETIME<-strptime(dat1$DATETIME, "%d/%m/%Y %H:%M")  >difftime(dat

Re: [R] matrix manipulation

2012-06-14 Thread Petr Savicky
On Thu, Jun 14, 2012 at 02:24:20PM -0400, cowboy wrote: > thank you, Petr. > This is exactly what I'm looking for in my post. > An related question can be how to get an arbitrary weight, say if row1 > and row 2 have 1 common value 1, then assign a weight 10, if row 1 and > row 2 have 2 common value

Re: [R] readHTMLTable function - unable to find an inherited method ~ for signature "NULL"

2012-06-14 Thread Duncan Temple Lang
The second page (mmo-champion.com) doesn't contain a node. To scrape the data from the page, you will have to explore its HTML structure. D. On 6/14/12 9:31 AM, Moon Eunyoung wrote: > Hi R experts, > > I have been playing with library(XML) recently and found out that > readHTMLTable workls

Re: [R] matrix manipulation

2012-06-14 Thread cowboy
thank you, Petr. This is exactly what I'm looking for in my post. An related question can be how to get an arbitrary weight, say if row1 and row 2 have 1 common value 1, then assign a weight 10, if row 1 and row 2 have 2 common value 1, then assign a weight 12. I'm not so sure how to expand your me

Re: [R] Can someone recommend a package for SNP cluster analysis of Fluidigm microarrays?

2012-06-14 Thread R. Michael Weylandt
I do think this is more of a Bioconductor question -- but no worries, they're all much nicer there than we are here and won't flame you if you double post :-) Best, Michael On Thu, Jun 14, 2012 at 12:37 PM, Hans Thompson wrote: > I know that there are quite a few packages out that there for clus

Re: [R] how to export output

2012-06-14 Thread raishilpa
thanks a alot !!! I got it :) On Thu, Jun 14, 2012 at 8:07 PM, Rui Barradas [via R] < ml-node+s789695n463338...@n4.nabble.com> wrote: > Hello, > > Try > > sink("sentiment.txt") > classify_polarity(...etc...) > sink() > > > If this doesn't do it see > > ?capture.output > > Hope this helps, > > Rui

Re: [R] save to Rdata file and to txt

2012-06-14 Thread Mark Sharp
Though not exactly what you asked for, I find the output of dput() to be useful dput(moransl, file = "moransl.txt") results in list("Moran.I.First", structure(list(observed = 0.06988288, expected = -0.03225806, sd = 0.02513276, p.value = 4.822722e-05), .Names = c("observed", "expected", "s

Re: [R] question about creating data frame

2012-06-14 Thread Mark Sharp
Below are two equivalent solutions. study_df <- data.frame(course = c(rep('Mathematics', 80 + 15), rep('Physics', 32 + 24), rep('Biology', 18 + 29)), A = c(rep(1, 80), rep(0, 15),

Re: [R] need help

2012-06-14 Thread arun
Hi Carlos, Thanks for your suggestions.  I saw Rui's reply about the same problem using rle.  It looks very solid.  I was trying replicate the same thing with "gsub", but it was not working in that way. For example,  txt1<-"my name name name is micky"  gsub("\\b(\\w+)\\b(\\s+)\\1\\2","",txt

Re: [R] Process XML files

2012-06-14 Thread Santosh
Dear Rxperts, I am back to favoRite! I would need your favoR, please! Is there a way to use read "format" arguments for "POSIXct" or "strptime" from the xml file without specifying format="..." in these functions? The format of data-time values are present in the xml file as shown below. Please

Re: [R] read.table and variable length of tables

2012-06-14 Thread Halldór Björnsson
Thanks and with datlines <- as.data.frame(inp[( grep("", inp)[1]+5 ):(grep("", inp)[1]-1)]); I get the data as needed. Thanks again H. - Original Message - On Jun 14, 2012, at 10:23 AM, Halldór Björnsson wrote: > Hi, > > I am trying to read in weather balloon data, where each file

Re: [R] separate the sentence after finding a particular word

2012-06-14 Thread raishilpa
thanks for reply..I got it...:) On Thu, Jun 14, 2012 at 8:41 PM, Rui Barradas [via R] < ml-node+s789695n4633393...@n4.nabble.com> wrote: > Hello, > > I don't understand, do you want to output: > > 1st line: the original input line > 2nd line: " I want output in following format " <-- this line >

Re: [R] read.table and variable length of tables

2012-06-14 Thread Halldór Björnsson
Thanks, even better - Original Message - On Jun 14, 2012, at 12:18 PM, Halldór Björnsson wrote: > Thanks and with > > datlines <- as.data.frame(inp[( grep("", inp)[1]+5 ):(grep(" PRE>", inp)[1]-1)]); > I suggest this instead. > read.fwf(textConnection(datlines), widths=rep(7,11)) V1

Re: [R] gsub

2012-06-14 Thread arun
Hi, Try this: sub("(I)\\((.*?)\\)","\\2",t1) [1] "(Ithis) test" A.K. - Original Message - From: nalluri pratap To: r-help@r-project.org Cc: Sent: Thursday, June 14, 2012 7:03 AM Subject: [R] gsub Hi,   I have a string t1="(Ithis) I(test)". I need to get t2="(Ithis) test".   Can som

[R] readHTMLTable function - unable to find an inherited method ~ for signature "NULL"

2012-06-14 Thread Moon Eunyoung
Hi R experts, I have been playing with library(XML) recently and found out that readHTMLTable workls flawlessly for some website, but it does give me an error like below ... Error in function (classes, fdef, mtable) : unable to find an inherited method for function "readHTMLTable", for signat

[R] Can someone recommend a package for SNP cluster analysis of Fluidigm microarrays?

2012-06-14 Thread Hans Thompson
I know that there are quite a few packages out that there for cluster analysis. The problem that I am facing is finding a package that will not incorporate all my samples into clusters but just the samples that fit a threshold (that I have not set yet and may need help finding the right level) for

Re: [R] Trouble with .bat files upon installation of 15.0

2012-06-14 Thread Uwe Ligges
On 14.06.2012 01:48, Sarah Henderson wrote: Hello to all -- I'm hoping that someone more knowledgeable than me can shed some light on a problem I have been having. In point form: - I am running XP on a 64-bit processor - I run 5 automated R tasks every morning using .bat files and a little ut

Re: [R] matrix manipulation

2012-06-14 Thread Petr Savicky
On Thu, Jun 14, 2012 at 01:11:45PM +, G. Dai wrote: > Dear Rlisters, > I'm writing to ask how to manipulate a matrix or dataframe in a specific way. > > To elaborate, let's consider an example. Assume we have the following > 3 by 4 matrix A with elements either 0 or 1, > 0 1 1 0 > 1 0 1

Re: [R] read.table and variable length of tables

2012-06-14 Thread David Winsemius
On Jun 14, 2012, at 12:18 PM, Halldór Björnsson wrote: Thanks and with datlines <- as.data.frame(inp[( grep("", inp)[1]+5 ):(grep("PRE>", inp)[1]-1)]); Er, ... are you sure? I got a factorized mess when I did that. > str(datlines) 'data.frame': 98 obs. of 1 variable: $ inp[(grep("", i

Re: [R] Tukey Kramer with ANOVA (glm)

2012-06-14 Thread David Winsemius
On Jun 13, 2012, at 7:36 PM, Alaska_Man wrote: Hello, I am performing a BACI analysis with ANOVA using the following glm: I admit I had no idea what a "BACI analysis" might be. Looking it up it appears to be a cross-over design and my statistical betters have sternly warned me about this

Re: [R] Time difference between two dates/timing

2012-06-14 Thread John Kane
First thing is to supply data in a usable form See ?dput for one easy way of doing it. In any case, assuming those dates and times are character values something like this should work but not tested on your data. Assuming the data frame is called dtime dtime[,1] <- strptime(dtime[,1], "%d/%

Re: [R] Decision Trees or Markov Models for Cost Effectiveness

2012-06-14 Thread stefan.d...@gmail.com
Hi Noah, I did ask basically the same question about a year ago and there wasn't anything around (http://tolstoy.newcastle.edu.au/R/e14/help/11/06/3651.html) Although I agree that R would be very suitable for this kind of calculations exist. I guess one reason is that a decision tree is not really

Re: [R] Storing datasets

2012-06-14 Thread MacQueen, Don
And I'd like to add, just for the purpose of learning about R ... even if wishes to use the loop version, there appears to be a misunderstanding of R syntax. The expression 1:225*100 does not produce 22500 numbers to put into the matrix, as apparently expected. Compare: > 1:3*5 [1] 5 10

Re: [R] Question about sampling

2012-06-14 Thread Guido Leoni
Just for make the archives more complete and simplifing the life of the following readers. I think to have solved my problem using the caret packages. In this package there is a function named createData Partition that after defining a column of interest in a data.frame allows to split a dataset in

Re: [R] R matrix help

2012-06-14 Thread Jeff Newmiller
What makes you think that with 12 elements the dimensions should be 3x4? It seems that 4x3 would be equally valid. In every use of matrices that I have encountered, the dimensions have been relatable to some known quantity from the problem context, and matrix dimensioning has been an exercise i

Re: [R] R matrix help

2012-06-14 Thread Sarah Goslee
Can you explain why n=12 should result in 3x4 instead of 2x6 or 6x2 or 4x3 or 1x12 ? On Thu, Jun 14, 2012 at 8:51 AM, karthicklakshman wrote: > Dear R experts, > > I am interested in getting the dimensions for the matrix dynamically, based > on the the number of elements in a matrix for example.

Re: [R] Time difference between two dates/timing

2012-06-14 Thread R. Michael Weylandt
You have been asked before (by me!) to give reproducible examples using dput()... You might need the diff() function. Michael On Thu, Jun 14, 2012 at 5:08 AM, Rantony wrote: > Hi, > > > Here, i have a matrix like this > > MyMatrix <- > > *DATETIME        HEADER1            HEADER2* > 1/1/2010 0

Re: [R] read.table and variable length of tables

2012-06-14 Thread David Winsemius
On Jun 14, 2012, at 12:18 PM, Halldór Björnsson wrote: Thanks and with datlines <- as.data.frame(inp[( grep("", inp)[1]+5 ):(grep("PRE>", inp)[1]-1)]); I suggest this instead. > read.fwf(textConnection(datlines), widths=rep(7,11)) V1V2V3V4 V5 V6 V7 V8V9 V10

Re: [R] R matrix help

2012-06-14 Thread David L Carlson
If the number of elements is 12, the dimensions could be 1x12, 12x1, 2x6, 6x2, 3x4, or 4x3. How did you decide on 3x4? -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message-

Re: [R] R matrix help

2012-06-14 Thread Kehl Dániel
If you have your data in x, you can try something like matrix(x,length(x)/4,4) hth kd 2012.06.14. 14:51 keltezéssel, karthicklakshman írta: Dear R experts, I am interested in getting the dimensions for the matrix dynamically, based on the the number of elements in a matrix for example. if th

Re: [R] R matrix help

2012-06-14 Thread John Kane
Why would those figues (dim= 3X4, dim=5X4) be the dimensions? Could not they equally be 4X3 an 4X5 or am I completely misunderstanding the question? John Kane Kingston ON Canada > -Original Message- > From: karthick.laksh...@gmail.com > Sent: Thu, 14 Jun 2012 05:51:24 -0700 (PDT) > To:

Re: [R] read.table and variable length of tables

2012-06-14 Thread David Winsemius
On Jun 14, 2012, at 10:23 AM, Halldór Björnsson wrote: Hi, I am trying to read in weather balloon data, where each file has a header of fixed length and a trailing section of a fixed length. The data section (the table) is of variable length. An example of the data is on: http://weather

Re: [R] Median line with stripchart

2012-06-14 Thread David L Carlson
This automates things a bit once we re-organize your data. my.newdata <- stack(data.frame(my.data), select=c(Control, Case)) stripchart(values~ind, my.newdata, method = "stack", offset=1/3, vertical = TRUE, pch=19) medians <- tapply(my.newdata$values, my.newdata$ind, median) points(c(1, 2), me

Re: [R] R matrix help

2012-06-14 Thread Sarah Goslee
But the meaning of a 3x4 table is rather different than the meaning of a 1x12 table. Regardless, you probably want to start with integer factorization, and can read more about implementations in R here (and elsewhere): http://tolstoy.newcastle.edu.au/R/help/05/01/10007.html Sarah On Thu, Jun 14,

Re: [R] density plot on a log scale

2012-06-14 Thread John Kane
Would something like ggplot's transparacy option help? Example bascially from http://had.co.nz/ggplot2/geom_point.html # Plot large data set. d <- ggplot(diamonds, aes(carat, price)) + geom_point() d # plot large data set with transparancy set to 1/10 th p = ggplot(diamonds, aes(carat, price))

Re: [R] Question about sampling

2012-06-14 Thread R. Michael Weylandt
I think you're right -- prob probably isn't quite what you need (at least, directly): constrained sampling like this is a little trickier -- I'll leave this to someone who knows more than me. Michael On Thu, Jun 14, 2012 at 9:07 AM, Guido Leoni wrote: > Sorry I'm not sure that prob is suitable f

Re: [R] R matrix help

2012-06-14 Thread R. Michael Weylandt
But there are multiple shapes for matrices with 12 elements -- how did you get 3x4 ? You also could have had 1x12, 2x6, 3x4, 4x3, 6x2,12x1 If you have an R object, you can use dim() on it. [Or perhaps slightly more robustly, NCOL() and NROW()] Michael On Thu, Jun 14, 2012 at 7:51 AM, karthicklak

Re: [R] plot cdf

2012-06-14 Thread David L Carlson
Try this. It will turn off plotting the points, with 186 values, the points are covering up the line. x <- runif(186)*10 plot(ecdf(x), do.points=FALSE) ?plot.ecdf # to get help on the plot method used to plot ecdf ?plot.stepfun # to get help on the plot method used to plot stepfun

[R] matrix manipulation

2012-06-14 Thread G. Dai
Dear Rlisters, I'm writing to ask how to manipulate a matrix or dataframe in a specific way. To elaborate, let's consider an example. Assume we have the following 3 by 4 matrix A with elements either 0 or 1, 0 1 1 0 1 0 1 1 0 0 0 1 >From the original matrix A, I'd like to generate a new

Re: [R] Cholesky decomposition error

2012-06-14 Thread Rui Barradas
Hello, Hello, If the input matrix is symmetric, positive definite then the Cholesky decomposition algorithm is stable. That's why it is so used in statistics, where many times the matrices meet those conditions. Therefore, the matrix isn't symmetric, positive definite to begin with. Rui Barr

Re: [R] Median line with stripchart

2012-06-14 Thread S Ellison
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Luigi > Sent: 14 June 2012 00:44 > To: dcarl...@tamu.edu > Cc: r-help@r-project.org > Subject: Re: [R] Median line with stripchart > > Sorry for the inconvenience, > I have ad

Re: [R] separate the sentence after finding a particular word

2012-06-14 Thread Rui Barradas
Hello, I don't understand, do you want to output: 1st line: the original input line 2nd line: " I want output in following format " <-- this line 3rd line and following: the input line broken by the patterns Then just f <- function(x, pattern) unlist(strsplit(x, pattern)) x <- "I love to wa

[R] read.table and variable length of tables

2012-06-14 Thread Halldór Björnsson
Hi, I am trying to read in weather balloon data, where each file has a header of fixed length and a trailing section of a fixed length. The data section (the table) is of variable length. An example of the data is on: http://weather.uwyo.edu/cgi-bin/sounding?region=naconf&TYPE=TEXT%3ALIST&YEAR

Re: [R] Question about sampling

2012-06-14 Thread Guido Leoni
Sorry I'm not sure that prob is suitable for my purposes(but i'm quite newbie with R). If I correctly understand prob allows to set a weight for each row in the original dataset in order to include the rows on the basis of their weights). ... I'm not sure to correctly understanding ;-) In my case a

Re: [R] Transform date - style

2012-06-14 Thread Charlie Friedemann
Try this: old.date <- "X01.11.2010" new.date <- format(as.Date(old.date,format="X%d.%m.%Y"),"%d.%b.%y") [1] "01.Nov.10" -- View this message in context: http://r.789695.n4.nabble.com/Transform-date-style-tp4633377p4633381.html Sent from the R help mailing list archive at Nabble.com. _

[R] Time difference between two dates/timing

2012-06-14 Thread Rantony
Hi, Here, i have a matrix like this MyMatrix <- *DATETIMEHEADER1HEADER2* 1/1/2010 0:10 197.1947 100.0859 1/1/2010 0:20 203.8811 100.1013 1/1/2010 0:30 206.564 100.0433 1/1/2010 0:40 207.9563

Re: [R] noob requesting help

2012-06-14 Thread Rui Barradas
Hello, Thanks, I wasn't really liking it very much but it more of a diffuse feeling than of a founded thought. It's good to see an example. Rui Barradas Em 14-06-2012 14:22, David Winsemius escreveu: On Jun 14, 2012, at 3:20 AM, Rui Barradas wrote: Hello, Now the output of str() says 'da

Re: [R] Help for boxplot

2012-06-14 Thread S Ellison
> -Original Message- > First, i use the BOXPLOT() and SUBSET() to produce the box > plot of all the 5 funds performance individually: > ... > *So the FIRST QUESTION is how to eliminate the other 5 > strategies on the Y-aix? * either use boxplot(NetReturn~factor(Strategy),data=filtere

Re: [R] gsub

2012-06-14 Thread Rui Barradas
Hello, Try t1 <- "(Ithis) I(test)" t2 <- "(Ithis) test" t3 <- sub("I\\((.+)\\)", "\\1", t1) t2 == t3 #[1] TRUE If there are more than one occurences, use 'gsub'. Hope this helps, Rui Barradas Em 14-06-2012 12:03, nalluri pratap escreveu: Hi, I have a string t1="(Ithis) I(test)". I need

[R] Transform date - style

2012-06-14 Thread juliane0212
Hello, is there any posibility to automatically transform this date notation "X01.11.2010" into "01.Nov.10" ? I did not see it before starting my simulation and now I have to deal with it. It is no problem for my calculations but for my graphical outputs I would like

Re: [R] gsub

2012-06-14 Thread Sarah Goslee
> sub("I\\((.*?)\\)", "\\1", t1) # nongreedy [1] "(Ithis) test" On Thu, Jun 14, 2012 at 7:03 AM, nalluri pratap wrote: > > Hi, > > I have a string t1="(Ithis) I(test)". I need to get t2="(Ithis) test". > > Can someone look into this. ?I have tried using gsub("I[^)]","",t1) , but > didn't get th

Re: [R] how to export output

2012-06-14 Thread Rui Barradas
Hello, Try sink("sentiment.txt") classify_polarity(...etc...) sink() If this doesn't do it see ?capture.output Hope this helps, Rui Barradas Em 14-06-2012 09:13, raishilpa escreveu: hello, I am using following command classify_polarity(documents,algorithm="bayes",verbose=TRUE) output i

[R] R matrix help

2012-06-14 Thread karthicklakshman
Dear R experts, I am interested in getting the dimensions for the matrix dynamically, based on the the number of elements in a matrix for example. if the number is 12, I should get dim= 3X4, if it is 20, dim=5X4. please help me do this. Thank you Regards karthick -- View this message in conte

Re: [R] gsub

2012-06-14 Thread peter dalgaard
On Jun 14, 2012, at 13:03 , nalluri pratap wrote: > > Hi, > > I have a string t1="(Ithis) I(test)". I need to get t2="(Ithis) test". > > Can someone look into this. ? Well, you can, it is your problem You need to look into the hairier parts of regular expression syntax. Looks like th

[R] glht multiple comparisons for glm with 2 factors

2012-06-14 Thread Melanie Jane
Hi All, I have used glm to model my data, I have two factors and a covariate as described in the example code below (mod.1). I have been able to "force" glht to perform multiple comparisons by creating a combined variable for the factors, accepting that there will be a loss of statistical power

Re: [R] p-values from lm()

2012-06-14 Thread Mohamed Lajnef
Hi David, summary(res)$coefficients[,"Pr(>|z|)"] or summary(res)$coefficients[,4] M Regrads Le 14/06/12 12:44, David Studer a écrit : > Hi everyone! > > Can anyone tell me, how to obtain p.values from a linear model? > > Example: > mod1<-lm(dV~iV1+iV2) > > Now, I can get the coefficients with

Re: [R] noob requesting help

2012-06-14 Thread David Winsemius
On Jun 14, 2012, at 3:20 AM, Rui Barradas wrote: Hello, Now the output of str() says 'dat' is a list not a data.frame. That's why R is complaining about dimensions (lack of, in this case). Try dat2 <- data.frame(do.call(cbind, dat), stringsAsFactors=FALSE) The construction data.frame(cb

Re: [R] Question about sampling

2012-06-14 Thread R. Michael Weylandt
sample() takes a prob = argument which lets you supply weights, which need not sum to one so, if I understand you, you could just pass TRUEs and FALSEs for those rows you want. If I'm wrong about that last bit, I'm still pretty confident sample(prob = ) is the way to go. Best, Michael On Thu, Jun

Re: [R] Cholesky decomposition error

2012-06-14 Thread Bert Gunter
Your matrix is not symmetric, positive definite. If you don't know what this means, you shouldn't be using chol() This may be because it isn't to begin with, or due to numerical error, it doesn't behave as one in the decomposition. My relative ignorance of numeric methods for linear algebra preven

[R] odfWeave, xtable and tex

2012-06-14 Thread Frans Marcelissen
Hello, I try to use xtable under odfWeave. With <>= library(xtable) xtable(iris) @ this results in an endless list of "xmlParseEntityRef: no name" On internet I find that results should be tex: <>= However, now the result is: 'arg' shoul

[R] Increase the word list in the sentiment analysis

2012-06-14 Thread Nalin Aggarwal
Hi, I'am using the sentient analysis available in "R2.15". Now the challenge that I'am facing is that the Naïve Baye's has an inbuilt list of 6500 words in which it has been trained. So my question that can I increase the number of words on which this algorithm is trained? In case i can increas

Re: [R] finite mixture modeling

2012-06-14 Thread Bert Gunter
Have you manually searched the CRAN Task Views? Sometimes you'll find something there that searches won't pick up. -- Bert On Thu, Jun 14, 2012 at 4:12 AM, ya wrote: > Hi all, > > I have a question, is there any R package dealing with latent transition > analysis with both categorical and conti

[R] Complex summary of counts of rank positions over multiple dataframes

2012-06-14 Thread Johannes Radinger
Hi, I've kind of a tricky question, which I don't know how to solve yet: I get multiple dataframes loaded (readRDS) in a loop function. Each loaded dataframe contains two columns one with a var-name and one with a value. The rownumber (order) is very important as it is a value of the rank (1:x

Re: [R] density plot on a log scale

2012-06-14 Thread Jim Lemon
On 06/14/2012 07:08 PM, field.cady wrote: I'm working with a large dataset - large enough that when I do a scatter plot the points all blur together, so I want to plot their density by color - a heat map or something like that. I've used smoothScatter for tasks like this, but the problem is that

Re: [R] Open windows explorer with specific path using system command

2012-06-14 Thread peter dalgaard
On Jun 14, 2012, at 12:14 , syrvn wrote: > Hello! > > I found out that it is possible to open the windows explorer with a > predefined path via the cmd.exe program using the following command: > > explorer PATH > > Back in R using the following command opens up the windows explorer: > > syste

[R] Cholesky decomposition error

2012-06-14 Thread nataraj
Dear friends, When I do Cholesky decomposition for a 15x15 matrix using the function chol(), I get the following error for which I do not understand the meaning of the error Error in chol.default(M_cov) : the leading minor of order 10 is not positive definite When I searched online for simila

[R] finite mixture modeling

2012-06-14 Thread ya
Hi all, I have a question, is there any R package dealing with latent transition analysis with both categorical and continuous indicators? So far what I found from GOOGLE are only packages dealing with latent class analysis. So what about the longitudinal situation? Any way we could look at the

Re: [R] p-values from lm()

2012-06-14 Thread Özgür Asar
Dear David, Try summary(mod1)$coef[,4] Best Ozgur -- View this message in context: http://r.789695.n4.nabble.com/p-values-from-lm-tp4633357p4633361.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list ht

[R] Question about sampling

2012-06-14 Thread Guido Leoni
Dear list I wish to extract from a population genotypized for 10 SNP a subsample of the same population of size n with similar allele frequencies. Essentially i have a matrix of 200 rows (df) like this Name,Condition,rs1385699_X,rs6625163_X,rs962458_X,Rs4658627_1, sample01,Case,1,1,1,-1 sample02,Co

[R] gsub

2012-06-14 Thread nalluri pratap
Hi,   I have a string t1="(Ithis) I(test)". I need to get t2="(Ithis) test".   Can someone look into this. ?I have tried using gsub("I[^)]","",t1) , but didn't get the required result.   Thanks, Pratap [[alternative HTML version deleted]] __ R-

Re: [R] p-values from lm()

2012-06-14 Thread Pascal Oettli
Hello, What do you want to do with these p-values? Best Regards Le 12/06/14 19:44, David Studer a écrit : Hi everyone! Can anyone tell me, how to obtain p.values from a linear model? Example: mod1<-lm(dV~iV1+iV2) Now, I can get the coefficients with mod1$coef But how can I get p-values? ($

[R] p-values from lm()

2012-06-14 Thread David Studer
Hi everyone! Can anyone tell me, how to obtain p.values from a linear model? Example: mod1<-lm(dV~iV1+iV2) Now, I can get the coefficients with mod1$coef But how can I get p-values? ($p.values seems to work with cor.test() only) Thank you! [[alternative HTML version deleted]]

Re: [R] asign variables in a "for" loop

2012-06-14 Thread Nympha Nymphaea
Thank you so much Sarah and Jim, both solutions worked perfectly!! I still have so much to learn about R, and this fantastic team motivates me a lot! I'd like to congratulate to all people that makes this work so well, it's so useful for those of us that are just beginning with R... and surely to

Re: [R] Lowest number in a numeric string

2012-06-14 Thread Petr Savicky
On Thu, Jun 14, 2012 at 01:08:53AM -0700, mogwai84 wrote: > Hi all, > > I've got a very long numeric string. I want to find the lowest number that > isn't in that string. > > E.G > > String = 123456 > Therefore 7 is the lowest number not in that string > > E.G.2 > > String = 1234567891011 > Th

[R] Open windows explorer with specific path using system command

2012-06-14 Thread syrvn
Hello! I found out that it is possible to open the windows explorer with a predefined path via the cmd.exe program using the following command: explorer PATH Back in R using the following command opens up the windows explorer: system("explorer", intern=TRUE) However, when I specify a path R re

[R] density plot on a log scale

2012-06-14 Thread field.cady
I'm working with a large dataset - large enough that when I do a scatter plot the points all blur together, so I want to plot their density by color - a heat map or something like that. I've used smoothScatter for tasks like this, but the problem is that my current dataset really only looks good o

[R] plot cdf

2012-06-14 Thread MSousa
Good Afternoon, I'm trying to create a cdf plot, with the following code.It works well, but I have little doubt, if you can help solve.When I create the plot, like the graph line would still not appear with point #cdf x<-table(Dataset$Apcode) View(s) hist(s) *plot(ecdf(x))* x<-1

Re: [R] Lowest number in a numeric string

2012-06-14 Thread Petr Savicky
On Thu, Jun 14, 2012 at 01:08:53AM -0700, mogwai84 wrote: > Hi all, > > I've got a very long numeric string. I want to find the lowest number that > isn't in that string. > > E.G > > String = 123456 > Therefore 7 is the lowest number not in that string > > E.G.2 > > String = 1234567891011 > Th

  1   2   >