similar to: Question about for loop?

Displaying 20 results from an estimated 40000 matches similar to: "Question about for loop?"

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 May 26
1
Indexing vector with repeated values
Hi all, I have a vector which contains many repeated values. >Z <- c(1,2,3,4,5,1,2,3,4,5,1,2,3,5,5,2,3,4,5) I need to know how many times each number in this vecetor is repeated. I can use a command like this: > table (cut(Z,seq(1,5,1))) (1,2] (2,3] (3,4] (4,5] 4 4 3 5 But how can I find a break points for vector with random values and random number sequence
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 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
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
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
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,
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
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
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
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 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
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 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")
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
2009 Apr 27
3
Formatting numbers
I've been trough the R documentation for about half an hour and it's not clear to me how to do this: I need to format to character a series of integers from 1 to 1000, and I like them to look like "0001" "0002", "0059", "0123" and so on. Padded with zeroes to have four digits. Cheers! Mario. r-help-request at r-project.org wrote: > Send
2015 Apr 26
1
CRAN submit page down
On 26.04.2015 13:23, William Revelle wrote: > This still seems to be the case. > > I tried uploading the most recent version of psych and got as far as the Step 3 page which says that it has sent out an email. > However, although normally this step takes agout 1 minute, nothing has happened for 16 hours. > > Should we just use the old system of uploading to the ftp site and
2017 Jan 18
3
unlicense
Unfortunately, our lawyers say that they can't give legal advice in this context. My question would be, what are people looking for that the MIT or 2-clause BSD license don't provide? They're short, clear, widely accepted and very permissive. Another possibility might be to dual-license packages with both an OSI-approved license and whatever-else-you-like, e.g. 'MIT |