similar to: Indexing vector with repeated values

Displaying 20 results from an estimated 500 matches similar to: "Indexing vector with repeated values"

2007 Jul 30
3
Bind together two vectors of different length...
Dear everyone, I've got difficulties in realizing the following task: I have two vectors: A <- c(1:10) B<- seq(1,10,2) Now I want to make a table form vectors A and B as rows, and if a value of A isn't present B, then I want to put a N/A symbol in it: Output should look like this: 1 2 3 4 5 6 7 8 9 10 1 0 3 0 5 0 7 0 9 0 How can I do this in R? Thank you. -- Andris
2006 Mar 30
1
Question about for loop?
Hello useRs, I can't figure out how can I store a data frame of values of X and D from this loop: Z <- c(1:10) for (i in 1:(length(Z)-2)) {D <- x[1:(2+i)]; X <- paste("x",sep="",i) print (X) print (D) } Thank You, Andris Jankevics
2007 Apr 16
1
Greek symbols in xtable rows
Dear R-helpers, I am using xtable package to prepare a Latex code of some R tables. Is this possible to have a greek symbols in xtable cells? How can I get for example a string of : $\Delta$ > "$\Delta$" [1] "$Delta$" And string: > "$\\Delta$" [1] "$\\Delta$" Gives a latex aoutput like: \$$\backslash$Delta\$ Thank You in advance Andris
2009 Sep 03
0
R: "biplot" graphical options?
Thanks Andris, Michael and Petr for your prompt and kind feedbacks. I will try generating my own biplot from low-level graph commands... I hope it will work. Best regards, Marco -- Marco Manca, MD University of Maastricht Faculty of Health, Medicine and Life Sciences (FHML) Cardiovascular Research Institute (CARIM) PO Box 616 6200 MD Maastricht E-mail: m.manca at path.unimaas.nl Office
2007 Mar 23
5
Get "home" directory and simple I/O
Is there any generic function that gets the "home" directory? This should return /home/<user> in Linux and x:/Documents and Settings/<user> (or whatever) in Windows XP. Another (unrelated) question: what is the _simplest_ way to read and write R variables to/from files such that they are stored in a human-readable but R-like form? For example, if (say), x is a vector
2007 Aug 31
2
memory.size help
I keep getting the 'memory.size' error message when I run a program I have been writing. It always it cannot allocate a vector of a certain size. I believe the error comes in the code fragement below where I have multiple arrays that could be taking up space. Does anyone know a good way around this? w1 <- outer(xk$xk1, data[,x1], function(y,z) abs(z-y)) w2 <- outer(xk$xk2,
2007 Feb 19
3
Start and Restart R over SSH
Hi, I have some big calculations in R to be done. Since I can use R on a server with ssh, i was wondering if I can reopen a R Shell after exiting ssh. I don't want to use the batch mode and nohup doesn't work. I want to use something like ssh user at server R ---do something in R and start calculation --- close ssh but let R remain on the server, doing the calculation ssh user at
2007 Jan 31
0
Interactive plots with R
Hi, I wrote some simple rpanel package script for visual spectral data comparison. At this example i have a three samples and i want to zoom through x and y axis to compare differences between samples. With my script below I can zoom to some data region and add some other spetra to the plot, through text input field. But I can't figure out, how to change axis scaling for all displayed
2011 Dec 12
3
For loop indicies
I would like to run a for loop with an index going from 0 to 499 but the following seems to miss out the first value: C <- 499 for (i in 0:C) The alternative is: C <- 500 for (i in 1:C) { #Then every time I use i, I replace it with i-1 } Is this a good way to do it or is tere a better way? Thank you, ThomasThis message and any attachment are intended solely for the addressee and may
2006 Jul 31
4
question about dataframe ("sensory") in PLS package
Dear all, I am trying to my dataframe for the PLS analysis using the PLS package. However I have some trouble generating the correct dataframe. The main problem is how to use one name to represent several columns in the dataframe. The example dataframe in PLS package is called "sensory". I cannot directly read the data file since it's a binary file. If I use
2008 Mar 06
2
Clustering large data matrix
Hello, I have a large data matrix (68x13112), each row corresponding to one observation (patients) and each column corresponding to the variables (points within an NMR spectrum). I would like to carry out some kind of clustering on these data to see how many clusters are there. I have tried the function clara() from the package cluster. If I use the matrix as is, I can perform the clara
2007 Oct 16
1
data structure for plsr
All, I am working with NIR spectral data and it was great to find that the example in ?plsr also used spectral data. Unfortunately, I am having difficulty figuring out how the "yarn" dataset is structured to allow for the plsr model to read: library(pls) data(yard) yarn.oscorespls <- mvr(density ~ NIR, 6, data = yarn, validation = "CV", method = "oscorespls")
2003 Jul 27
1
wi AP + acx100 client don't work
Hi! I have PC running FreeBSD 4.8-STABLE and installed Z-COM XI-626 PCI (Prism 2.5). When I try to directly connect notebook (running WinXP) with acx100 chip based card to FreeBSD I can't connect. I try connect running wi in AP and Ad-Hoc modes. NOP. Cards can see each other but can't connect. :( I is possible to connect these cards? Thanks. Andris
2003 Aug 11
1
FW: module_register
Hello! I have the same problem, whats up? Andris > -----Original Message----- > From: owner-freebsd-stable@freebsd.org > [mailto:owner-freebsd-stable@freebsd.org] On Behalf Of Dmitry Agafonov > Sent: Friday, July 25, 2003 8:40 PM > To: freebsd-stable@freebsd.org > Subject: module_register > > > Hello! > > After today's update (4.8-stable from cvs
2003 Aug 14
1
FW: Kernel
Doug, I remove ed config from rc.conf and system boots up without any error messages. When I try to config interface manually (ifconfig ed0 ***) then I saw it again. Is it ifconfig problem? Andris > Hm, well you were right, the ed and miibus drivers are compiled in. > > For giggles you might try removing any ifconfig_* lines in rc.conf, > booting, then running 'ifconfig -l'.
2003 Sep 09
1
Can't load daemon at boot
Hi! I have a programm with code like this (this is example, the real code is at http://fresh.t-systems-sfr.com/linux/src/.warix/logserial-0.4.2.tar.gz.html): #################### void shutdown(int sig) { switch (sig) { default: fprintf(stderr, "Got signal %d. Exit\n", sig); break; } exit(EXIT_SUCCESS); } int main(void) { chproc = fork(); if
2007 Nov 27
1
Fwd: dovecot bug report (64 bit file offsets)
I have found similar problem: http://www.dovecot.org/list/dovecot/2007-January/018623.html "After configure remove HAVE_PREAD from config.h, recompile and see if it works." I think I figured out where might be the problem. If the binary is compiled in the 64bit environment and you want to use 64 bit file offset you must use 64 bit equivalents of the function. Of course if you are
2009 Apr 22
2
Exporting objects plotted with plot3d() - rgl package
Dear all, Can anybody tell me how to export a 3d figure made with the plot3d function? I'm careless about whether it's still interactive or not in another format, as long I can get it out of R. Thanks! Alejandro Gonz?lez Departamento de Biodiversidad y Conservaci?n Real Jard?n Bot?nico Consejo Superior de Investigaciones Cient?ficas Claudio Moyano, 1 28014 Madrid, Spain Tel +0034
2010 Aug 12
5
how to eliminate an element of a list
Hi, I want to eliminate an element of a list: list <- seq(1,5,1) s <- sample(list,1) lets say s=3 Now I want to remove 3 from the list: list2 = {1,2,4,5} Can someone give me a tip? Thanks, André [[alternative HTML version deleted]]
2006 Dec 08
0
Re : A smal fitting problem...
May be you are also not familiar with statistic. the solution of min \sum_{i=1}^{n} (y_{i}-b)^{2} is the mean. So the solution is b<-mean(y) Justin BEM Elève Ingénieur Statisticien Economiste BP 294 Yaoundé. Tél (00237)9597295. ----- Message d'origine ---- De : Kåre Edvardsen <ked@nilu.no> À : R-help <r-help@stat.math.ethz.ch> Envoyé le : Vendredi, 8 Décembre 2006,