similar to: read.xls -> rotate data.frame

Displaying 20 results from an estimated 5000 matches similar to: "read.xls -> rotate data.frame"

2011 Mar 09
4
Extracting only odd columns from a matrix
Hi, This might seem like a simple question but at the moment I am stuck for ideas. The columns of my matrix in which some data is stored are of this form: X1 Y1 X2 Y2 X3 Y3 ... Xn Yn with n~100. I would like to look at just the X values (i.e. odd column numbers). Is there an easy way to loop round extracting only these columns? Any help would be appreciated.
2012 Oct 10
3
Generating random geographical coordinates
Dear all, I have two coordinates vectors, say X and Y of length n. I want to generate for each couple of coordinates X1,Y1 X2,Y2 X3,Y3....Xn,Yn a random coordinate which is located in a square define as X +/- dx and Y +/- dy. I saw the runif function which can generate for just one value at a time what I want : runif(1, X - dx, X + dx) for X and runif(1, Y - dy, Y + dy) for Y. I would like
2010 Sep 26
1
compare a vector and a row of a matrix
From: xxgreat@hotmail.com To: r-help-bounces@r-project.org Subject: compare a vector and a row of a matrix Date: Sun, 26 Sep 2010 23:23:52 +0800 Hi Everyone: I am trying to compare a vector and rows of a matrix for example > xn <- c(1,2,4,4,5,5,5,6) >yn <- c(1,2,5,7,1,2,3,1) >mtrx <- cbind(xn, yn) when I tried, say, > c (1,4), the result was TRUE, TRUE.
2004 Apr 13
1
postscript image problem (PR#6763)
Full_Name: Jonathan Lees Version: 1.8.1 OS: GNU/Linux 2.4.20-20.8smp #1 SMP Submission from: (NULL) (152.2.75.114) I am having trouble with the postscript output of images. They have lines on them that are not supposed to be there. I have noticed this on numerous trials of printing various images. I looked at the postscript and I see that it appears to plot each individual block - so perhaps
2007 Mar 01
1
covariance question which has nothing to do with R
This is a covariance calculation question so nothing to do with R but maybe someone could help me anyway. Suppose, I have two random variables X and Y whose means are both known to be zero and I want to get an estimate of their covariance. I have n sample pairs (X1,Y1) (X2,Y2) . . . . . (Xn,Yn) , so that the covariance estimate is clearly 1/n *(sum from i = 1 to n of ( X_i*Y_i) ) But,
2012 Feb 23
5
cor() on sets of vectors
suppose I have two sets of vectors: x1,x2,...,xN and y1,y2,...,yN. I want N correlations: cor(x1,y1), cor(x2,y2), ..., cor(xN,yN). my sets of vectors are arranged as data frames x & y (vector=column): x <- data.frame(a=rnorm(10),b=rnorm(10),c=rnorm(10)) y <- data.frame(d=rnorm(10),e=rnorm(10),f=rnorm(10)) cor(x,y) returns a _matrix_ of all pairwise correlations: cor(x,y)
2009 Dec 15
1
Help in R
Hello, Can anyone give me some suggestion in term of calculating the sum below. Is there a function in R that can help doing it faster? x1, x2, ...xn where xi can be 0 or 1. I want to calculate the following: sum{ beta[a+sum(xi), b+n-sum(xi) ]* [ (1-x1)dnorm(0,1)+x1dnorm(2,1) ]* [ (1-x2)dnorm(0,1)+x2dnorm(2,1) ]* ...* [ (1-xn)dnorm(0,1)+xndnorm(2,1) ] } The sum in the beginning is over all
2006 Jan 18
6
some EPS rotated in journal preview
I am trying to send a manuscript to a journal. One of the figures build by R is in the right orientation and 4 are rotated clockwise 90 deg in the preview. I used the right click save to PS option and I used the command line postscript("c:/temp/fig04.eps",bg="transparent",onefile = TRUE ,pointsize=20,paper = "letter",height=8,width=8,horizontal=FALSE,family =
2023 Feb 23
2
Possible NA Propagation Failure in RISC-V64 CPU?
Hi all, I am currently compiling R to RISC-V64 CPU and I think I have discovered a NA propagation failure. How R implements NA (not available) and NaN (not-a-number) is explained in detail here: https://stat.ethz.ch/pipermail/r-devel/2014-February/068380.html. In short, according to my understanding of R's convention, any calculation involving NA but no NaN should result in NA (called NA
2006 Feb 17
4
showing the integrated number by point size
Is there any function to show the points like this example of SPSS? http://biostatistic.de/temp/reg.jpg The point size should represent the number of data at this point. with regards Knut Krueger
2010 Dec 26
2
What is the best way to lag a time series?
Dear R-users, I've been using R for a while and I am very satisfied! Unfortunately, I still have not figured out an efficient and general way to construct and use lags of time series, especially when I need to work with different packages. Let me give an example. I have two time series x and y and I want to estimate a variaty of distributed lags models and run different tests
2011 Mar 04
2
Reading in and manipulating multiple data sets from the same input file
Hi, I am attempting to write code which will read in my data which is of this form: X1 Y1 X2 Y2 .... Xn Yn 0 0 0 0 0 0 1 0 1 255 1 0 2 255 2 0 2 255 3 0 3 0
2005 Jul 12
5
High resolution plots
Is there any possibility to get high resolution plots in a windows xp system? I tried it with the device function png(filename = "c:/r/highresplot%d.png",pointsize=12, res=900) but when I try to set: width = 480, height = 480 or pointsize = 12, the text is not scaled in the same way as the plots. with regards Knut Krueger http://www.biostatistic.de
2009 Dec 23
7
String question
Hi to all I need a string like temp <- paste("m1","m2","m3",sep=",") But i must know how many items are in the string,afterwards the other option would be to use a vector temp <- c("m1","m2","m3") No problem to get the count of items but I must get afterwards the string "m1,m2,m3" No problem to build the
2010 Feb 23
5
deleting column from data frame
Hi to all, test <- data.frame("X"=c(1:4),"Y"=c(5:8),"Z"=c(8:11)) test <- test[,-2] Is there a way to specify the col name "Y" to delete instead the number? Kind regards Knut
2005 Jul 13
3
texture in barplots?
Dear R list, For some reason I am unable to access neither search.r-project.org, nor http://finzi.psych.upenn.edu/ so I cannot search the archives for a possible answer (I Googled for this but didn't find anything). Is it possible to draw barplots using a texture instead of colors, for a black and white printer? TIA, Adrian -- Adrian Dusa Arhiva Romana de Date Sociale Bd. Schitu
2005 Aug 09
5
RGUI crash when opening script in XP Home enviroment
If there is a helpfile open (f.e ?glm) and it is the top window, then an exception error occurs (closing RGUI) when I hit the open file button. If the helpfile is not the top window (of the RGUI) I am able to open a new script without any error. The RGUI is not closing complete there is a blank screen left which I have to close with the X Button or Taskmanager Windows XP Home - German Version
2010 May 18
5
looking for .. dec if vector if element > x
Hi to all, I am just looking for more efficient ways ;-) is there a better way instead a loop to decrease x if greater y test <- c(1,3,5,7,9) decrease if greater 1 to test2 <- c(1,2,4,6,8) Kind regards Knut
2005 Sep 25
4
hist(x, ...) with normal distribution curve
. I am looking for a histogram or box plot with the adding normal distribution curve I think that must be possible, but I am not able to find out how to do. Regards Knut
2010 Jul 21
4
Chi-square distribution probability density function:
Hi to all I found an formular of an ** ***p-Value Calculator for the Chi-Square test* *http://www.danielsoper.com/statcalc/calc11.aspx* *with the formula* *http://www.danielsoper.com/statkb/topic11.aspx* *what's the gamma function of this formula in r?* *df=5* *ch2=25.50878* *the following code does not give the result <0.001 for the values above * *p=