similar to: better way to replace missing values with zero

Displaying 20 results from an estimated 40000 matches similar to: "better way to replace missing values with zero"

2006 Nov 07
1
Better way to create tables of mean & standard deviations
Hi I'm trying to create tables of means, standard deviations and numbers of observations (i) for each laboratory (ii) for each batch number (iii) for each batch at each laboratory for the attached data. I created these functions: summary.aggregate <- function(y, label, ...) { temp.mean <- aggregate(y, FUN=mean, ...) temp.sd <- aggregate(y, FUN=sd, ...) temp.length <-
2006 Oct 26
2
Newbie: Better way to do compound conditionals in subset?
There must be a better way to select the rows after 22-Apr-2004 and before 01-Sep-2004 with a temperature below 65 than this: > before2sw1 <- subset(energy.data, as.Date(start, format="%d-%b-%y") < as.Date("01-Sep-04", format = "%d-%b-%y")) > before2sw2 <- subset(before2sw1, as.Date(start, format="%d-%b-%y") >=
2006 Oct 03
4
how ot replace the diagonal of a matrix
Dear useRs, Trying to replace the diagonal of a matrix is not working for me. I want a matrix with .6 on the diag and .4 elsewhere. The following code looks like it should work--when I lookk at mps and idx they look how I want them too--but it only replaces the first element, not each element on the diagonal. mps <- matrix(rep(.4, 3*3), nrow=n, byrow=TRUE) idx <- diag(3) mps idx mps[idx]
2005 Mar 15
2
missing sh.exe file when running "R CMD INSTALL test"
I am trying to learn how to make a simple package that contains no C or Fortran code. I used package.skeleton(...) to make a package called "test". The directory and files look good. I downloaded and installed Rtools (www.murdoch-sutherland.com/Rtools/tools.zip). I added the path and from the dos prompt I can verify that make.exe and sh.exe both exist, but when I try to run "R
2005 Aug 11
8
Newbie Question: Building an Asterisk system to replace an old PBX but using existing phone
I have a brief from a local hotel to build a PBX using Asterisk but they want to use their exisiting telephones and wiring from an old PBX that no longer works. Basically, I can build the system but an looking for a card that will allow for upto 20 extensions to be wired into the back of the PC. Doeas anyone know of a solution to this Sean-- ICQ: 679813 FidoNet: 2:263/950 Jabber:
2007 Jul 19
3
help with heatmap - how to remove annoying "X" before numeric values?
Hello All, I have a simple question based on how things are labeled on my heat map; particularly, there is this annoying "X" that appears before the numeric value of all the labels of my columns. Let's say I have the following silly data, stored in "temp.txt" 1905 1910 1950 1992 2011 2020 Gnat 0.08 0.29 0.29 0.37 0.39 0.43 Snake
2009 Feb 25
1
Computing sd across an array with missing values
Dear help, suppose I have this array and want to compute sd aross rows and columns. p <- array(c(1:5, rep(NA, times = 3)), dim = c(5, 5, 3)) apply(p, 1:2, sd) fails because sd requires at least 2 numbers to compute sd apply(p, 1:2, sd, na.rm = TRUE) fails for the same reason I crafted my own function that does what I want sd_fun <- function(i){ if(sum(!is.na(i))==0){ temp.sd <- NA
2006 Feb 16
2
getting probabilities from SVM
I am using SVM to classify categorical data and I would like the probabilities instead of the classification. ?predict.svm says that its only enabled when you train the model with it enabled, so I did that, but it didn't work. I can't even get it to work with iris. The help file shows that probability = TRUE when training the model, but doesn't show an example. Then I try to
2010 Mar 22
1
Accessing data in groups created with split() and other beginner questions
Hi, very new to R here... I have a data frame called 'set' with 100k+ rows in it that looks like this: subject timestamp yvalue traceabs subjtrace 1 1 1992-07-12 06:05:00 12 1 1-1 2 1 1992-07-12 06:10:00 15 1 1-1 3 1 1992-07-12 06:15:00 17 1 1-1 4 1 1992-07-12 06:20:00 20 1 1-1 5
2009 Jun 04
3
Getting a column of values from a list - think I'm doing it the hard way
Example code it shown below. I think I am doing this the hard way. I'm just trying to get the full year value from an array of dates. An example array is shown below. Right now, I'm using a "for" loop to pull the year out of a list where the dates were split up into their individual components. This seems to work, but just wondering if there is an easier way. Thanks for
2018 Nov 15
4
How to concatenate Ogg in the browser JS?
Thank you, ogginfo returned: ----- Note: Stream 1 has serial number 0, which is legal but may cause problems with some tools. New logical stream (#1, serial: 00000000): type vorbis Vorbis headers parsed for stream 1, information follows... Version: 0 Vendor: ffmpeg Channels: 1 Rate: 22050 Nominal bitrate: 35.333000 kb/s Upper bitrate not set Lower bitrate not set Vorbis stream 1: Total data
2014 Nov 09
1
inbox parameter is ignored within location config for public namespaces?
Hello, i already asked a similiar question some month ago but still have no fix for my problem :-( This is my global location option in 10-mail.conf: mail_location = maildir:/home/vmail/%d/%n/MAILDIR:INBOX=/home/vmail/%d/%n/MAILDIR/.INBOX:INDEX=/home/vmail/%d/%n/INDEX/ This works fine, until i'm using a public namespace. The following namespace is a normal user too, every mail to bos at
2003 Apr 08
2
OpenSSH compilation in AIX
[Note: CC to openssh-unix-dev added] "Ph. Marek" wrote: > I found you mail > http://marc.theaimsgroup.com/?l=openssh-unix-dev&m=104970105603800&w=2 > where you claim that you've compiled openssh in AIX. That is correct, AIX 4.2.1, 4.3.3 and 5.1. > Not my situation is as follows: > openssh-3.6.1p1 > AIX 4.2 > gcc >
2009 Sep 22
1
any way to make it work faster (deleting rows that contain certain values)
Hello, dear R'ers, index<-expand.grid(1:7,1:4,1:4,1:4,1:4,1:4,1:4,1:4,1:4,1:4,1:4) In this case, dim(index) is 7,340,032 (!) and 11. I realize it's huge. Then, I am trying to get rid of the undesired combinations of columns. They should not contain identical values in any 2 columns. Also if column 1 has a value of 5, there should be no 2 in any other column, if column 1 has a value
2007 Nov 12
2
Query an Access database based on a date attribute
Dear useRs, I would like to query an Access database through R based on a date attribute but, unfortunately, I fail to do so. For example, the table test_table of the test.mdb looks like: ID cd market competitor dd price 1 1 2007-11-20 atl-bos delta 2007-11-20 210 2 2 2007-11-20 atl-bos delta 2007-11-21 190 3 3 2007-11-20 atl-bos delta 2007-11-22
2005 Aug 11
2
Newbie Question: Building an Asterisk systemto replace an old PBX but using existing phone
Yeah....I think that every install I have done the first thing that happens is "why is there a delay before the call connects?" and the answer is "you have to hit dial or wait 10 seconds". -Jonathan -----Original Message----- From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Tom Rymes Sent: Thursday, August 11, 2005
2008 Mar 07
1
Finding Interaction and main effects contrasts for two-way ANOVA
I've tried without success to calculate interaction and main effects contrasts using R. I've found the functions C(), contrasts(), se.contrasts() and fit.contrasts() in package gmodels. Given the url for a small dataset and the two-way anova model below, I'd like to reproduce the results from appended SAS code. Thanks. --Dale. ## the dataset (from Montgomery) twoway <-
2011 Feb 17
1
missing values in party::ctree
After ctree builds a tree, how would I determine the direction missing values follow by examining the BinaryTree-class object? For instance in the example below Bare.nuclei has 16 missing values and is used for the first split, but the missing values are not listed in either set of factors. (I have the same question for missing values among numeric [non-factor] values, but I assume the answer
2002 Feb 22
5
[Bug 124] Terminal hangs when data is streaming to it...
http://bugzilla.mindrot.org/show_bug.cgi?id=124 ------- Additional Comments From markus at openbsd.org 2002-02-23 06:10 ------- what does "streaming" mean? what does "output reports" mean? do you have more detailed reports? do you have debugging output? what clients are involved? what servers? does the same happen with openssh 3.0.2? does the same happen with a recent
2010 Feb 23
1
dirty hack to solve: 0509-150 Dependent module libcrypto.a(libcrypto.so.0.9.7) could not be loaded
Hi all, I build openssh for aix with a dirty hack. This is my configure: export CC=cc export CFLAGS="-I/usr/local/include" export LDFLAGS="-L/opt/freeware/lib/ -L/usr/local/lib" export CPP="cc -E" ./configure --prefix=/usr/local --sysconfdir=/usr/local/etc/ssh \ --with-cflags="-O -D__STR31__