Displaying 20 results from an estimated 13000 matches similar to: "Turn any vector"
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
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 15
0
creating axis of the plot before data are plotted -- solved
Solved. I tried to create a minimal example, but my script is too
complicated to just cut out lines (too many dependencies). Instead of
it, I sketch
my idea. I do not say it is the nicest solution, but it works as I wanted.
The first five rows of my data-matrix:
> data_svd$u[1:5,]
[,1] [,2] [,3] [,4] [,5]
[,6] [,7]
25.12333 -0.05845695
2008 Feb 11
4
Conditional rows
Hi,
Given a simple example, test <- matrix(c(0.1, 0.2, 0.1, 0.2, 0.1, 0.1, 0.3,
0.1, 0.1), 3, 3)
How to generate row indexes for which their corresponding row values are
less than or equal to 0.2 ? For this example, row 2 and 3 are the correct
ones.
Thanks
[[alternative HTML version deleted]]
2008 Jul 11
2
network
Hello
I am a relatively new user of R and am struggling to use the 'network' package. I have a correlation matrix (produced using 'cor'), and want to draw a network where each item showing correlation above a threshold (say 0.5) is joined by a green line, and each item showing correlation below a threshold (say -0.5) is joined by a red line. Does anyone have any hints of how to
2008 Feb 01
2
re placing values in a matrix
useR's,
Consider:
y <- c(20, 25, 30)
> m <- matrix(c(0.0,1,NA,0.5,1.25,0.75, 0.5, NA,
> NA),byrow=TRUE,nrow=3,ncol=3)
> m
[,1] [,2] [,3]
[1,] 0.0 1.00 NA
[2,] 0.5 1.25 0.75
[3,] 0.5 NA NA
For each numeric value, I want to replace them with their corresponding
y-value. The result should look like (here, each row represents a variable
rather than the columns):
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 Jan 11
2
Count unique rows/columns in a matrix
Dear List,
i know there are some solutions for this in the archive,
but they're not very good for numeric matrices, since they
usually convert rows/columns to character strings. Is there
an easy way to do $subject for numeric matrices properly,
or i need to do it by hand?
Thanks,
Gabor
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
2008 Jan 26
3
Which R version created a package?
Greetings, R-ians:
I would like to know which version or R was used to create a given package.
I think I remember seeing that topic discussed recently but cannot find it
among my notes. Can anyone tell me how to determine which version of R
created a package?
Thanks.
Charles Annis, P.E.
<mailto:Charles.Annis@StatisticalEngineering.com>
Charles.Annis@StatisticalEngineering.com
2008 Jan 17
3
vector generation
Dear Contributors:
I have the next vector:
"Z"
526
723
110
1110
34
778
614
249
14
I want to generate a vector containing the ratios of all the values
versus all the values of the z vector. I mean a vector containing the
values of 526/723, 526/110, and so on, 723/723, 723/110, and so on,
and so on.
Is this doable in a simple way??
Thanks in advance again,
Juan Pablo Fededa
2008 Mar 14
2
Selecting elements in vector
Hi
Consider the following code
> x <- rep(1:13, 13)
> y <- 1:3
I want to select all elements in x which are equal to 1, 2 or 3.
I know that I could use
> sel <- x==y[1] | x==y[2] | x==y[3]
> x[sel]
to obtain the values, but in my analysis, the y-vector is thousands of
elements long.
Is there any way, that I can do that easily?
Thanks
Rainer
--
Rainer M. Krug, Dipl.
2008 Feb 18
2
library(convert)
Hallo,
I am running R-2.6. on Windows. I have a code which uses
library(convert). Can anyone tell me which package I need to install to
run this code. Everytime I receive the error message library (convert)
not found.
Thanks, Corinna
2010 Jun 21
4
S3 generics need identical signature?
Dear all,
"Writing R Extensions" explicitly says that
A method must have all the arguments of the generic, including ...
if the generic does.
A method must have arguments in exactly the same order as the generic.
If the generic specifies defaults, all methods should use the same
defaults.
This is clear. R CMD check even checks for this.
But then how is it possible that
2008 Dec 26
2
question about SNA in R, thanks!
Dear colleagues,
I'm trying to have a look at the Assortative and Disassortative (
http://en.wikipedia.org/wiki/Assortative_mixing) of the network I have.
But it seems that the igraph hasn't mentioned that yet.
I have to get the in/out degree of the vertices of each edge and calculate
the Pearson's Correlation coefficient which seems to be quite a huge task
for me. :(
So I wonder if
2008 Jan 14
3
problems with .svg
Dear everybody!
I am making a graph in R and employ pstoedit to expot the .pdf-output
to .svg.
When I open the .svg with firefox I get the .svg-code shown wit the
following header:
"Mit dieser XML-Datei sind anscheinend keine Style-Informationen
verkn?pft. Nachfolgend wird die Baum-Ansicht des Dokuments angezeigt."
Which information should how be included?
Thank you in advance.
Yours,
2008 Mar 04
4
R-Terminal
Hi there!
I use an gnome-terminal for using R. When I resize the termial to the
maximum size, R uses only the left side of the window. Can I tell R to
use the whole window somehow?
Thanks,
Martin
--
Ihr Partner f?r Webdesign, Webapplikationen und Webspace.
http://www.roomandspace.com/
Martin Kaffanke +43 650 4514224
-------------- next part --------------
A non-text attachment was
2008 Jul 08
4
Can R do this ?
I have a folder full of pngs and jpgs, and would like to consolidate them into a pdf with appropriate title and labels. Can this be done via R ?
_________________________________________________________________
Easily publish your photos to your Spaces with Photo Gallery.
[[alternative HTML version deleted]]
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
2009 Sep 04
2
Running R on read-only file system, without temporary directory
Dear All,
I would like to do run R without having write permissions to any
directory on the system. It seems that I need to modify the R source
code for this, to make R start without creating a temporary directory.
So far, so good. But should I expect any more complications? Does R
really need the temporary directory that much?
Thanks,
Gabor
--
Gabor Csardi <Gabor.Csardi at unil.ch>