Displaying 20 results from an estimated 30000 matches similar to: "how to find the index of points selected from a scatter plot?"
2012 May 01
3
Data frame vs matrix quirk: Hinky error message?
AdvisoRs:
Is the following a bug, feature, hinky error message, or dumb Bert?
> mtest <- matrix(1:12,nr=4)
> dftest <- data.frame(mtest)
> ix <- cbind(1:2,2:3)
> mtest[ix] <- NA
> mtest
[,1] [,2] [,3]
[1,] 1 NA 9
[2,] 2 6 NA
[3,] 3 7 11
[4,] 4 8 12
## But ...
> dftest[ix] <- NA
Error in `[<-.data.frame`(`*tmp*`, ix, value
2012 Jan 11
2
2D filter in R?
Hi all,
I am looking for a command for doing 2D filtering (rectangular or
Gaussian) in R...
I have looked at ksmooth, filter and convolve but they seem to be 1D...
Any thoughts?
Thanks a lot!
[[alternative HTML version deleted]]
2012 Aug 22
4
Is there a data/variable explorer in R?
Is there a data/variable explorer in R?
Hi all,
I am inspecting a complex variable which has lists inside lists...
Is there a data-explorer that can help me view the structure and content of
such variables?
Thank you!
[[alternative HTML version deleted]]
2011 Dec 06
4
how to view/edit large matrix/array in R?
head, tail and fix commands don't really work well if I have large
matrix/array for which I would like to be able to scroll up and dow, left
and right ...
Could anybody please help me?
Thanks
[[alternative HTML version deleted]]
2013 May 13
2
reduce three columns to one with the colnames
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt.
Name: nicht verf?gbar
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130513/fe848ce7/attachment.pl>
2012 Apr 02
2
Default parameter values in R functions?
Hi all,
I have a newbie question:
If I have a function with the following documentation:
ca.jo(x, type = c("eigen", "trace"), ecdet = c("none", "const", "trend"), K = 2,
spec=c("longrun", "transitory"), season = NULL, dumvar = NULL)
Let's take "type" as an example... if I omit this parameter when
calling the
2012 Apr 20
3
PCA sensitive to outliers?
Hi all,
I found that the PCA gave chaotic results when there are big changes in a
few data points.
Are there "improved" versions of PCA in R that can help with this problem?
Please give me some pointers...
Thank you!
[[alternative HTML version deleted]]
2013 May 25
3
When creating a data frame with data.frame() transforms "integers" into "factors"
Hello
I am novice to R and i was learning how to do a scatter plot with R using
an example from a website.
My setup is iMac with Mac OS X 10.8.3, with R 3.0.1, default install,
without additional packages loaded
I created a .csv file in vim with the following content
userID,user,posts
1,user1,581
2,user2,281
3,user3,196
4,user4,150
5,user5,282
6,user6,184
7,user7,90
8,user8,74
9,user9,45
2012 Jul 06
1
How to do goodness-of-fit diagnosis and model checking for rlm in R?
Hi all,
I am reading the MASS book but it doesn't give examples about the diagnosis
and model checking for rlm...
My data is highly non-Gaussian so I am using rlm instead of lm.
My questions are:
0. Are goodness-of-fit and model-checking using rlm completely the same as
usual regression?
1.
Please give me some pointers about how to do goodness-of-fit and
residual diagnosis for
2012 May 20
5
removeing only rows/columns with "na" value from square ( symmetrical ) matrix.
I have some square matrices with na values in corresponding rows and
columns.
M<-matrix(1:2,10,10)
M[6,1:2]<-NA
M[10,9]<-NA
M<-as.matrix(as.dist(M))
print (M)
1 2 3 4 5 6 7 8 9 10
1 0 2 1 2 1 NA 1 2 1 2
2 2 0 1 2 1 NA 1 2 1 2
3 1 1 0 2 1 2 1 2 1 2
4 2 2 2 0 1 2 1 2 1 2
5 1 1 1 1 0 2 1 2 1 2
6 NA NA 2 2 2 0 1 2 1 2
7 1 1 1 1 1 1 0 2 1 2
8
2011 Dec 21
1
Automating Plot and Model Generation
I need to generate 6 x-y scatter plots (lattice xyplot) for each of 11
data frames. I'm sure the tedium of doing these one at a time can be avoided
by writing a script that uses nested for loops or the apply() function. My
Web search has not provided me with a tutorial on R programming that will
introduce me to the language and allow me to write such a script.
Please provide pointers to
2012 May 02
2
selection by two unique variables
Dear Group,
I am working with a large dataset where I need to select for each unique id
the the unique lastpk row. Here is a sample subject:
id wtdt wt lastpk
64050256 2010-09-18 275 2010-09-16
64050256 2010-09-19 277 2010-09-18
64050256 2010-09-20 272 2010-09-18
64050256 2010-09-21 277 2010-09-18
I want the result as:
2012 Oct 23
1
Olmstead-Tukey Diagram
Hi everyone,
I am Evelina and i have just joined the forum and hope to be able to support
soembody as well as finding some help for my stats problem.
I am trying to plot Frequencies against Densities of an ecological community
using a Olmstead-Tukey diagram (O-T diagram). it is based on the Corner test
for Association.
I seem to undestand that the test can be run in R using the cor.test()
2013 Jan 23
1
Regression with 3 measurement points
Dear R Mailinglist,
I want to understand how predictors are associated with a dependent
variable in a regression. I have 3 measurement points. I'm not interested
in understanding the associations of regressors and the predictor at each
measurement separately, instead I would like to use the whole sample in one
regression, "pooling" the measurement points.
I cannot simply throw them
2013 Jun 18
2
find closest value in a vector based on another vector values
Dear All,
would you please provide your thoughts on the following:
let us say I have:
a <-c(1,5,8,15,32,69)
b <-c(8.5,33)
and I would like to extract from "a" the two values that are closest to the values in "b", where the length of this vectors may change but b will allways be shorter than "a". So at the end based on this example I should have the result
2013 Feb 13
1
Kernel Density estimation at specific points
Dear All,
I was wondering whether someone has created a kernel density evaluator that
estimates the density at given specified points.
The regular density() function evaluates the kernel at equidistant points,
but I am interested in doing such evaluation along a list of values
existing in a pre-specified vector. (Similar to the option at() in the
kdensity command in Stata).
This question has
2012 Sep 12
3
Need help
Hello,
I am brand new in this site as well as in R. Please accept my early apology if it's not the right place to ask such a question.
I have the following equation:
b=[2(1-a)(1+2a)^0.5]/(1+3a)
How can I solve the above equation for 'a' using R?
Thanks in advance.
KD
[[alternative HTML version deleted]]
2018 May 11
2
add one variable to a data frame
Sarah et. al.:
As a matter of aesthetics (i.e. my personal ocd-ness) I prefer using the
public API of an object, i.e. *not* to makes use of the representation of a
factor as essentially an integer vector with labels, but rather to use its
documented behavior. (Feel free to ignore this remark!)
Anyway,
>cumsum(!duplicated(dat1$B))
[1] 1 1 1 2 2 3 3 3 3 3 4 4
will do it.
This is very
2013 Sep 02
3
Product of certain rows in a matrix
Hi,
You could try:
A<- matrix(unlist(read.table(text="
1 2 3
4 5 6
7 8 9
9 8 7
6 5 4
3 2 1
",sep="",header=FALSE)),ncol=3,byrow=FALSE,dimnames=NULL)
library(matrixStats)
?res1<-t(sapply(split(as.data.frame(A),as.numeric(gl(nrow(A),2,6))),colProds))
?res1
#? [,1] [,2] [,3]
#1??? 4?? 10?? 18
#2?? 63?? 64?? 63
#3?? 18?? 10??? 4
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)