similar to: data manipulation in R

Displaying 20 results from an estimated 1000 matches similar to: "data manipulation in R"

2008 Mar 27
1
functions
I wrote some functions for multiway CANDECOMP, i.e. for least squares fitting of a_{i_1\cdots i_m}\approx\sum_{s=1}^p x^1_{i_1s}x^1_{i_1s}\cdots x^m_{i_ms} with arrays of arbitrary dimension. Reminded me of the good old APL days. I could not find this in the archives, but if it's already there, I would appreciate if someone let me know.
2007 May 17
1
use loop or use apply?
Hi, I have two matrices, A (axd) and B (bxd). I want to get another matrix C (axb) such that, C[i,j] is the Euclidean distance between the ith row of A and jth row of B. In general, I can say that C[i,j] = some.function (A[i,], B[j,]). What is the best method for doing so? (assume a < b) I have been doing some exploration myself: Consider the following function: get.f, in which,
2003 Nov 16
1
SE of ANOVA (aov) with repeated measures and a bewtween-subject factor
Hallo! I have data of the following design: NSubj were measured at Baseline (visit 1) and at 3 following time points (visit 2, visit 3, visit 4). There is or is not a treatment. Most interesting is the question if there is a difference in treatment between the results of visit 4 and baseline. (The other time points are also of interest.) The level of significance is alpha=0.0179 (because of an
2013 Feb 01
29
cumulative sum by group and under some criteria
Thank you very much for your reply. Your code work well with this example. I modified a little to fit my real data, I got an error massage. Error in split.default(x = seq_len(nrow(x)), f = f, drop = drop, ...) : Group length is 0 but data length > 0 On Thu, Jan 31, 2013 at 12:21 PM, arun kirshna [via R] < ml-node+s789695n4657196h87@n4.nabble.com> wrote: > Hi, > Try this: >
2010 Jul 06
1
Set the resolution to 1000x70
It would not let me alter the resolution in winecf, under the graphics tab. It only let me delete one number from it, so it is around 1024x70 now. Where do i go to set it using text editing? I cannot use the winecf, because that window is too small now(accidentally hit OK).
2008 Nov 26
1
multiple imputation with fit.mult.impute in Hmisc - how to replace NA with imputed value?
I am doing multiple imputation with Hmisc, and can't figure out how to replace the NA values with the imputed values. Here's a general ourline of the process: > set.seed(23) > library("mice") > library("Hmisc") > library("Design") > d <- read.table("DailyDataRaw_01.txt",header=T) > length(d);length(d[,1]) [1] 43 [1] 2666
2009 Aug 06
2
duplicate model object with associations ?
class Patient < AR::Base has_many :aaas has_many :bbbs ,:through=>:aaas end class Aaa < AR::Base has_many :bbbs end ------- i want like this @patient=Patient.find(id) @new_patient=@patient.duplicate now the @new_patient should have their own copy of patient,aaas,bbbs (new records in corresponding tables) there is one options is that we can create seperate object for each
2013 Apr 16
1
Path Diagram
Hi All, Apologies if this has been answered somewhere else, but I have been searching for an answer all day and not been able to find one. I am trying to plot a path diagram for a CFA I have run, I have installed Rgraphviz and run the following: pathDiagram(cfa, min.rank='item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12', max.rank='SMP,
2012 Feb 05
4
nested if else statements
I have a vector of 2,1,0 I want to change to 0,1,2 respectively (the data is allele dosages) I have tried multiple nested if/else statements and looked at the ?if help and cannot work out what is wrong, other people have posted code which is identical and they state works. Any help would be greatly appreciated. > A[1:20] [1] 1 1 0 0 1 0 1 0 1 0 0 0 1 1 0 1 1 1 0 0 > B <-
2006 Mar 10
9
Observers?
Hello all! I''m having an issue with Observers, and I''m hoping someone knows the answer. Here is the definition: app/models/vehicle_observer.rb > class VehicleObserver < ActiveRecord::Observer > def after_save(vehicle) > breakpoint > if vehicle.has_new_mil_indication? > UserMailer.deliver_mil_notice(vehicle) > end > end > end
2010 May 25
1
Assigning NA to a rows of a dataframe/datamatrix
Dear R-users,  I have a problem, I have the following dataframe:   d<-data.frame(  'y1'=c(1,2,1,2,1,NA,NA), 'y2'=c(1,2,1,1,1,2,1), 'y3'=c(1,NA,1,NA,NA,2,1), 'y4'=c(NA,2,NA,1,1,2,NA), 'a'=c(1,1,1,1,1,1,2) ) where the last variable counts the number of missing values in a row. Now, i want to set rows where a>1 to NA and arrive at something like the
2018 Mar 11
2
Empirical density estimation
But for my reporting purpose, I need to generate a bell curve like plot based on empirical PDF, that also contains original points. Any idea would be helpful. Thanks, On Mon, Mar 12, 2018 at 3:49 AM, Bert Gunter <bgunter.4567 at gmail.com> wrote: > You need to re-read ?density and perhaps think again -- or do some study -- > about how a (kernel) density estimate works. The points at
2008 Jul 10
2
Lattice: merged strips?
Hi all, By default a call to xyplot from the Lattice package when using 2 factors [eg xyplot( dv~iv | XY * AB ) ] yields the following shingle structure: |_A_|_A_|_B_|_B_| |_X_|_Y_|_X_|_Y_| However, I'm wondering if it is possible to merge the upper shingle within levels of that factor, as in: |___A___|___B___| |_X_|_Y_|_X_|_Y_| Mike -- Mike Lawrence Graduate Student, Department of
2009 Nov 26
15
bad move? - complex form with *many* observe_field's
I have a pretty complex form with many text fields and a number of selects. We let the user add multiple types of associated objects to the parent object and to edit the values for those associated objs, so the form can have something like the following number of fields on the page: 9 text fields + 3 selects + a*(1 text + 1 select) + b*(1 text + 1 select) + c*(1 text + 1 select) + d*(1 text +
2006 Mar 04
2
Declaring ActiveRecord observers
Hello I''m using the ''act_as_authenticated'' plugin to implement a small and simple authentication system in my app. Everything is working just fine and the world is a better place to live in. The plugin creates a ActiveRecord observer in order to send the newly registered user a confirmation e-mail. Per the API docs [1], one should declare the observer in the
2006 Jul 18
7
Observer not working
Help please. I''m trying to observe a User class, but I can''t get this to work, the after_create method never gets called... (the breakpoint never gets called) app/models/user_observer.rb: class UserObserver < ActiveRecord::Observer def after_create(user) breakpoint setting =
2005 Aug 18
8
Extending a js class
It''s been a few days since I posted my last two emails (of which, no one replied to) so I''ve gone ahead and coded a working slider class as well as a ''resizeable'' class that allows a user to drag and resize the element. I also linked these two together as I want to have slider behavior that can resize the resizeable element. The end result is both the
2005 Dec 07
3
ActiveRecord::Observer problem
Hi all, I have a problem with an observer. I have a simple observer... class ActivityObserver < ActiveRecord::Observer observe Customer def after_create(model) bind_params(model) @al.action = "create" @al.save logger "#{model.id} : created" end private def bind_params(model) @al = ActivityLog.new @al.user_id = User.current.id
2018 Mar 11
0
Empirical density estimation
On 3/11/2018 3:35 PM, Christofer Bogaso wrote: > But for my reporting purpose, I need to generate a bell curve like > plot based on empirical PDF, that also contains original points. > > Any idea would be helpful. Thanks, > Christofer, something like the following may get you what you want: ## get the kernel density estimate dens <- density(Dat) ## estimate the density at
2000 Jan 09
0
AW: Scanner for mail
----- Forwarded message from [Harald Kie_ling] ----- [Charset iso-8859-1 unsupported, filtering to ASCII...] Scanner for mail There are two possible mechanisms to protect email-users over a mail server from a virus : _ Hook into mail server and scanning the email Nearly 90% gave me the advise to take AMAVIS and scan the mail with some scanner. _ Hook into the smpt-protocol like a fire-wall Two