similar to: Plot label axis with expression

Displaying 20 results from an estimated 1000 matches similar to: "Plot label axis with expression"

2012 Aug 22
1
strange behaviour when sourcing inside function
Dear R community, I encounter a problem that is counterintuitive to my understanding of the documentation of source and the "local" argument of that function. With the following code, I would expect the content of "test.R" to be evaluated inside the environment of the function "test". This, however, does not seem to be the case as the object "a" can
2012 Aug 24
1
Regular expressions: stuck again...
Hi, I'm currently reworking a report, originating from a MS Access database, but should be implemented in R. Now I'm facing the task to convert a lot of queries to postgreSQL. What I want to do is make a function which takes the MS Access query as an argument and returns the pgSQL version. So: SELECT [public_tblFiche].[Fichenr], [public_tblArtnr].[Artnr] FROM [public_tblFiche],
2012 Aug 24
1
RJSONIO/rjson maximum depth?
Hi All, has anyone run into maximum depth of nested JSON arrays in either rjson or RJSONIO ? I seem to be able to get up to 10 depth levels without problem, but crossing over to 11 either causes an error or fails to load the nodes properly. with RJSONIO I tried: a = fromJSON('data/myJSON.json', depth=1000) but I still get this error: Error in fromJSON(content, handler, default.size,
2012 Aug 25
2
sourcecode for the balloonplot function from the gplots package
Hi, I want to take a look at the sourcecode for balloonplot. I would appreciate it if I could get help on overcoming the following problem : > methods(balloonplot) [1] balloonplot.default* balloonplot.table* ? ? ?Non-visible functions are asterisked > balloonplot.default Error: object 'balloonplot.default' not found > How do I access the non-visible functions? Thanks, Ravi??
2012 Aug 21
2
Entering a table
I'm trying to enter a frequency table manually so that I can run a goodness of fit test (I only have the frequencies, I don't have the raw data). So for example, let's say I want to re-create the HorseKicks table: library(vcd) data(HorseKicks) str(HorseKicks) 'table' int [1:5(1d)] 109 65 22 3 1 - attr(*, "dimnames")=List of 1 ..$ nDeaths: chr [1:5]
2012 Aug 21
7
Regular Expressions in grep
Dear r-help members, I have a number in the form of a string, say: a<-"-01020.909200" I'd like to extract "1020." as well as ".9092" Front<-grep(pattern="[1-9]+[0-9]*\\.", value=TRUE, x=a, fixed=FALSE) End<-grep(pattern="\\.[0-9]*[1-9]+", value=TRUE, x=a, fixed=FALSE) However, both strings give "-01020.909200", exactly
2012 Aug 28
5
return first index for each unique value in a vector
I would like to efficiently find the first index of each unique value in a very large vector. For example, if I have a vector A<-c(9,2,9,5) I would like to return not only the unique values (2,5,9) but also their first indices (2,4,1). I tried using a for loop with which(A==unique(A)[i])[1] to find the first index of each unique value but it is very slow. What I am trying to do is easily
2012 Aug 17
3
Error: level sets of factors are different?
Why the error is coming? even though the length of outcome.new$compkey and outcome.new$armkey were exactly same. Can anyone help? setwd("D:/AZ") library("RODBC") cdb_cnct <- odbcConnectExcel("AZIF_DC_GVK_NSCLC_MSALL_287papers_02072012_141450_v1_4.xls") outcomes <- sqlFetch(cdb_cnct, "Outcomes_info") odbcClose(cdb_cnct) rm(cdb_cnct)
2012 Aug 20
7
relating data in two data frames
Hi, My data.frame "A" has FID like this FID a a b b b c c d d d d Now my second data.frame "B" has age value for a, b, c, d like FID Age a      5 b      7 c      9 d      3 How can search for the Age column in "B" and replace the values in "A" so that my new "A" looks like this FID Age a      5 a      5 b      7 b      7 b      7
2004 Feb 19
1
Possible error in ?axTicks
Hi all, Before posting to r-bugs, I thought that I would just verify this one first. It looks like the help for axTicks() needs to be corrected. It presently says: 'axTicks()' can be regarded as an R implementation of the C function 'CreateAtVector()' in '..../src/main/graphics.c' which is called by 'axis(side,*)' when no argument 'at' is specified.
2011 Feb 04
1
axTicks.Rd documentation bug
?axTicks says: usr: numeric vector of length four, defaulting to ?par("usr")? giving horizontal (?x?) and vertical (?y?) user coordinate limits. but this is not how the function is implemented -- in fact 'usr' should be a vector of length two corresponding to the appropriate elements of par("usr") [1:2 if side is 1 or 3, 3:4 if side is 2 or
2004 Mar 25
1
How to add a top X-axis with a different logarithmic scale?
Hi, I am trying to put on one plot two different logarithmic scales, using the bottom and top X-axes. Below there is an example of what I am trying to achieve, using axTicks() -- and fails. I already spent few hours on that, and cannot figure out from ?par and ?axTicks what I am doing wrong. Example follows: ############################################################ #### Data x <-
2012 Aug 24
6
updating elements of a vector sequentially - is there a faster way?
I would like to know whether there is a faster way to do the below operation (updating vec1). My objective is to update the elements of a vector (vec1), where a particular element i is dependent on the previous one. I need to do this on vectors that are 1 million or longer and need to repeat that process several hundred times. The for loop works but is slow. If there is a faster way, please let
2010 Nov 20
2
plotting a timeline
I was trying to recreate this kind of timeline plot: http://www.vertex42.com/ExcelArticles/create-a-timeline.html As you can see in their excel example, the events are nicely placed out on both sides of the timeline axis. AFAIK there is no function to do this nicely in R-project. Furthermore, graphics and lattice packages are unable to draw the x-axis in the middle of the plot. (datapoints
2009 Dec 03
2
Formatting of numbers on y axis
Hello all. I have the following: plot(salaries$yearID, salaries$salary, type='n', xaxt='n', xlab='', yaxt='n', ylab='') axis(1, at=unique(salaries$yearID), labels=unique(salaries$yearID), lwd=.25, tck=-0.05) axis(2, axTicks(2), format(axTicks(2), scientific = F)) Which nicely creates the Y axis with the raw numbers, which are in the range of .5 - 7
2012 Nov 14
2
vectorized plotmath expressions via substitute()
hi all - i've seen versions of this question before, but none seem to get directly at my solving my (probably very simple) issue: i simply want to annotate the tick marks on an axis with (superscripted) 10^x notation, and tried this: axis(1, at = axTicks(1), as.expression(substitute(10^foo, list(foo = axTicks(1)))) thinking the as.expression/substitute would create the appropriate
2005 Aug 14
1
Labels on axes with log scales with lattice
I using lattice to make some plots and I want to make the y-axis on some of these plots use a log scale. In the following plot: x <- 1:10 y <- 2^x xyplot(log10(y) ~ x) I get tick marks on the y-axis at 0.5, 1.0, 1.5, 2.0, 2.5, and 3.0. I would rather have just 3 tick marks at 1.0, 2.0, and 3.0 but labeled 10, 100, and 1000. I know this can be done using the "at" and
2005 Aug 18
2
axTicks and window resizing
Dear listers, I have written a function to facilitate the drawing of altitude profiles with x (distance), y (altitude) and a z parameter (altitude magnification). profplot<-function(x,y,z=10,...){ op <- par()$mai par(mai=c(0.95625,0.76875,0.76875,0.95625)) plot(x,y*z, type="l",asp=1,las=1,xlab="",ylab="",yaxt="n",...)
2013 Jan 15
2
Month name in English, not R running language
When ploting a timeseries, the months are shown with abbreviation in the current language of the system. For example, x <- seq(from=as.Date("2000-04-01"), length.out=100, by=1) y <- rnorm(length(x), 5,2) plot(x, y) Show for me "avi mai jui jul" as I use R with French language localization. I see in the Windows FAQ how to completely change the language of R, but I
2008 Jun 13
1
adding custom axis to image.plot() and strange clipping behavior
Hi list, I wanted to plot an image with a colorbar to the right of the plot, but set my own axis labels (text rather than numbers) to the image. I have previously accomplished this with two calls to image(), but the package 'fields' has a wrapper function, image.plot(), which does this task conveniently. However, I could not add axes to the original image after a call to image.plot(); I