similar to: Quote as element of a vector/list

Displaying 20 results from an estimated 20000 matches similar to: "Quote as element of a vector/list"

2009 Dec 01
1
Aligning Diagonally Oriented Labels Under Bar Chart
I searched the forms (i.e., R Search)?and come up with the following suggested link: ?http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-create-rotated-axis-labels_003f I tried to implement what I believe was being implied by that URL and came up with the below: barplot(WorldPhones[1,], ??????? ylim=c(0, 50000), ??????? axes=FALSE, ann=FALSE, ???????
2013 Aug 26
1
plot categorical variable with percentage infomation
Dear All, Suppose I have a categorical variable a=as.factor(sample(1:3,10,replace=T)) plot(a) and hist(as.numeric(a),freq=F) would give the histogram of it. But I do not know how to add the counts or percentage information for plot.factor(). hist() can do it but as a numeric variable, the x-axis is not 3 categories in this case. Thank you for any suggestion. Best wishes, Jie
2010 Jul 29
4
reading dates in Excel into R
I am reading dates in Excel2007 into R. Here are the functions I used: library(RODBC) channel<-odbcConnectExcel2007("myfile.xlsx") tmp<-sqlFetch(channel,"1",as.is=T) The dates in myfile.xlsx are all in this format: mm/dd/yyyy. But when I read it to R, some columns look like "yyyy-mm-dd 00:00:00", some columns look like "yyyy-mm-dd", and some
2011 Jan 26
1
Find the empty element in a factor array
Hi all, I have a factor array, and some of the elements are empty. How would I return the index number of the empty elements. For example, test<-factor(c('A','','B','C','E')) > test [1] A B C E Levels: A B C E I would like the result equal to 2. Thank you, Wendy -- View this message in context:
2008 Dec 11
5
Row order in plot
I'm new to R so forgive me if this seems like a simple question: So I have table where the row titles are string variables. When I plot the data with rows along the x-axis, the data is ordered alphabetically as opposed to the order of the table. How can I preserve the row order of the table in the plot? Thanks in advance. -- View this message in context:
2016 Apr 28
0
polygon angle option perpendicular to axis
Tena koe Simon plot(1:10, 1:10, type='n') polygon(c(2,3,6,8), c(2,5,5,3), density=20, angle=90) polygon(c(2,3,6,8), 5+c(2,5,5,3), density=20, angle=0) I don't understand your problem. Perhaps if you "provide[d] commented, minimal, self-contained, reproducible code" it would help. HTH .... Peter Alspach -----Original Message----- From: R-help [mailto:r-help-bounces at
2009 Apr 02
2
Scatter plot
Hi. How do I plot the straight line and r? in a scatter plot using a simple file x~y? Sueli Rodrigues Eng. Agr?noma - UNESP Mestranda - USP/ESALQ PPG-Solos e Nutri??o de Plantas Fones (19)93442981 (19)33719762
2009 Dec 08
1
Formatting the length one vector to match another?
I have xrange which is a range of values from 1 to a max of 162. I have a yrange of values which really could be any values, but there's a min and a max. I'd like to create N number of steps between the min and the max so the length matches the xrange, so that I can plot them together. Any tips? Thank you! -- Wells Oliver wells@submute.net [[alternative HTML version deleted]]
2011 Oct 31
3
Plot two matrices and keeping the record of row names
Dear all, I have two data frames- x1 and y1 with same row names and column names(actually the names of the patients). x1 a b c d e a 1.0000000 0.4730679 0.6226994 0.6036036 0.6433333 b 0.4730679 1.0000000 0.6227273 0.6303855 0.5730858 c 0.6226994 0.6227273 1.0000000 0.7290503 0.6900585 d 0.6036036 0.6303855 0.7290503 1.0000000
2010 Feb 10
2
simple subtraction in a single vector
OK, this is very elementary, but I need help. I have looked in Verzani, past postings etc. Problem: I need to subtract the "length" date between "h4" and "a3" #which would be 4-1 I would rather not convert the two columns into four columns (with headings being "a3","a4","c4","h4"). DF <- data.frame(length=c(1,2,3,4),
2016 Apr 27
4
polygon angle option perpendicular to axis
I am trying to use the angle option in polygon to create polygons filled with horizontal and vertical lines. The polygons I am crating are irregular and it the angle function appears to set the angle of the shading perpendicular to the polygon sides rather than perpendicular to the axes. Is there any way to set the angle relative to the axes rather than relative to the polygon sides?
2013 Oct 04
3
quote a column of a dataframe by its name
Dear All, I have a question, suppose X is a dataframe, with column names as "x1", "x2", "x3", ..... And I would like to use the i-th column by X[,'xi']. But it seems the single quote and double quote are different. So if I run X[, names(X)[i]], it has some error. Please use the below example code X = matrix(rnorm(50),ncol = 5) X = data.frame(X)
2009 May 14
3
memory usage grows too fast
Hi All, I have a 1000x1000000 matrix. The calculation I would like to do is actually very simple: for each row, calculate the frequency of a given pattern. For example, a toy dataset is as follows. Col1 Col2 Col3 Col4 01 02 02 00 => Freq of ?02? is 0.5 02 02 02 01 => Freq of ?02? is 0.75 00 02 01 01 ? My code is quite simple as the following to find the pattern ?02?.
2011 Aug 25
1
change values in a character vector
Greetings! I have a 127 long vector with all different character entries. I need to generate another vector that is 6 times a long and the second one and has the following structure: NA "foo" "a unique string" NA "bar" "blah" NA "foo" "another unique string" NA "bar" "blah" ..... This has to be repeated 127
2016 Apr 28
1
polygon angle option perpendicular to axis
Thanks for the question. Here is a sample of the code for my plot: Top = c(34, 39, 42, 45, 46, 41, 41, 40, 43, 38, 33, 33) Bottom = c(24, 29, 32, 36, 32, 34, 32,41, 40, 39, 29, 24) plot(1,1, col = "white", xlim = c(1.3,11.7), ylim = c(0,80), axis = FALSE, xaxt = "n") axis(1, at = c(1:12)) polygon(c(c(1:12),c(12:1)), c(top, bottom), col =
2010 Mar 17
3
Vector multiplication
Hi, this may sound stupid (and it probably is), but I can't seem to find out how to multiply each element of a vector with each element of another vector where the result would be a matrix of dim[length(vectorOne),length(vectorTwo)] without using loops. example: if a -> c(1,2,3) b -> c(4,5,6) i'm looking for the operation that would yield: [,1] [,2] [,3] [1,] 4 8
2009 Apr 21
1
n-dimensional vector operations
Let's start with a concrete case of n=3 dimensions. Along dimension x, I have a matrix of 5 vectors (each with ten rows) Along dimension y, I have a matrix of 3 vectors (each with ten rows) Along dimension z, I have a matrix of 2 vectors (each with ten rows) I am trying to write a: function(..., funcp) { } where funcp(...) is an operator which works on n vectors and returns a numeric.
2013 Sep 22
2
Arcsine transformation
I am tryin to perform an arcsine transformation on my data containig percentages as the dep. variable. Does anyone have a code that I could use to do that? I am relatively new to R. Thanks for your help! -- View this message in context: http://r.789695.n4.nabble.com/Arcsine-transformation-tp4676706.html Sent from the R help mailing list archive at Nabble.com.
2012 Sep 14
2
ctrl+r does not work sometimes
Dear All, This might be a tiny question but I do not know the reason. On my desktop, sometimes when I use the mouse or ctrl+A select a piece of R script, and use ctrl+R to run it, there is no action. If I redo it, it may work. On my laptop, it is fine. Both are running windows 7. Best wishes, Jie [[alternative HTML version deleted]]
2012 Jul 31
2
protential rounding error concern
Dear All, I am running a r code on 32bit win, involving absolutely small numbers. Although I tried sth like the ratio of numers like 10^(-100) and did not have issue to get the correct answer, but still a little concerned about it. Could anyone give some suggestion or have any experience? Best wishes, Jie [[alternative HTML version deleted]]