similar to: [Fwd: Re: How to apply functions over rows of multiple matrices]

Displaying 20 results from an estimated 100 matches similar to: "[Fwd: Re: How to apply functions over rows of multiple matrices]"

2007 Aug 09
1
How to apply functions over rows of multiple matrices
Dear ExpRts, I would like to perform a function with two arguments over the rows of two matrices. There are a couple of *applys (including mApply in Hmisc) but I haven't found out how to do it straightforward. Applying to row indices works, but looks like a poor hack to me: sens <- function(test, gold) { if (any(gold==1)) { sum(test[which(gold==1)]/sum(which(gold==1))) } else NA }
2007 Aug 11
0
DOE and interaction plot general question
This is a general question about Design of experiments. If i am not allowed to post general questions like this here please accept my apologies and ignore the question. I did a DOE with six factors in eight runs. I know i cannot check for interactions using this design, but i tried the interaction plot and it showed me many interactions. After this I foldover the design and ran the 8 runs to learn
2009 Dec 01
2
Cut intervals (character) to numeric midpoint; regex problem
Starting with the head of a 499 element matrix whose column names are now the labels trom a cut() operation, I needed to get to a vector of midpoints to serve as the basis for plotting a calibration curve ( exp(linear predictor) vs. : > dput(head(dimnames(mtcal)[2][[1]])) # was starting point testvec <- c("(-8.616,-3.084]", "(-3.084,-2.876]",
2006 Jan 10
1
Find last row (observation) for each combination of variables
Let's say I have a data.frame like A B C TS other columns 1 1 1 12345 1 1 1 56789 1 2 1 23456 1 2 2 23457 2 4 7 23458 2 4 7 34567 2 4 7 45678 and I want the last row for each unique combination of A/B/C, where by "last" I mean greatest TS. A B C TS other columns 1 1 1 56789 1 2 1 23456 1 2 2 23457 2 4 7 45678 I did this simply in SAS: proc sort data=DF; by A B C descending TS
2009 Jul 20
2
HELP: BRUGS/WinBUGS/RBUGS Response is a combination of random variables
Hi, Is there anyone know if BUGS language allows the combination of variables as response such as Y[i] <- a*X1[i]+b*X2[i] Y[i] ~ dnorm(c,d) It seems doesn't work in my model. The problem is between two ######. The error message is > modelCheck("BayesBioMarker.BUGS") model is syntactically correct > modelData(paste("BUGS_data.txt",sep="")) data
2011 Jun 01
1
Function to save plots
Hello, I'm using ROCR to plot ROC Curves and I want to automate the saving of plots into PNG files using a custom function. My data frames are named like test1, test2, test3. Each data frame has three variables: method1, method2, goldstandard. Right now, for each plot I have to run: png('test1_method1.png') plot(performance(prediction(test1$method1, test1$goldstandard),
2005 Jan 31
2
coercing a list to a data frame, lists in foreloops
I have a set of time-series climate data with missing entries. I need to add rows for these missing entries to this data set. The only way I know to do this is unsing a foreloop, but this won't work on a list. I've tried to convert the list to a data frame, but that won't happen, either. I want to fill rows in this table: > newtest[10:15,] yrmos yearmo snow.sum snow.mean
2005 May 22
3
comparison operator, decimals, and signif()
Hi, I recently spent quite a bit of time trouble shooting a function that I had written only to discover that the problem I was having was with the comparison operator. I assumed that the following would return TRUE: > testMean <- 82.8 + 0.1 > testMean [1] 82.9 > testMean == 82.9 [1] FALSE Apparently this has to do with deciml places. Look: > newTest <- 82.0 > newTest [1]
2008 Sep 26
1
auto.arima help
I am calling auto.arima with a time series that is about 186 observations long with a frequency of 52. With some time series I get: 1:last.nonzero: result would be too long a vector Is there something that I can do to the data to avoid this error? Thank you. Kevin
2014 Feb 11
2
$new cannot be accessed when running from Rscript and methods package is not loaded
Hi Accesses the $new method for a class defined in a package fails if the methods package is not loaded. I have created a test package with the following single code file: newTest <- function() { cl <- get("someClass") cl$new } someClass <- setRefClass("someClass") (This is similar to code actually used in the testthat package.) If methods is not loaded,
2004 Apr 23
3
MP3 encoding of Monitor files
I have having problems trying to take a file recorded with Monitor and convert it to MP3. When I use 'play' to play the .wav file, it sounds fine. After bladenc'ing it, it plays at lightening speed, and the voices are all high pitch. I tried using sox to resample to 32000 before encoding, but that didnt work either. Do any of you convert your .wav files to mp3? Monitor call:
2019 Jun 25
2
Emails not visible after renaming folders
Hello, I have strange problem with "losing" emails after rename mail folder(s) (via imap client: thunderbird, roundcude, etc..) How to reproduce: 1. Create some folder name, like TEST 2. Create sub-folder under TEST (like SUBTEST) Structure: TEST |--SUBTEST # doveadm mailbox list -u postmaster at testmailbox Spam Trash Sent Drafts INBOX TEST TEST/SUBTEST 3. Move (or copy)
2019 Jun 26
2
Emails not visible after renaming folders
Copying or moving with email client: thunderbird, roundcube (webmail), mutt or any other email client via imap protocol. 25.06.2019 22:10, Germ?n Herrera ?????: > Are you copying/moving the emails with {cp|mv} or with "doveadm {copy|move}"? > > On 2019-06-25 12:00, Aleksandr via dovecot wrote: >> Hello, >> >> I have strange problem with "losing"
2006 Jul 13
1
Issue with Web Service
I have the following: File: subscription_api.rb class SubscriptionApi < ActionWebService::API::Base api_method :newTest, :returns => [ [[:string]] ] end File: subscription_controller.rb class SubscriptionController < ApplicationController wsdl_service_name ''Subscription'' web_service_scaffold :invoke def newTest() return [
2009 Apr 05
1
problem with lattice tiff or bitmap: character size and color
Hi all, I am trying to make tiff files of lattice plots at a resolution greater than 300 dpi required by a journal (PLoS ONE). I have tried both the tiff and bitmap functions. tiff keeps panel colors but reduces axes and tick labels so they are nearly invisible. bitmap maintains correct label size but only produces greyscale. Regular plots work fine with tiff; the problem is only with lattice
2008 Sep 06
3
how to address last and all but last column in dataframe
Dear R-colleagues, another question from a newbie: I am creating a lot of simple pivot-charts from my raw data using the reshape-package. In these charts we have medical doctors judging videos in the columns and the videos they judge in the rows. Simple example of chart/data.frame "input" with two categories 1/0: video 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 1 0 0
2010 Nov 29
1
selecting only corresponding categories from a confusion matrix
Dear R colleagues, as a result of my calculations regarding the inter-observer-variability in bronchoscopy, I get a confusion matrix like the following: 0 1 1001 1010 11 0 609 11 54 36 6 1 1 2 6 0 2 10 14 0 0 8 4 100 4 0 0 0 0 1000 23 7 12 10 5 1001 0 0 4 0 0 1010 4 0 0 3 0 1011 1 0 1 0 2 11
2010 Oct 06
3
Assigning value to a vector from within a function
Hi all, I am having trouble assigning a value within a vector using a variable defined within a function. I suspect this has something to do with namespaces but I cannot figure it out. Please reply directly to me if you can help. ###begin code #simple vector test<-c(4,5,6) #simple function to get a value from a vector #works just like I would expect, has no problem indexing using the local
2004 Jun 15
1
Cant create in a subdirectory...
I've battled this one for a few days now and its costing my sanity so I am hoping that someone here has an answer I am running the samba server 3.0.4 on a linux 2.4.25 server. I can connect to my share point and authenticate fine I can create files or directories in the root of the sharepoint fine I can go into subdirectories and look at all the files... But I cannot create in any
2010 Sep 20
3
Depletion of small p values upon iterative testing of identical normal distributions
Dear all, I'm performing a t-test on two normal distributions with identical mean & standard deviation, and repeating this tests a very large number of times to describe an representative p value distribution in a null case. As a part of this, the program bins these values in 10 evenly distributed bins between 0 and 1 and reports the number of observations in each bin. What I have noticed