Displaying 20 results from an estimated 900 matches similar to: "data manipulation"
2018 May 24
4
Manipulation of data.frame into an array
Hello everyone,
I want to transform a data.frame into an array (lets call it mydata), where: mydata[[1]] is the first imputed dataset...and for each mydata[[d]], the first p columns are covariates X, and the last one is the outcome Y.
Lets assume a simple data.frame:
Imputed = data.frame( X1 = c(1,2,1,2,1,2,1,2, 1,2,1,2,1,2,1,2),
X2 =
2018 May 24
0
Manipulation of data.frame into an array
This is one of those instances where a less superficial knowledge of R's
technical details comes in really handy.
What you need to do is convert the data frame to a single (numeric) vector
for, e.g. a matrix() call. This can be easily done by noting that a data
frame is also a list and using do.call():
## imp is the data frame:
do.call(c,imp)
X11 X12 X13 X14 X15 X16 X17 X18 X19
2013 Apr 05
1
Accessing examplars in apcluster (apcluster package)
Hi,
I was wondering how it was possible to access the actual cluster exemplars
from the APResult class. Currently it only spits it out onto the terminal
if you type the object but there is no other way to see which one is the
examplar.
Would appreciate any help.
Thanks,
Sachin
[[alternative HTML version deleted]]
2013 Apr 12
2
model frame and formula mismatch in model.matrix()
Hello everyone,
I am trying to fit the following model
All X. variables are continuous, while the conditions are categoricals.
model <- lm(X2
2018 May 24
2
Manipulation of data.frame into an array
Hello everyone,
Thank you for this. Nonetheless it is not exactly want i need.
I need mydata[[1]] to provide the values for all 3 variables (Y, X1 and X2) of the first imputation only. As it stands it returns the whole database.
Any ideas?
Best,
ioanna
________________________________
From: Bert Gunter <bgunter.4567 at gmail.com>
Sent: 24 May 2018 16:04
To: Ioanna Ioannou
Cc:
2009 Jun 24
2
change the height or scale of the y axis
Hallo, All,
I have a question about changing the height or scale of the y axis. When I
use following two R codes, I can get two plots. Please look at the y axes,
the number of indices (x1, x2, ?) on the y axis in the first plot is smaller
than that in the second plot, and hence the space between any two indices in
the first plot is wider than that in the second plot. As the number of
indices
2012 May 25
2
Query about creating time sequences
Hi All,
I have a query about time based sequences. I know such questions have been
asked a lot on forums, but I couldnt find the exact thing that I was
looking for.
I want to create a time-based sequence which will mimic the trading window
AND would span multiple days. Something like below:
"2011-01-03 09:15:00 IST"
"2011-01-03 09:15:01 IST"
....
....
....
"2011-01-03
2012 Aug 08
1
basehaz() in package 'Survival' and warnings() with coxph
Hello,
I have a couple of questions with regards to fitting a coxph model to a data
set in R:
I have a very large dataset and wanted to get the baseline hazard using the
basehaz() function in the package : 'survival'.
If I use all the covariates then the output from basehaz(fit), where fit is
a model fit using coxph(), gives 507 unique values for the time and the
corresponding cumulative
2012 Aug 09
1
basehaz() in package survival and warnings with coxph
I've never seen this, and have no idea how to reproduce it.
For resloution you are going to have to give me a working example of the
failure.
Also, per the posting guide, what is your sessionInfo()?
Terry Therneau
On 08/09/2012 04:11 AM, r-help-request at r-project.org wrote:
> I have a couple of questions with regards to fitting a coxph model to a data
> set in R:
>
> I have a
2012 May 16
1
Merging multiple data sets
Hello R user,
I have four data sets in dir "D:/Bharat Warule/Rdata_file" which are
output_data_prod_1.rda, output_data_prod_2.rda, output_data_prod_3.rda,
output_data_prod_4.rda.
Each data set is huge size like number of rows 343297 and columns are near
to 50.
For example:
x1 <- data.frame(x11=c(1,2,3,4,5),x112=c(10,10,10,10,10))
x2 <-
2006 Feb 21
6
How to Import Data
Hello,
I am a very new user of R. I've spent several hours trying to import
data, so I feel okay asking the list for help. I had an Excel file,
then I turned it into a "csv" file, as instructed by directions. My
filename is "x111.csv." I then used the following commands to read this
(fairly small) dataset in.
x111 <-read.table(file='x111.csv',
2007 Nov 08
3
'a' extension
Is there any way to see the called number when a call gets redirected to
the 'a' extension from voicemail? Say x123 calls x456 and it rolls to
voicemail. x123 hits * and gets dumped into the 'a' extension in the
original context. I need some logic in 'a' to do a database lookup
based on the original called number (x456). Any ideas? When I do a
test, it appears
2011 May 01
1
Longitudinal data with non-randomized subjects
Dear List,
I have a theoretical question related to epidemiological data analysis:
If the treatment status (tx = 0,1) changes over time for the patients in a non-randomized cohort, is there a way to estimate the treatment effect?
(i.e., after joining the study, some patients may have to wait for a period of time before receiving the treatment, i.e., the situation of patient with id == 2 for the
2020 Sep 10
5
aplicar codigo
Hola:
Como dice Carlos, algo así, por ejemplo:
transforma <- function(df) sapply(df, function(x)
ifelse(x%in%c("x1","x2","x3"),
"prueba1",ifelse(x%in%c("x4","x5","x6"),"prueba2",x)))
> transforma(df1)
col1
[1,] "prueba1"
[2,] "prueba1"
[3,] "x11"
[4,]
2007 Dec 17
2
Music On Hold
Hello everyone,
I am having a bit of problem getting MusicOnhold to play.
I am running Asterisk 1.4 with MPG123 0.59 installed.
And here's what i see in the debugging window of asterisk:
-- Started music on hold, class 'default', on channel
'SIP/x123-082043d0'
-- Stopped music on hold on SIP/x123-082043d0
Any idea why it is not playing the file at all?
thanks
2020 Sep 10
2
aplicar codigo
Yo copio y pego este código y me sale correctamente. Se me ocurre que
pueda deberse a la versión de R ¿cuál usas?
El 10/09/2020 a las 17:51, Samura . escribió:
> Gracias por las respuestas.
>
> Probé lo de hacer la función y no me salía. Pensaba que hacía algo mal.
> Ahora con el código de Marcelino tampoco me sale.
>
> col1 <- c('x1', 'x2', 'x11',
2020 Sep 10
3
aplicar codigo
Hola,
me gustar?a hacer algo como en el siguiente ejemplo
A un df a?adirle una columna que es la transformaci?n de otra,
en plan a todo lo que sea x1, x2, x3 lo llamo prueba 1
todo lo que sea x4,x5,x6 lo llamo prueba 2
el resto de x las dejo como est?n.
Ser?a algo as?
col1 <- c('x1', 'x2', 'x11', 'x1','x33', 'x1','x4', 'x5',
2002 Dec 09
2
PDF printing problem - can't find Samba's file?
I'm sure this is something simple, but I can't figure it out.
After a printing system upgrade, my old PDF-writer script (which acted as an
lp input filter) stopped working. I took this as an opportunity to rewrite
it to work straight from Samba. But I'm having an odd problem -- I can't
find Samba's job file. Here's the entry:
[pdf2]
path = /export/spool
2003 Dec 30
2
Samba 3.0.1 RMP?
Hi All - "i'm new to linux"
My Specs: Suse 9.0 & Windows 2003 Server (PDC)
My needs: authenticating with Windows 2003 Server
My Problem: Samba 2.x.x not working with Windows 2003 Server
(worked with Windows 2000 Server!?)
My Solution: Try Samba 3.0.1...
Unfortunately - I could noy locate a RPM for Samba 3.0.1 so far...
Have any one got any idea where I would be able to
2008 Jan 31
2
Box Plot With Groups being numbers
I would like to Summarize values that are repeated measures at a
certain river mile with box plot i.e.
The data matrix looks like this
123 124 125 #fiver mile
0.5 0.6 0.7
0.4 0.5 0.6
... ... ... #values
I would like to make a boxplot with the river mile naming the
different box plot. How do you suppress the X123?
Stephen
--
Let's not