Re: [R] Read shortcuts of MS Excel files through R

2013-09-26 Thread Mark Lamias
Assuming you are trying to read the contents of the Excel files and not the shortcut itself, try something link this: #C:\users\mark\desktop\A1.xlsx.lnk is a shortcut I created on my desktop to an xlsx document in another directory #The windows type command, along with find gets the path to the

Re: [R] Having trouble converting a dataframe of character vectors to factors

2013-02-21 Thread Mark Lamias
,"Bill",..: 1 2 3   - attr(*, "Date")= POSIXlt, format: "2013-02-21"   > str(f3(x)) # mangles column names, drops unused levels, drops Date attribute   'data.frame':  3 obs. of  3 variables:   $ No.Yes: Factor w/ 1 level "Yes": 1 1 1   $ Size 

Re: [R] Having trouble converting a dataframe of character vectors to factors

2013-02-20 Thread Mark Lamias
How about this? scs2<-data.frame(lapply(scs2, factor)) From: "Lopez, Dan" To: "R help (r-help@r-project.org)" Sent: Wednesday, February 20, 2013 7:09 PM Subject: [R] Having trouble converting a dataframe of character vectors to factors R Experts, I have

Re: [R] Recommendation for website to format R code

2013-01-23 Thread Mark Lamias
/formatR/formatR.pdf --Mark Lamias From: C W To: r-help Sent: Wednesday, January 23, 2013 9:27 PM Subject: [R] Recommendation for website to format R code Hi list, Could anyone recommend some good website for formatting R code?  For example, when you copy paste

Re: [R] A question on list and lapply

2012-12-14 Thread Mark Lamias
How about Dat1 <- lapply(subset(Dat, Dat!="P"), My_Function) --Mark From: Christofer Bogaso To: r-help@r-project.org Sent: Friday, December 14, 2012 1:58 PM Subject: [R] A question on list and lapply Dear all, let say I have following list: Dat <- vecto

Re: [R] reformatting some data

2012-12-04 Thread Mark Lamias
not clear to me what it is you are attempting to do, as you switch from a very specific example to some general example with the vague terms "var1" "var2", and "var3." It sounds like you might be trying to do something similar to what would be available in the shap

Re: [R] reformatting some data

2012-12-04 Thread Mark Lamias
in the shape package using the melt function. Try ?melt.data.frame. --Mark Lamias From: Charles Determan Jr To: r-help@r-project.org Sent: Tuesday, December 4, 2012 4:17 PM Subject: [R] reformatting some data Hello, I am trying to reformat some data so t

Re: [R] list to matrix?

2012-12-04 Thread Mark Lamias
Try: matrix(unlist(a), ncol=2, byrow=T) --Mark Lamias From: Sam Steingold To: r-help@r-project.org Sent: Tuesday, December 4, 2012 3:09 PM Subject: [R] list to matrix? How do I convert a list to a matrix? --8<---cut here---st

Re: [R] How to read SPSS file in R

2012-12-03 Thread Mark Lamias
  "WTFA_SA"  "SEX"  "AGE_P"    "REGION"   "SMKNOW"   "VITANY"   "VITMUL"   "HERBSUPP" "VIGFREQW" [12] "MODFREQW" "STRFREQW" "DESIREWT" "MOVE1"    "LIFT"

Re: [R] knitr error with Lyx

2012-11-29 Thread Mark Lamias
Hi, Yihui, Attached is an HTML Diff report of the two files.  The left pane contains the R-2.15.0 file. Thanks. --Mark From: Yihui Xie To: Mark Lamias Cc: "r-help@r-project.org" Sent: Thursday, November 29, 2012 2:43 PM Subject: Re: [R] k

Re: [R] Can R be embedded in html?

2012-11-29 Thread Mark Lamias
I haven't used it yet, so I can't comment about the stability or appropriateness of it, but R.NET looks somewhat promising for this: http://rdotnet.codeplex.com/ Shiny is another potential way to go. You could also take a look at David Firth's CGIwithR:  http://www2.warwick.ac.uk/fac/sci/stati

Re: [R] knitr error with Lyx

2012-11-29 Thread Mark Lamias
Thanks, Yihui! Luckily I kept R-2.15.0 and left it untouched (so I can continue to use that for now).  If it helps any, I was able to go back into Lyx and change the path to point to R-2.15.0 and I also changed the windows path environment variable to point to the old version.  After doing this

[R] knitr error with Lyx

2012-11-29 Thread Mark Lamias
R Users, I just upgraded my version of R from R-2.15.0 to R-2.15.2 and installed the latest versions of LyX and MikTex running Windows 7 Ultimate, 64-bit OS.  Prior to the upgrade, I was using Lyx with knitr to generate a document with no problems.  However, after the upgrade, and using the sa

Re: [R] binning by frequency

2012-11-27 Thread Mark Lamias
You might find the binning function in the sm package helpful here. --Mark Lamias From: Santosh To: r-help Sent: Tuesday, November 27, 2012 9:59 AM Subject: [R] binning by frequency Dear Rxperts, is there way to identify intervals from continuous data

Re: [R] Help in splitting the records

2012-11-26 Thread Mark Lamias
In the example below, I don't see any "$$$" separators.  Are you sure this is supposed to be the separate or just a single dollar sign?  If this is the case, you don't specify what is to happen when multiple separators appear next to each other.  From your example, it appears that two separators

Re: [R] How to Label Cases in Scatterplots?

2012-11-25 Thread Mark Lamias
You could use something like this: #Generate 26 simulated data points y=rnorm(26) x=1:26 your.labels=letters #Plot data plot(x, y, xlim=c(min(x), max(x)+.25), ylim=c(min(y), max(y)+.25)) #Label points text(x+.15, y+.15, your.labels) You could also use the textxy function in the calibrate pa

Re: [R] Weighted least squares

2012-11-21 Thread Mark Lamias
I'm guessing that you have more elements in your weights vector than you have observations?  It's hard to tell without seeing your data.   See below:   #Generate fake data y=rnorm(10) X1=rnorm(10) X2=rnorm(10) X3=rnorm(10)   #Create a 10 element vector of weights wts=abs(rnorm(10))   #weighted lm

Re: [R] Greek letters on title

2012-11-20 Thread Mark Lamias
May may also find this helpful, especially if you know LaTex: http://yihui.name/en/2011/04/produce-authentic-math-formulas-in-r-graphics/ To: bgnumis ; "r-help@r-project.org" Sent: Tuesday, November 20, 2012 6:22 PM Subject: Re: [R] Greek letters on title T

Re: [R] Greek letters on title

2012-11-20 Thread Mark Lamias
Try this: titleline=expression(paste("Time evolution with ", alpha, "=0.2")) plot(x, main=titleline,col="orange") --Mark J. Lamias From: bgnumis To: r-help@r-project.org Sent: Tuesday, November 20, 2012 3:47 PM Subject: [R] Greek letters on title Hi all,

Re: [R] kinitr

2012-11-20 Thread Mark Lamias
This is how I learned everything about knitr: http://yihui.name/knitr/ Yihui is great and his site gives  you pretty much all the information you need to get you started. From: "Muhuri, Pradip (SAMHSA/CBHSQ)" To: 'R. Michael Weylandt' Cc: "r-help@r-project

Re: [R] Deviation standard & variance

2012-11-20 Thread Mark Lamias
What about something like this: #Create dummy data mydf=data.frame(matrix(rnorm(1000), ncol=100)) #Obtain summary stats my.vars=apply(mydf, MARGIN=2, FUN=var) my.std=sqrt(my.vars) #Plot summary stats plot(my.vars, col="red") points(my.std, col="blue") From

Re: [R] Looking for a test of standard normality

2012-11-08 Thread Mark Lamias
The Anderson-Darling Test and the Shapiro-Wilk test have considerably more power. I'd refer you to a non-R related discussion board for statistics related questions.  Perhaps the following might be more useful: http://stats.stackexchange.com/questions/8184/most-powerful-gof-test-for-normality

Re: [R] Autofilling a large matrix in R

2012-10-12 Thread Mark Lamias
If you are after all the possible percentages with two decimal places, why don't you use this: seq(from=0, to=100, by=.01)/100 I'm not really sure what you are trying to do in terms of rows and columns, however.  Can you be a bit more specific on what each row/column is?  Are you trying to gro

Re: [R] Barplot problem

2012-04-20 Thread Mark Lamias
Here is an example you can use:  #Generate random normal variables to use as dummy data for Fisher's Alpha alphaBCI<-rnorm(100)   #Assume you have 5 sites, each with 20 data points sites<-rep(c("Site 1", "Site 2", "Site 3", "Site 4", "Site 5"), each=20)   #Making sites a factor will produce the str

Re: [R] how to calculate a variance and covariance matrix for a vector

2012-03-12 Thread Mark Lamias
cov(A) will compute a covariance matrix of the columns of a matrix A.   cov(a, b) will compute a covariance of the vectors a and b.   here are some examples:   #create random vectors a=rnorm(10) b=rnorm(10)     > a  [1] -0.3110384 -2.6201009 -1.3078118  1.3384743  2.4032381 -0.7245201  [7]

Re: [R] Running Total

2012-03-05 Thread Mark Lamias
1L, 1L, 1L, 1L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 0L, 1L, 1L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 0L, 1L, 1L, 1L, 0L, 1L, 1L, 0L, 1L, 1L, 1L, 1L, 0L, 1L, 1L, 1L, 1L, 0L, 1L, 1L, 1L, 1L, 0L, 1L, 1L, 1L, 0L, 1L, 1L, 1L, 1L, 1L, 0L, 1L, 1L, 1L, 1L, 0L, 1L, 1L, 1L, 0L, 1L, 1L, 1L, 1L) cbind(x, cumsum(x==0))   --M

Re: [R] R-latex syntax highlighting?

2011-11-23 Thread Mark Lamias
I use pgfSweave so that I can embed R code and output in LaTeX; pgfSweave depends on the formatR package to format the code, and the highlight package to highlight R code; graphics are based on tikzDevice, which has better quality than R's PDF or postscript output, in my opinion. Check out the de

Re: [R] Is there an easier way to iterate over multiple data frames in R?

2011-11-23 Thread Mark Lamias
df3)) sapply(X=mydfs, MARGIN=c(1,2), FUN=mean) [,1]    [,2]   [,3] V1  0.8206239 -0.51637848 -0.9025252 V2 -0.2828919  0.41837384 -0.4042646 V3 -0.8996891 -0.06284681 -0.2459261 --Mark Lamias From: Kaiyin Zhong To: r-help Sent: Wednesday, Novem

Re: [R] one sample Wilcoxon test using 'coin'

2011-10-31 Thread Mark Lamias
The wilcoxon test in coin are meant only for "Testing the equality of the distributions of a numeric response in *two or more* independent groups against shift alternatives" whereas the wilcoxon test in the base pacakge "Performs *one-* and two-sample Wilcoxon tests on vectors of data; the latt

Re: [R] MLE estimation

2011-02-27 Thread Mark Lamias
Check out Casella and Berger's Statistical Inference.  ISBN 978-81-315-0394-2 or http://en.wikipedia.org/wiki/Maximum_likelihood as an online reference. --Mark J. Lamias From: Ning Cheng To: r-help@r-project.org Sent: Sunday, February 27, 2011 3:19 PM Subject: [R] MLE estimation Dear List, Th

[R] R version of SAS/IntrNet

2010-05-12 Thread Mark Lamias
Does an R package exist that is similar to SAS/Intrnet (http://support.sas.com/documentation/onlinedoc/intrnet/index.html) that will allow users to take parameters passed to it by a web request, produce results and return them to the web-browser in HTML format?  I tried looking through the pack

[R] Fw: Improving loop performance

2010-05-11 Thread Mark Lamias
} I tried a few of the previous suggestions (and tried modifying them), but they didn't seem to quite do the trick.  Any assistance would be greatly appreciated. Thanks a million. --Mark Lamias   - Forwarded Message From: jim holtman To: Mark Lamias Cc: r-help@r-project.org

[R] Improving loop performance

2010-05-11 Thread Mark Lamias
aracter(aga2[i, "AP"])   ags[i]<-as.character(aga2[i, "AS"])     }  else  {   p1[i]<-paste(p1[i-1], aga2[i, "AP"], sep=",")   ags[i]<-paste(ags[i-1], aga2[i, "AS"], sep=",")  } } Thanks. --Mark Lamias [[alt