Displaying 20 results from an estimated 4000 matches similar to: "Help in R"
2011 Mar 25
4
read.xls -> rotate data.frame
Hi to all,
how could I to rotate automatically a data sheet which was imported by
read.xls?
x1 x2 x3 .... xn
y1 1 4 7 ... xn/y1
y2 2 5 8 .... xn/y2
y3 3 6 9 ....xn/y2
yn ... ... ... Xn/Yn
to
y1 y2 y3 .... yn
x1 1 2 3 ..... Yn/x1
x2 4 5 6 .... Yn/x2
x3 7 8 9 .... Yn/x2
xn ... ... ... ..... Yn/xn
Kind regards Knut
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)
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
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.
2010 Oct 24
6
Contour Plot on a non Rectangular Grid
Dear All,
I would like to plot a scalar (e.g. a temperature) on a non-rectangular
domain (or even better: I would simply like to be able to draw a contour
plot on an arbitrary 2D domain). I wonder if there is any tool to
achieve that with R. I did some online search in particular on the list
archives, found several queries similar to this one but was not able to
find any conclusive answer.
I
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 Aug 20
5
paired samples, matching rows, merge()
Hi everyone!
I'm matching two samples to create one sample that have
pairs of observations equal for the k1 variable. Merge()
doesn't work because I dont't want to recycle the values.
x <- data.frame(k1=c(1,1,2,3,3,5),
k2=c(20,21,22,23,24,25))
x
y <- data.frame(k1=c(1,1,2,2,3,4,5,5),
k2=c(10,11,12,13,14,15,16,17))
y
merge(x,y,by="k1")
k1 k2.x k2.y
1 1 20
2000 Jan 12
1
Usage of p/d/qnorm
Hello,
could You please help: I am looking for a way to formulate test accuracy
measures such as test sensitivity, specificity, predictive values, and
correct classification rate using p/d/qnorm. The tests' primary values
follow a bimodal distribution, which is modelled by a mixture of two normal
distributions:
p * dnorm ((x - u1) / s1) / s1 +
(1 - p) * dnorm ((x - u2) / s2) / s2)
2019 May 08
3
[R] approx with NAs --> new argument 'na.rm=TRUE' ?!
>>>>> Robert Almgren
>>>>> on Fri, 3 May 2019 15:45:44 -0400 writes
[ __ to R-help __ -- here diverted to R-devel on purpose]
> There is something I do not think is right in the approx()
> function in base R, with method="constant" and in the
> presence of NA values. I have 3.6.0, but the behavior
> seems to be the same in
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
2008 Sep 01
1
intercept of 3D line? (Orthogonal regression)
I posted before recently about fitting 3D data x, y, z where all have
error attached.
I want to predict z from x and y; something like
z = b0 + b1*x + b2*y
But multiple regression is not suitable because all of x, y, and z have errors.
I have plotted a 3D scatterplot of some data using rgl. I see that the
data form a cigar-shaped cloud. I think multiple regression is only
suitable when the points
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 Sep 22
2
"logistic" + "neg binomial" + ...
Hi Folks,
I've just come across a kind of problem which leads
me to wonder how to approach it in R.
Basically, each a set of items is subjected to a series
of "impacts" until it eventually "fails". The "force"
of each impact would depend on covariates X,Y say;
but as a result of preceding impacts an item would be
expected to have a "cumulative
2012 Jul 03
1
integral with error:non-finite function value
Hi guys,
I'm trying to use the the integral function to estimate the area under a
PDF and a crossing curve. first I stated the function with several vectors
in it:
fn=function(a,b,F,mu,alpha,xi)
{
x<-vector()
fs<-function(x)
{
c <- (mu+(alpha*(1-(1-F)^xi)/xi))
tmp <- (1 + (xi * (x - mu))/alpha)
((as.numeric(tmp > 0) * (tmp^(-1/xi - 1) *
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 Apr 11
1
inference for customized regression in R?
Hi all,
Are there functions in R that could help me do the following?
We have a special type of regression which is called Geometric Mean
Regression.
We have done some search and found the following:
https://stat.ethz.ch/pipermail/r-help/2011-July/285022.html
The question is: how to do the statistical inference on GMR results?
More specifically, we are looking for the prediction interval:
2008 Aug 22
1
Building colorspace on RHEL5
Dear all,
I'm having problems installing the colorspace package on Red Hat
Enterprise Linux 5:
* Installing *source* package 'colorspace' ...
** libs
gcc -std=gnu99 -I/usr/lib/R/include -I/usr/lib/R/include
-I/usr/local/include -fpic -O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic
2005 Dec 08
1
logistic regression with constrained coefficients?
I am trying to automatically construct a distance function from
a training set in order to use it to cluster another data set.
The variables are nominal. One variable is a "class" variable
having two values; it is kept separate from the others.
I have a method which constructs a distance matrix for the levels
of a nominal variable in the context of the other variables.
I want to