similar to: creating axis of the plot before data are plotted -- solved

Displaying 20 results from an estimated 200 matches similar to: "creating axis of the plot before data are plotted -- solved"

2008 Jul 14
1
creating axis of the plot before data are plotted
Dear R-users, I'm tackling with a problem which causing me a head-ache for a long time. I would like to create a nice x-axis to my plots, but I do not know how to implement the method. Imagine a matrix where you have rownames real numbers -- these rownames should be written in the x-axis nicely. I could not find any way how. I'll describe what I'm doing now: I have a matrix where
2008 Jul 10
4
Turn any vector
Dear R-users, I'd like to turn a vector so it starts with it's end. For better understanding, this set of commands will do what I need: i <- seq(1:10) i_turned <- i for (j in 1:length(i)) i_turned[j] <- i[length(i)-j+1] now, i_turned is what I call turned. Is there a function which would make a script lighter? Thank you upfront for any hint. Best regards, Zroutik
2008 Aug 11
1
line with of the symbols in the legend -- changable?
Dear R users, I plot data with points(my_data[x]~x, col = x, type = "o", lwd="4") where x is an integer running from 1 to 10, I get points drawn at the plot. When want to do a legend to this I try legend(leg.txt[x], col = x, text.col = 1, pch = 1, bty = "n") where leg.txt contains the names of the variable and x behaves the same. The difference between the
2008 Aug 11
4
A comprehensive manual on "How to plot" (a lot of graphical examples welcome)
Hi, I'm looking for a manual (we based or pdf) which would explain in detail with graphical examples what all the option can do in plot and par. Does anybody now anything like this? A couple of manuals to R I went through do have plot parameters mentioned, but sometimes it is hard to understand or imagine what the parameter can do (the same with the related help page) e.g. I met "From
2009 May 19
5
exists function on list objects gives always a FALSE
Dear R-users, in a minimal example exists() gives FALSE on an object which obviously does exist. How can I check on that list object anyway else, please? > SmoothData <- list(exists=TRUE, span=0.001) > SmoothData $exists [1] TRUE $span [1] 0.001 > exists("SmoothData") TRUE > exists("SmoothData$span") FALSE > exists("SmoothData[[2]]") FALSE
2010 Nov 02
2
get the scripname within the executed myscript.r
Dear R-users! Is there a way to obtain the name of the executed myscript.r, i.e. when cmd> rscript myscript.r is executed? (The name of the script in this case is "myscript.r") Here is the explanation of why I would like to get that: Why: I have prepared a set of scripts (decompose_data.r, plot_with_higher_resolution.r, plot_3D.r, etc.) placed in a root directory at one place. I
2009 Jul 15
1
loading multiple .Rdata and preserving variable names
Dear R-users, I need to load outputs from multiple previous calculations into one R session for comparison and (cross-)analysis. The previous calculations are stored in different directories in .Rdata files (I don't know if this is the best storage for later usage, but the previous project could be recalculated and saved into different format, if needed, potentially.) I can load consequently
2011 Nov 03
2
grep fixed (?) in 2.14
#This is probably due to my incomplete understanding of grep, but the below code has been working for some time to #search for .R with anything in front of it and return a list of scripts to source. Likely, the syntax for the #grep statement has been wrong all along. scripts2source <- (c("/home/ssefick/R_scripts/Convert_package.R",
2008 May 23
2
Fit a sine to data
Dear R-users, I'd like to fit a sine function to my data. The result should have a format (and thus the formula, too) y ~ a + sin(x+b) where y and x are vectors, and a and b are (yet) unknown values. The data sets (vectors x and y) are OK, and I can do a simple lm fitting lm(y~x), or lm(y~I(sin(2*pi*x/360))), succesfully My issue is that I'm not able to do the optional linear shift in
2010 Jul 08
0
0 exit status on packages update try
I am not entirely sure what is going on. I am sure that I am missing something. maptools won't detach... Thanks for all of your help. R 2.11.1 OS Ubuntu 10.04 R --vanilla install.packages("sp", dep=TRUE) Loading required package: reshape Loading required package: plyr Loading required package: grid Loading required package: proto This is vegan 1.17-3 Loading required package:
2012 Oct 21
1
Changing a for loop to a function using sapply
Apparently there is one or more concepts that I do not fully understand from the descriptions of a function and the apply material. I have been reading the mail from this forum and have learned much but, in this case, what I have been reading here and from the manual isn't enough. The following code produces what I want with the for loop. From what I have read from this forum, a for
2024 Feb 21
0
Network issue
Hi Stephen, Thanks again for getting back to me, Ivan Krylov responded also and suggested windows binaries and I must confess I was only familiar with installing from files via the package sources (apart from the conventional install.packages method), so the solution was as simple as installing via the binaries. Thanks again, best wishes, James From: stephen sefick <ssefick at gmail.com>
2008 Aug 14
1
the name of the current running script.r
Dear R users, is there a hack how to get the filename of the current script.r sourced/ran? My issue: I have a couple of scripts which were optimised and are placed in tens of directories. (I have a height.r script in 30 directories, a lines.r script in 25 directories and another flow.r script in 54 directories, growing). The script runs in the directory and does its job: sources data and creates
2008 Sep 17
3
using for variable as rowname
Is there a way to use the cycle variable for rowname? v=1:6 for (a in 1:3){ for (b in 4:5) { v=rbind(v,a.b=1) } } v This above obviously does not work, but I couldn't find out how to use a and b to construct a rowname like 14, 15, 24, 25. Thanks for the help. Balazs -- View this message in context: http://www.nabble.com/using-for-variable-as-rowname-tp19533203p19533203.html Sent from
2009 Nov 16
1
extracting values from correlation matrix
Hi! All, I have 2 correlation matrices of 4000x4000 both with same row names and column names say cor1 and cor2. I have extracted some information from 1st matrix cor1 which is something like this: rowname colname cor1_value a b 0.8 b a 0.8 c f 0.62 d k 0.59 - - -- -
2007 Oct 17
3
type conversion
Hello, I am trying to do arithmetic on numbers extracted from a PostgreSQL database, wherein the numbers are stored as type "money". The transcript below illustrates the problem. > Membersind06 <- sqlQuery(channel,"select * from income where rowname like '%Membersind%'") > names(Membersind06) [1] "rowname" "item"
2009 Mar 02
3
Error setting rowname if rowname currently NULL
Hi, My first post here and new to R so please bear with me (long time programmer though, helping a friend with some scripts). I've noticed a behaviour when using rownames() that I think is odd, wondering if I'm doing something wrong. To illustrate, say I create a very simple matrix (called fred): fred<-matrix(,4,2) It looks like this: [,1] [,2] [1,] NA NA [2,] NA NA
2006 Feb 12
1
Mathematical typesetting of column heads using the latex (Hmisc) function
Dear r-helpers, I would very much appreciate help with the following problem: The following command (in a .Rnw file) latex(anova(e7.lmer3, e7.lmer4), file = 'e7lmer34.tex', rowname = c ('nonlinear', 'linear'), longtable = FALSE, dcolumn = T, booktabs = T, table.env = F) produces the following output after running Sweave: % latex.default(anova(e7.lmer1, e7.lmer2),
2004 Jun 11
4
rownames of single row matrices
Hi I want to extract rows of a matrix, and preserve rownames even if only one row is selected. Toy example: R> a <- matrix(1:9,3,3) R> rownames(a) <- letters[1:3] R> colnames(a) <- LETTERS[1:3] R> a A B C a 1 4 7 b 2 5 8 c 3 6 9 Extract the first two rows: R> wanted <- 1:2 R> a[wanted,] A B C a 1 4 7 b 2 5 8 rownames come through fine. Now extract just
2008 Aug 19
0
Converting monthly data to quarterly dataMonday, August 18, 2008 11:38 AM
Dear Gavin, This is really great, thank you! I created some long loops to get rid of extra months at the beginning and the end of my data but your code is great for putting it then together quarterly. thanks again, Denise On Mon, 2008-08-18 at 14:31 +0100, Denise Xifara wrote: > Thank you very much Stephen, but how will aggregate deal with months that > fall outside annual quarters? eg,