Displaying 20 results from an estimated 300 matches similar to: "Assigning labels to a list created with apply"
2006 Aug 08
2
Getting data out of a loop
A stupid question but I just cannot see how to do
this.
I have a loop that does some calculations and puts the
results in a vector for each iteration, but I cannot
see how to get the data out of the loop in such a way
that I can use it. I can print it but how do I get it
into a set of vectors or what ever.
Any help gratefully received. Thanks
Example
cata <- c( 3,5,6,8,0, NA)
catb <-
2006 Aug 28
2
Cannot get simple data.frame binding.
I am stuck on a simple problem where an example works
fine but the real one does not.
I have a data.frame where I wish to sum up some values
across the rows and create a new data.frame with some
of old data.frame variables and the new summed
variable.
It works fine in my simple example but I am doing
something wrong in the real world. In the real world
I am loading a labeled data.frame. The
2007 Feb 07
6
setting a number of values to NA over a data.frame.
This is probably a simple problem but I don't see a
solution.
I have a data.frame with a number of columns where I
would like 0 <- NA
thus I have df1[,144:157] <- NA if df1[, 144: 157] ==0
and df1[, 190:198] <- NA if df1[, 190:198] ==0
but I cannot figure out a way do this.
cata <- c( 1,1,6,1,1,NA)
catb <- c( 1,2,3,4,5,6)
doga <- c(3,5,3,6,4, 0)
dogb <- c(2,4,6,8,10,
2006 Aug 07
0
Trying to do aseries of subsets with function or for loop
I want to calculate the "scat" etc, values for each
level of id, output a vector of these values that is
a <- c(scat, sdog, srat, sbat ) and do an rbind on
them. Each level of id has a different value of
rate.
So far it it looks to me like I can do this by a
series of repeated subsets of Df butI would think that
I should be able to do this with a function but I am
not
having
2009 Sep 19
1
Re-order columns
Dear R'sians,
Would really appreciate if you could suggest a more efficient way to order
the columns of a dataset. The column names of the dataset contain indices
separated by a period. Following are examples of my code and the dataset.
oC <- function(tg=x2) {
lth <- length(grep("T",names(tg)))
thix <-
2011 Jan 13
0
Help with Data Transformation - RESOLVED
Hi Dennis,
SOLVED!!!
My thanks to both you, John, and others who chimed in. Took a little more digging before finally working, but it is working!
Here's a little more of what I did and the ultimate resolutions:
I installed the reshape2 library from CRAN.
Executed
> (.packages())
[1] "reshape2" "stats" "graphics" "grDevices"
2012 Mar 08
6
how to modify the tickment of x-axis
hi
I plot a series of observation data every minutes in a day as the
attachment below
plot(wnd,type='l',lty=1,col='red',lwd=1,xlab=xxlab,ylab=yylab,ylim=YY)
In the figure, the x-axis tickment is the number of data How can I change
it
fore example 1h 2h 3h 4h and so on ?
--
TANG Jie
Email: totangjie at gmail.com
Tel: 0086-2154896104
Shanghai Typhoon Institute,China
2007 Mar 09
1
Applying some equations over all unique combinations of 4 variables
#I have a data set that looks like this. A bit more
complicated actually with
# three factor levels but these calculations need to
be done on one factor at a
#I then have a set of different rates that are applied
#to it.
#dataset
cata <- c( 1,1,6,1,1,2)
catb <- c( 1,2,3,4,5,6)
doga <- c(3,5,3,6,4, 0)
data1 <- data.frame(cata, catb, doga)
rm(cata,catb,doga)
data1
# start rates
#
2006 Jul 01
1
Uh oh, Error solving...
undefined method `stringify_keys'' for [["Craved"], ["Whole Sale"]]:Array
I did this earler in the script how come now it''s yealling?
<% catas = Category.find(:all, :order=> "name").map {|u| [u.name]} -%>
<p><label for="item_cata">Catagory:</label><br/>
<%= select ''item'',
2011 May 29
22
[Bug 8177] New: Problems with big sparsed files
https://bugzilla.samba.org/show_bug.cgi?id=8177
Summary: Problems with big sparsed files
Product: rsync
Version: 3.0.8
Platform: x64
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P5
Component: core
AssignedTo: wayned at samba.org
ReportedBy: joluinfante at gmail.com
2007 Jun 28
3
Function call within a function.
I am trying to call a funtion within another function
and I clearly am misunderstanding what I should do.
Below is a simple example.
I know lstfun works on its own but I cannot seem to
figure out how to get it to work within ukn. Basically
I need to create the variable "nts". I have probably
missed something simple in the Intro or FAQ.
Any help would be much appreciated.
EXAMPLE
2013 Dec 15
1
Rows to Column
Hi all,
I'm kinda new in R programming and I need some help preparing a database to
run logistic regression.
I have data in a tuple form:
*id cat val*
1 A 2
1 C 4
3 B 1
5 A 2
6 A 3
6 B 5
6 C 2
8 B 5
8 D 2
9 D 3
and would like to have it like:
*id catA catB catC catD*
1 2 0 4 0
3 0 1 0 0
5 2 0 0 0
6 3
2012 Apr 12
3
Remove superscripts from HTML objects
Is there some way to remove superscripts from objects returned by
html/xmlParse (XML package)?
h <- "<html><p>Cat<sup>a</sup></p><p>Dog</p></html>"
doc <- htmlParse(h)
xpathSApply(doc, "//p", xmlValue)
[1] "Cata" "Dog"
I could probably remove the <sup> tags from the "h" object above,
2004 Jun 08
0
Routing - new table
Hello,
I have tested a simple thing in two version of Linux and there was a
problem when I have used fwmark as a selector for rule lookups. As you
can see below on the Slack, the <test> table doesn''t have any label
about fwmark. Is there an iproute problem?
--------------------------------------
# cat /etc/fedora-release
Fedora Core release 2 (Tettnang)
# uname -r
2.6.5-1.358
#
2009 Dec 22
0
Embed Fonts in All EPS files inside a Directory
Hi List, I would like to embed some fonts (AFM format) on 324 eps files
produced by a R loop, I’m able to do so one-by-one with the following
command:
embedFonts('C:/Users/Rodrigo/Documents/UFPR/Micropaleontologia/Potiguar/Cata
logo/Mapas/EPS/Example.eps',
outfile='C:/Users/Rodrigo/Documents/UFPR/Micropaleontologia/Potiguar/Catalog
o/Mapas/EPS/Example2.eps',
2024 Apr 17
0
Ayuda: Calculo tamaño del efecto
Necesito realizar un an?lisis del tama?o de muestra para un experimento con las siguientes caracter?sticas: 1) Una variable independiente intrasujeto es el tipo de queso con dos niveles, Queso A (1) y Queso B (2). 2) La otra variable independiente intrasujeto es la ronda de degustaci?n con tres niveles: ronda de degustaci?n a ciegas (1), ronda de degustaci?n de expectativas (2) y ronda de
2006 Aug 17
1
MAC to Windows 2003
Where do I find a version of Samba that will work on Windows 2003?
I would be happy to test a bata version of one was available.
I need to connect new MAC G5's to a Windows 2003 server for file sharing and
storage.
Thank you for your help.
Danny Martin
Instructional Designer
912-353-5277
2001 Jul 04
1
Ogg Vorbis ripping/encoding on Windows
I think the new web page is wonderful. However, one thing annoyed me.
Some programs on 'Other Software Which Supports Ogg Vorbis' page at
Vorbis.com seems to be bit problematic. As far as I know, at least two
of them have not updated their plug-ins for a while.
1. 'CD-DA X-Tractor' vorbenc-20001018.zip as 'Latest released version
of vorb_enc.dll'
2. 'Media
2007 Jun 02
7
u32 classifier
Hi folks...!!!
I´ve a problem that i did not solve it.
i want to limit the DOWNLOAD to my hosts (upstream traffic for the firewall)
using IMQ,
If i classify by PORT (source or destination) all seems to be fine,
but...BUT...if i want to restrict by IP addresss (internal IP address) i
can´t do it, because my hosts go to Internet toward the firewall using NAT,
so after NAT my IP address in
2005 Oct 11
5
openssh 4.2p1 bug
hello,
I have just installed openssh 4.2p1 and it seems that sshd child process
crash if /var/empty/usr/lib do not exist. Here is a strace log (
before creating this directory):
26787 open("/etc/protocols", O_RDONLY) = -1 ENOENT (No such file or
directory)
26787 getsockopt(3, SOL_IP, IP_OPTIONS, "", [0]) = 0
26787 socket(PF_UNIX, SOCK_STREAM, 0) = 6
26787 connect(6,