r

R interface for Stanford Parser.

Is there a package that ports Stanford parser in R? ...

R + ggplot : how to use a custom smoother (Gaussian Process)

I'm using R. I have 25 variables over 15 time points, with 3 or more replicates per variable per time point. I've melted this into a data.frame, which I can plot happily using (amongst other things) ggplot's facet_wrap() command. My melted data frame is called lis; here's its head and tail, so you get an idea of the data: > head(lis) ...

Refactoring R code using ESS/R

I would like to know if it is possible to refactor R code in ESS. Using search and replace in Emacs does not seem to be a good alternative to it. ...

Suggestion for R/LaTeX table creation package

I've been using xtable package for a long time, and looking forward to writting my first package in R... so I reckon that if I have some "cool" idea that's worth carying out, there's a great chance that somebody got there before me... =) I'm interested in functions/packages specialized for LaTeX table creation (through R, of course). I ...

How to extract e-mail data into R ?

How could I export my e-mail database from Gmail (or Thunderbird) into R? Like there is the rgoogledocs package and twitteR, is there a gmailR package, or a standard format for exporting emails into stat packages ? Tal ...

Assign sage variable values into R objects via sagetex and Sweave

I am writing a short Sweave document that outputs into a Beamer presentation, in which I am using the sagetex package to solve an equation for two parameters in the beta binomial distribution, and I need to assign the parameter values into the R session so I can do additional processing on those values. The following code excerpt shows ...

How do you sink input and output to a text file in R?

How do you sink both the console input and the console output to a text file? Take the following code: sink("temp.txt") 1:10 sink() It will write a text file that looks like this: [1] 1 2 3 4 5 6 7 8 9 10 But how do I create a text file that looks like this: > 1:10 [1] 1 2 3 4 5 6 7 8 9 10 I've looked at ?...

How do you use multiple versions of the same R package?

In order to be able to compare two versions of a package, I need to able to choose which version of the package that I load. R's package system is set to by default to overwrite existing packages, so that you always have the latest version. How do I override this behaviour? My thoughts so far are: I could get the package sources, edi...

ggplot2 heatmap : how to preserve the label order ?

I'm trying to plot heatmap in ggplot2 using csv data following casbon's solution in http://biostar.stackexchange.com/questions/921/how-to-draw-a-csv-data-file-as-a-heatmap-using-numpy-and-matplotlib the problem is x-label try to re-sort itself. For example, if I swap label COG0002 and COG0001 in that example data, the x-label still c...

Lorentz curve plot

I need to get a plot of a Lorentz curve of a cumulative variable as a function of the number of observations. I want both axes to be displayed on a percentage basis (e.g. say observations are the number of buyers and the y variable is the amount they bought, buyers are already ranked in descending order, I want to get the plot that says ...

R: preventing unlist to drop NULL values

I'm running into a strange problem. I have a vector of lists and I use unlist on them. Some of the elements in the vectors are NULL and unlist seems to be dropping them. How can I prevent this? Here's a simple (non) working example showing this unwanted feature of unlist a = c(list("p1"=2, "p2"=5), list("p1"=3, "p2"=4), l...

what's the .Rtr file for R session log?

I use Eclipse/statet R plug in on Windows. In my home directory, there are .Rtr extension files that automatically generated for every R session. file names like yyyy-mm-dd hh-mm-ss.Rtr. Can someone give me any hint where there files come from? How did I enable it? thanks. ...

How can I include a .eps figure within a Tikz simple flow chart?

Hi, I would like to create a simple flow chart in latex with the TikZ package similar to the following example http://www.texample.net/tikz/examples/simple-flow-chart/ However I would like to include figures (a time series plot created in R, as eps or something else) within the flowchart (e.g. for example within a {block}? \documentc...

How to isolate a single element from a scraped web page in R

Hello, I'm trying to do soemone a favour, and it's a tad outside my comfort zone, so I'm stuck. I want to use R to scrape this page (http://www.fifa.com/worldcup/archive/germany2006/results/matches/match=97410001/report.html ) and others, to get the goal scorers and times. So far, this is what I've got require(RCurl) require(XML) th...

get the length/width of value in a factor

How do you get the length of a variable. I am trying to get the last character of factor but the width/length of the contents is variable. I was trying to do something like this: newvariable <- substr(oldvariable, length(oldvariable) -1, length(oldvariable)) ...

Eta/Eta-squared routines in R

Apart from graphical estimation of linearity (gaze-at-scatterplot method), which is utilized before applying some technique from GLM family, there are several ways to do this estimation arithmetically (i.e. without graphs). Right now, I'll focus on Fisher's eta-squared - correlation ratio: arithmetically, it's equal to squared Pearson's...

How do I specify a dynamic position for the start of substring?

As in the example, I am trying to substring the Video_full column in a data.frame (video_data_2) I am working on. I want to keep all the characters after the period. The period is always present, there is only one period and it is in a different position in each value for the column. Date Video_full Instan...

how to substract numbers from levels

Dear SOFers, I would like to cut a vector of values ranging 0-70 to x number of categories, and would like the upper limit of each category. So far, I have tried this using cut() and am trying to extract the limits from levels. I have a list of levels, from which I would like to extract the second number from each level. How can I extra...

grouped bar graph

I have the following data: bin groupname total_dist 0 rowA 377 0 rowA 306.6 0 rowB 2.1 0 rowB 110.6 1 rowA 918.1 1 rowA 463.2 1 rowB 798.2 1 rowB 1196 2 rowA 1295.1 2 rowA 1269.1 2 rowB 698 2 rowB 1022.1 Using R, I want to make a bar graph where there is a bar for rowA and ...

R adding infrequent date 'events' to a time series plot

Hi, I am just starting on R - and have hit a bit of a deadlock with some time series data. I have a time series (date and value) in 'zoo' format, that I want to annotate with a cross when an event occurs. The events are irregular and in a csv format (just the dates, sometimes repeated). I've managed to read in the dates etc into a for...