[R] ADONIS triple interaction

2011-07-27 Thread Jorge
sound good, but I am not very sure whether it is right to include a third factor. Cheers Jorge -- View this message in context: http://r.789695.n4.nabble.com/ADONIS-triple-interaction-tp3698178p3698178.html Sent from the R help mailing list archive at

[R] [R-pkgs] Release of ess 0.0.1

2017-11-09 Thread Jorge Cimentada
e there's a lot of room for improvement. Thanks! --- Jorge Cimentada *https://cimentadaj.github.io/ <https://cimentadaj.github.io/>* [[alternative HTML version deleted]] ___ R-packages mailing

Re: [R] [R-pkgs] Release of ess 0.0.1

2017-11-10 Thread Jorge Cimentada
Thanks to all. Will consider this change in future releases. --- Jorge Cimentada *https://cimentadaj.github.io/ <https://cimentadaj.github.io/>* On Fri, Nov 10, 2017 at 12:41 PM, Rainer Krug wrote: > > > On 9 Nov 2017, at 15:57, Sam S

Re: [R] [R-pkgs] Release of ess 0.0.1

2017-11-10 Thread Jorge Cimentada
SS) project. It is unrelated to the 'ess' package, designed to download data from the European Social Survey available at http://www.europeansocialsurvey.org Thanks for raising these thoughts. --- Jorge Cimentada *https://cimentadaj.github.io/

Re: [R] Dataverse (reading files with .tab and .7z suffixes)

2018-05-13 Thread Jorge Cimentada
Our just use the dataverse package already in CRAN: https://cran.r-project.org/web/packages/dataverse/index.html --- Jorge Cimentada *https://cimentadaj.github.io/ <https://cimentadaj.github.io/>* On Sun, May 13, 2018 at 2:04 PM, Thomas

[R] Crash when installing heavy packages in remote server with R and Rstudio server

2017-08-06 Thread Jorge Cimentada
actually found out that the problem is not from Rstudio server in itself because I get the exact same error with: R CMD INSTALL PISA2000lite_1.0.tar.gz Any idea why this might be occurring? --- Jorge Cimentada *http

[R] Improving function that estimates regressions for all variables specified

2016-08-26 Thread Jorge Cimentada
(combinations, function(p) x <- as.formula(paste(c(dv, covariates[p]), collapse=" + "))) results <- lapply(lfo, function(o) lm(o, data=data)) return(results) } models("mpg",c("cyl","scale(disp)"), mtcars) models2(mpg ~ cyl + scale(disp), mtc

Re: [R] Loop over rda list files and using the attach function

2016-08-30 Thread Jorge Cimentada
e this helps. I found the solution through: https://www.r-bloggers.com/a-better-way-of-saving-and-loading-objects-in-r/ *Jorge Cimentada* *Ph.D. Candidate* Dpt. Ciències Polítiques i Socials Ramon Trias Fargas, 25-27 | 08005 Barcelona Office 24.331 [Tel.] 697 382 009 jorge.ciment...@upf.edu http

Re: [R] Matching/checking for occurence when values are double?

2016-09-09 Thread Jorge Cimentada
Matching 100 to 100.0 or 100.00 or whatever N number of decimales will always return a TRUE. The expression your using is correct. A more complete expression would be kidmomiq[100 == kidmomiq$mom_iq, ]. On Fri, Sep 9, 2016 at 2:01 PM, Matti Viljamaa wrote: I need to pick from a dataset those

Re: [R] Using lm's subset parameter results in Error in xj[i] : invalid subscript type 'list'

2016-09-20 Thread Jorge Cimentada
data frame(firstkids) Something along this line: lm(kid_score ~ mom_age , data = firstkids) *Jorge Cimentada* *Ph.D. Candidate* Dpt. Ciències Polítiques i Socials Ramon Trias Fargas, 25-27 | 08005 Barcelona Office 24.331 [Tel.] 697 382 009 jorge.ciment...@upf.edu http://www.upf.edu/dcpis/ On T

[R] R WRONG CALCULATIONS - Please Help

2015-09-14 Thread JORGE COLACO
I would greatly appreciate if you could let me know why the R does not make the right computations in the case below. Waiting for your reply Jorge Colaço R version 3.2.2 (2015-08-14) -- "Fire Safety" Copyright (C) 2015 The R Foundation for Statistical Computing Platform: i386-w

[R] #2 (Thanks) → Consultation about reading hdf files from nsidc

2015-10-29 Thread Jorge Rabinovich
City Bell, Thursday, October 29, 2015, 14:10 Hi there: On 10/29/2015 10:12 AM, HDF-EOS Tools and Information Center Help wrote: Hi, Jorge! The AMSR-E file you're trying to read with R is HDF"4", not HDF"5" file format. Unfortunately, R does not support HDF4 directl

[R] Error in model.frame.default… variable lengths differ (Without NA's)

2015-12-02 Thread Jorge Cimentada
rent countries and regardless of the dataset I use the problem persists.* I've tried all sorts of different things to fix this(I thought it was the way I recoded the dependent and independent variables, I thought it was because of empty rows). If I exclude the weight variable, the model works ju

[R] Error creating named character vectors from column names in data frame.

2016-10-07 Thread Jorge Cimentada
Hi everyone, I was hoping someone would explain why this doesn't work. c("a" = "b") # named character vector class("a") # character class("b") # character c(names(mtcars)[1] = names(mtcars[2]) # error class(names(mtcars)[1]) # character class(

Re: [R] Error creating named character vectors from column names in data frame.

2016-10-07 Thread Jorge Cimentada
I'm sorry, there was a typo. The result is still the same: c("a" = "b") # named character vector class("a") # character class("b") # character c(names(mtcars)[1] = names(mtcars)[2]) # error class(names(mtcars)[1]) # character class(names(mtc

Re: [R] Error creating named character vectors from column names in data frame.

2016-10-07 Thread Jorge Cimentada
Hi Bert, Yes, I'm aware of the difference between a and "a" but in terms of object classes I don't see the difference between "a" and names(mtcars)[1]. They're both strings. However, for creating a named character vector, this works: c("a" = "b) But this doesn't c(names(mtcars)[1] = "b") For e

Re: [R] multiple uses ifelse function

2016-10-11 Thread Jorge Cimentada
Hi Letter, This should do it: testchange <- ifelse(testseq <= 4,'x', ifelse(testseq >= 5, 'y', testseq)) Read it as: if testseq <=4, print x, ifelse test seq >=5, print y, any other case, print testseq. [[alternative HTML version deleted]] __

Re: [R] Zenga - inequality index - Do you know any package to compute it?

2016-11-14 Thread Jorge Cimentada
A simple google search directs me to the 'convey' package in CRAN which has a function called svyzenga. Here for more details. Maybe that's what you want. [[alternative HTML version deleted]] _

[R] Handling Runtime Error Messages

2008-08-15 Thread Jorge Cardoso
ng an exceptional condition in the arima model. I want to catch these error messages (or at least the code error number) to take some corrective actions. Is there any way to do that ? Regards, Jorge Cardoso __ R-help@r-project.org mailing list

Re: [R] R-Embedding and error messages

2008-08-20 Thread Jorge Cardoso
responses dear Martin and Luke. Jorge El Mié 20 Ago 2008, Luke Tierney escribió: > On Wed, 20 Aug 2008, Martin Morgan wrote: > > Hi Jorge -- > > > > I hesitate to suggest this unsupported solution (as these public > > suggestions tend to mean that the solution disappea

[R] hier.part

2010-03-05 Thread Marco Jorge
Hi everyone, A beguinner question. - How shall i import 9 different ascii (created from a gis layer (arcmap grid)) into R to create a single dataframe for using in hier.part? Should i use read.table, then turn each created object into a single vector using unlist and finally use data.frame to jo

[R] error_hier.part

2010-03-08 Thread Marco Jorge
Hi everyone, BEGINNER question: I get the error below when running hier.part. Probably i´m doing something wrong. Error in glm.fit(x = X, y = Y, weights = weights, start = start, etastart = etastart, : object 'fit' not found In addition: Warning messages: 1: In glm.fit(x = X, y = Y, weights =

[R] R CMD build for windows package from linux

2009-06-28 Thread Jorge Cornejo
Hi, exist any way to create a windows installable package from a Linux R installation ?? I try R CMD build --binary --use-zip MyPack But generate a tar.gz file. Thanks in advance __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo

[R] image() function

2010-03-26 Thread Jorge Hernandez
Hello. I would like to know how to set the image() function so that it assigns colors relative to an absolute scale, as opposed to relative to the values present in a particular call to image(). For example: m <- matrix(1:18,3,6) par(mfrow = c(2,1)) image(1:6, 1:3, t(m), col = rainbow(20)

[R] Help constructing a stochastic kernel

2009-11-17 Thread Jorge Vinseiro
reaklly grateful if any can provide me that info. Thank you in advance for any help you can give me. -- Jorge A. Vinseiro Moure Analista banco Mercantil Tlf. 0212 503 0517 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

[R] Wiring or Arduino package/scripts

2009-06-02 Thread Jorge Cornejo
Hi, I am looking any way to communicant with Arduino (http://www.arduino.cc/) Wiring (http://www.wiring.org.co) boards and read data generate with sensor on these. If anyone know how to do it, I will appreciate if could give some advice. Thanks in advance

Re: [R] Wiring or Arduino package/scripts

2009-06-04 Thread Jorge Cornejo
Thanks... This will be very usefull. Warren Young wrote: > > Jorge Cornejo wrote: >> Hi, I am looking any way to communicant with Arduino >> (http://www.arduino.cc/) Wiring (http://www.wiring.org.co) boards and >> read data generate with sensor on these. > > On

[R] Install local package

2009-06-10 Thread Jorge Cornejo
Hi, I'm working on a package that I would someday put in CRAN. Now I want to test it on my computer. I already check and compile the files but I don't know how to install the package located on my hard drive. I'm running R under linux. Can anyone tell my how to do it? Thanks in advance. _

[R] install local package

2009-06-10 Thread Jorge Cornejo
Hi, I'm working on a package that I would someday put in CRAN. Now I want to test it on my computer. I already check and compile the files but I don't know how to install the package located on my hard drive. I'm running R under linux. Can anyone tell my how to do it? Thanks in advance. _

[R] Signed-Binary transform test (Fisher.test??)

2009-04-21 Thread Jorge Cornejo
Hi, I was looking for the fisher test to use on my data (no normal, non symetrical and because is median what i'm looking for I don't what to made bootstraping) to test the median <> Ho=1, but I'm not sure if Fisher.test in R is what I need or I just don't know how to use it. Here is the example da

Re: [R] Bar Charts

2019-10-16 Thread Jorge Mendonça
It`s like this? barplot(CONTBR_RESULT[order(CONTBR_RESULT)][16:30]) Regards Jorge On Wed, 16 Oct 2019 at 02:51, Jim Lemon wrote: > Hi Jeff, > Let's say you have the following data: > > set.seed(12345) > CONTBR_RESULT<-sample(20:200,30) > > If you don't min

Re: [R] reorder() in the latticeExtra library

2012-11-03 Thread Jorge Dinis
Thanks David, I used you suggestion and it worked fine, please see below for what I did. segplot(reorder(factor(genotype), genotype) ~ lower + upper On Nov 3, 2012, at 2:47 AM, David Winsemius wrote: > define genotype as a factor [[alternative HTML version deleted]]

[R] run R

2010-06-30 Thread jorge . conrado
Hi, I'm starting use the R Package and I have some .R scripts. How can I run these .R scripts. Conrado __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http:

[R] multiple time series plot with dual 'y' axes

2010-07-06 Thread Jorge Hernandez
p. Cheers. Jorge ** PRIVATE & CONFIDENTIAL: This email and any files transmitted with it are confidential. Any unauthorized use of the information contained in t his email or its

[R] IP address

2010-09-16 Thread Jorge Nieves
select a few? The IT department needs to know the IP addresses. Thanks, Jorge Nieves [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

[R] RODBC

2010-11-25 Thread Jorge Nieves
3 YES 3 4 NA4 YES 4 5NA5 YES 5 > Any ideas as of what might I have missed? Thanks, Jorge [[alternative HTML version deleted]] _

[R] sqlUpdate error with MS acces

2010-11-28 Thread Jorge Nieves
YES 3 4 NA4 YES 4 5NA5 YES 5 > Any ideas as of what might I have missed? Thanks, Jorge __ R-help@r-project.org mailing list https://stat.ethz.ch/

[R] Help with interpolation

2010-05-13 Thread Jorge Nieves
ction to get the interpolated values? Thanks, Jorge 20100319 2010-03-19 1626 20100320 2010-03-20NA 20100321 2010-03-21NA 20100322 2010-03-22NA 20100323 2010-03-23NA 20100324 2010-03-24NA 20100325 2010-03-25NA 20100326 2010-03-26 1638 20100327 2010-03-27NA 20100328

[R] Help with interpolation

2010-05-13 Thread Jorge Nieves
duced by coercion > > > > > I was wondering if some one could recommend another function to get > the interpolated values? > > Thanks, > > Jorge > > 20100319 2010-03-19 1626 > 20100320 2010-03-20NA > 20100321 2010-03-21NA > 20100322 2010-03-

[R] Rexcel path problem

2011-04-01 Thread Jorge Nieves
the problem? Thanks ,' Jorge VB code Sub tester() Rinterface.StartRServer Rinterface.RRun ("source('X:\Trading\Energy\JorgeSpace\TMPholder\cpixe\home models\toto.R')") Rinterface.StopRServer End Sub "R cript code toto.R" path = getwd() set

[R] Edate and EOmonth

2011-04-11 Thread Jorge Nieves
y. I would like to be able to obtain dates and EOM dates "n" months prior/forward to the input date. Thanks, Jorge Nieves [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/l

[R] R in Batch mode

2011-07-13 Thread Jorge Cornejo
process, and I cannot be checking the process all day!. Is there any way to send me a warning when the process stops/fails? Thanks in advance Jorge Cornejo __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do re

Re: [R] [O/T] Good bash or Linux shell command book

2012-08-02 Thread Jorge Hernandez
If you are looking for an introduction, and for Linux in particular, I recommend the last twelve chapters of "The Linux Command Line" (William Shotts) which you can download in pdf from the following link. http://linuxcommand.org/tlcl.php Regards, Jorge On Thu, Aug 2, 2012 at 7:0

Re: [R] htmlParse hangs or crashes

2011-09-28 Thread Jorge Cornejo
Hi, I been having the same problem all the afternoon, and I just realize that only happens when I use the R64 and is not crashing using the 32 bits version. This must be a bug in this R version. I hope this could helps. -- View this message in context: http://r.789695.n4.nabble.com/htmlParse-ha

[R] Calculating length of consecutive sequences within a vector

2012-03-08 Thread Jorge Molinos
Any help would be appreciated! thanks! Jorge [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and

Re: [R] Calculating length of consecutive sequences within a vector

2012-03-09 Thread Jorge Molinos
Thanks, rle is what I was looking for. Jorge From: R. Michael Weylandt [michael.weyla...@gmail.com] Sent: 08 March 2012 16:29 To: Jorge Molinos Cc: r-help@R-project.org Subject: Re: [R] Calculating length of consecutive sequences within a vector rle

[R] Reading and analyzing data with two headers

2012-03-14 Thread jorge Rogrigues
I have data that I would like to analyze in R with the following format: *,M1,,M2, *,S1,S2,S1,S2, p1,m1s1v1,m1s2v1,m2s1v1,m2s2v1 p2,m1s1v2,m1s2v2,m2s1v2,m2s2v2 ..,...,...,..., so I have a method M1 and M2 and each of these have attributes that I would like to analyze for the different problem

[R] How to write and analyze data with 3 dimensions

2012-03-20 Thread jorge Rogrigues
Suppose I have data organized in the following way: (P_i, M_j, S_k) where i, j and k and indexes for sets. I would like to analyze the data to get for example the following information: what is the average over k for (P_i, M_j) or what is the average over j and k for P_i. My question is what woul

[R] Calculate a function repeatedly over sections of a ts object

2012-01-26 Thread Jorge Molinos
for example, the first SDF would be calculated for the daily values of my variable recorded between years 1 to 5, SDF2 to those for years 2 to 6 and so on until the total length of the series is covered. How can I implement this into a R script? Any help is much appreciated. Jorge

Re: [R] Calculate a function repeatedly over sections of a ts object

2012-01-27 Thread Jorge Molinos
Thanks a lot for the suggestion. It's just what I was looking for. Jorge From: Gabor Grothendieck [ggrothendi...@gmail.com] Sent: 26 January 2012 21:05 To: R. Michael Weylandt Cc: Jorge Molinos; r-help@R-project.org Subject: Re: [R] Calculate a fun

Re: [R] Calculate a function repeatedly over sections of a ts object

2012-01-30 Thread Jorge Molinos
Thank you very much Mike. The script is working now. Jorge From: R. Michael Weylandt [michael.weyla...@gmail.com] Sent: 30 January 2012 04:29 To: Jorge Molinos; r-help Subject: Re: [R] Calculate a function repeatedly over sections of a ts object

Re: [R] test for the variance of a normal population

2008-04-07 Thread Jorge Velez
Dear Alexandra, Perhaps you can use a different approach but I think it works: # Chi-suared CI var.ci=function(x,alpha=0.05){ n=length(x)-sum(is.na(x)) s2=var(x,na.rm=T) li=s2*(n-1)/qchisq(1-alpha/2,n-1) ls=s2*(n-1)/qchisq(alpha/2,n-1) c(li,ls) } # Example set.seed(123) y=rnorm(1000,25,2) var.c

Re: [R] how to check if a variable is preferentially present in a sample

2008-04-08 Thread Jorge Velez
probabilities data: TABLE X-squared = 2, df = 4, p-value = 0.7358 cht$p.value [1] 0.7357589 Hope this helps, Jorge On Tue, Apr 8, 2008 at 11:24 AM, Tania Oh <[EMAIL PROTECTED]> wrote: > Dear All, > > I do apologise if this question is out of place for this list bu

Re: [R] Problem with NA data when computing standard error

2008-04-08 Thread Jorge Velez
r=="1999"],Season[Year=="1999"]),se)) Hope this helps, Jorge On Tue, Apr 8, 2008 at 1:44 PM, LeCzar <[EMAIL PROTECTED]> wrote: > > Hey, > > I want to compute means and standard errors as two tables like this: > > se<-function(x)sqrt(var(x)/length

[R] How to fill out some columns?

2008-04-11 Thread Jorge Velez
40962 0 1.2925123 0 [4,] -1.4821891 0 -0.4658959 0 -1.6880486 0 [5,] 0.8611319 0 -0.6375435 0 -0.8209936 0 where columns "A", "C" and "E" are the dy columns and columns "B" and "D" are zeros because, when we compare dx and dy, they a

[R] Quadratic Programming

2008-02-15 Thread Jorge Aseff
eturn the values of the lagrange multiplieres associated with the constraints. I did not find an obvious way in help(solve.QP). Any thoughts? Thanks. Jorge [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.et

[R] Replacing text

2008-03-11 Thread Jorge Velez
Jeep -0.56047565 2 Nissan -0.23017749 3 Toyota1 1.55870831 4 Scion 0.07050839 HTH, Jorge On Tue, Mar 11, 2008 at 2:01 PM, Suran, Luciana @ Torto Wheaton Research < [EMAIL PROTECTED]> wrote: > Sorry, another newbie question :-( > > > > > > I loaded a data se

Re: [R] how to save a chart as ps in R?

2008-03-11 Thread Jorge Velez
Hi Samuel, Sure. Ckeck ?savePlot or ?postscript. I prefer the first one. HTH JIV On Wed, Mar 12, 2008 at 12:04 AM, Samuel <[EMAIL PROTECTED]> wrote: > Hi guys, > > I remember that we had some ways to save a chart as ps file, which can be > used by latex directly. I can't find it now. Can yo

[R] scatter3D and colours

2016-07-14 Thread Jorge I Velez
be greatly appreciated. Thank you very much in advance. Best regards, Jorge Velez.- ## package needed if(!require(plot3D)) install.packages("plot3D") require(plot3D) ## data to be plotted d0 <- structure(list(X = c(2.5, -2, 1), Z = c(-3.5, 4, -1), Y = c(8, -8.5, -1)), .Names = c("

Re: [R] scatter3D and colours

2016-07-14 Thread Jorge I Velez
Thank you very much, Sarah, for your help. The colvar argument was certainly what I needed. I will follow your suggestion. Cheers, Jorge.- On Thu, Jul 14, 2016 at 1:29 PM, Sarah Goslee wrote: > I assume you want some variant of: > with(d0, scatter3D(X, Z, Y, bty = "b2", co

[R] Help with pedigree() function in kinship2

2015-05-12 Thread Jorge I Velez
3", "30", "33", "34", "39", "4", "43", "5", "6", "63", "65", "9"), class = "factor"), Sex = structure(c(2L, 1L, 1L, 2L, 2L, 2L, 1L, 2L, 2L), .Label = c("Female", "

Re: [R] Count number in r

2015-05-19 Thread Jorge I Velez
Dear Arshad, Here is a possibility using tapply(): with(d, tapply(Rain, list(Month, Year), function(x) sum(x > .1))) ##1971 #1 12 #20 where "d" is your data.frame(). See also ?aggregate and ?ave. Best, Jorge.- On Tue, May 19, 2015 at 8:10 PM, Hafizuddin Arshad <

Re: [R] keep only the first value of a numeric sequence

2014-12-15 Thread Jorge I Velez
Dear jeff6868, Here is one way: ifelse(with(data, c(0, diff(mydata))) != 1, 0, 1) You could also take a look at ?rle HTH, Jorge.- On Mon, Dec 15, 2014 at 9:33 PM, jeff6868 wrote: > > Hello dear R-helpers, > > I have a small problem in my algorithm. I have sequences of "0&

Re: [R] non negativity constraints if else function

2014-12-20 Thread Jorge I Velez
What about ifelse(w < 0, 0, w) See ?ifelse for more information. Best, Jorge.- On Sat, Dec 20, 2014 at 3:26 PM, Esra Ulasan wrote: > Hello, > > I have tried the solve the non-negativity constraint "if else function" in > R. But I have done something wrong becaus

[R] Proportion of equal entries in dist()?

2015-01-19 Thread Jorge I Velez
"myd", none of the default distances fits my needs. I would also appreciate any suggestions on how to include "my own" distance function in dist(). Thank you very much for your time. Best regards, Jorge Velez.- [[alternative HTML version deleted]]

[R] Problems installing jpeg package

2015-01-27 Thread Jorge Fernández García
I need help installing jpeg package. Simple command install.package("jpeg") produce the following result. My OS is Fedora 21. Thanks in advance for your help. > install.packages("jpeg") Installing package into �/home/cgg/R/x86_64-redhat-linux-gnu-library/3.1� (as �lib� is unspecified) trying URL

Re: [R] Save a plot with a name given as an argument in a function

2015-02-09 Thread Jorge I Velez
Hi Evgenia, Try test2 <- function(data, TitleGraph){ pdf(paste0(TitleGraph, ".pdf"), width = 7, height = 5) plot(data) dev.off() } instead. Take a look at ?paste0 for more information. HTH, Jorge.- On Tue, Feb 10, 2015 at 12:14 AM, Evgenia wrote: > test<-functi

Re: [R] How to access https page

2015-03-09 Thread Jorge I Velez
Hi Hui, I have used the source_url function in the devtools package with good results. Give it a shot! Best, Jorge.- On Tue, Mar 10, 2015 at 9:39 AM, Hui Du wrote: > Hi All, > > I am trying to parse some information from website, say, a linkedin page. > The linkedin url was >

Re: [R] Possible pair of 2 binary vectors

2014-08-09 Thread Jorge I Velez
Dear Ron, What about this? set.seed(123) d <- 4 x1 <- sample(0:1, d, TRUE) x2 <- sample(0:1, d, TRUE) x1 x2 expand.grid(x1 = x1, x2 = x2) See ?expand.grid for more information. Best, Jorge.- On Sat, Aug 9, 2014 at 7:46 PM, Ron Michael wrote: > Hi, > > Let say I have 2

Re: [R] reshape a dataset

2014-08-15 Thread Jorge I Velez
n d <- with(skdat, table(ID, lettertag)) res <- c(list(rownames(d)), sapply(apply(d, 2, list), "[", 1)) names(res)[1] <- "ID" res HTH, Jorge.- On Fri, Aug 15, 2014 at 7:19 PM, Jim Lemon wrote: > On Thu, 14 Aug 2014 06:08:51 PM Sohail Khan wrote: > > Hi > >

Re: [R] reshape a dataset

2014-08-15 Thread Jorge I Velez
If that's the case, you could do the following: d <- with(skdat, table(ID, lettertag)) d <- data.frame(cbind(ID = rownames(d), d)) rownames(d) <- NULL d HTH, Jorge.- On Fri, Aug 15, 2014 at 8:22 PM, Sohail Khan wrote: > Thanks Jim and Jorge, > Clever solutions, the fi

Re: [R] data.table/ifelse conditional new variable question

2014-08-16 Thread Jorge I Velez
[l$Relationship == 'sibling'] <- l$Sample.ID[father] l$MID[l$Relationship == 'sibling'] <- l$Sample.ID[mother] l })) res HTH, Jorge.- Best regards, Jorge.- On Sun, Aug 17, 2014 at 5:42 AM, Kate Ignatius wrote: > Hi, > > I have a data.table question (

Re: [R] data.table/ifelse conditional new variable question

2014-08-17 Thread Jorge I Velez
$PID[l$Relationship == 'sibling'] <- l$Sample.ID[father] if(sum(mother) == 0) l$MID[l$Relationship == 'sibling'] <- 0 else l$MID[l$Relationship == 'sibling'] <- l$Sample.ID[mother] l })) It is assumed that when either parent is not available the M/PID is 0.

Re: [R] data.table/ifelse conditional new variable question

2014-08-17 Thread Jorge I Velez
5 sibling 4 3 #3064.7 306486 sibling 4 3 #3064.8 306487 sibling 4 3 HTH, Jorge.- On Sun, Aug 17, 2014 at 11:47 AM, Kate Ignatius wrote: > Yep - you're right - missing parents are indicated as zero in the M/PID > field. > > The

Re: [R] print vectors with consecutive numbers

2014-08-22 Thread Jorge I Velez
Hi James, Try mat[, apply(mat, 2, function(x) any(diff(x) == 1))] HTH, Jorge.- On Fri, Aug 22, 2014 at 10:18 PM, James Wei wrote: > > > Hi all, > > I have a matrix with consecutive and non-consecutive numbers > in columns. For example, the first 2 columns have consecutive

Re: [R] Creating a new column from a series of columns

2014-10-31 Thread Jorge I Velez
Dear Dennis, Assuming that your data.frame() is called dd, the following should get you started: colnames(dd[,-1])[apply(dd[,-1], 1, function(x) which(x == 'Yes'))] HTH, Jorge.- On Sat, Nov 1, 2014 at 12:32 PM, Fisher Dennis wrote: > R 3.1.1 > OS X > > Colleagu

[R] Update dataframe based on some conditions

2015-10-21 Thread Jorge I Velez
processing the remaining REF would be #REF TIMEREF TOENDREF #9 731 30 270 #10 731 60 210 #11 731 90 120 #12 731 1200 Hopefully I have explained well what I would like to end up with. If this is not the case, I will be more than happy to provide more i

Re: [R] Number of digits to display?

2015-10-26 Thread Jorge I Velez
-0.58 -0.50 0.30 0.60 ​Best regards, Jorge.- On Mon, Oct 26, 2015 at 11:43 AM, Judson wrote: > How do I control the number of digits to display, > say, in a matrix, without rounding or losing accuracy > in subsequent calculations? > round() of course reduces accuracy. > >

[R] Extract entries from matrix

2015-10-27 Thread Jorge I Velez
s to be done. I would greatly appreciate any ideas on how to do this. Thanks in advance, Jorge Velez.- [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/list

Re: [R] Extract entries from matrix

2015-10-27 Thread Jorge I Velez
is not known and needs to be determined from "m". I would like to use something like extractDiagonals(m) ## [1] 1 2 3 1 2 3 4 5 1 I look forward to your reply. Thanks in advance. Best regards, Jorge Velez.- On Tue, Oct 27, 2015 at 2:31 PM, jim holtman wrote: > If you want to

Re: [R] Extract entries from matrix

2015-10-27 Thread Jorge I Velez
2, 3, 1, 2, 3, 4, 5, 1. Thank you in advance for any additional insight you may provide. Regards, Jorge Velez.- On Tue, Oct 27, 2015 at 4:06 PM, David L Carlson wrote: > I don't see how you are getting the result you provide. > > > m > [,1] [,2] [,3] [,4] [,5] >

Re: [R] Extract entries from matrix

2015-10-28 Thread Jorge I Velez
. The output vector would then be of the same length as the number of rows in "m", and would contain the elements previously selected. Any ideas on how to proceed? Thank you very much in advance. Best regards, Jorge Velez.- On Tue, Oct 27, 2015 at 4:38 PM, Jorge I Velez wrote: &

Re: [R] Extract entries from matrix

2015-11-04 Thread Jorge I Velez
Dear Dr. Steipe, Thank you for the code. It does exactly what I needed. Best regards, Jorge.- On Wed, Oct 28, 2015 at 1:18 PM, Boris Steipe wrote: > Your code does not produce the matrix in your image. > The first three rows contain all-zeros and the last row is missing. > The

Re: [R] Extract every 2 element for a list which are not equal in length

2016-03-07 Thread Jorge I Velez
Dear Mohammad, What's wrong with the result? Best, Jorge.- On Monday, March 7, 2016, Mohammad Tanvir Ahamed via R-help < r-help@r-project.org> wrote: > Hi, > > a <- c(1:5)b <- c(1:3) > c <- 1 > d <- 5 > e <- list(a,b,c,d) > > # To extract every 1

Re: [R] How to cut data elements included in a text line

2008-07-18 Thread Jorge Ivan Velez
Dear Christine, Try x="\talpha0\t-0.638\t0.4043\t0.4043\t-2.215\t-0.5765\t-0.137\t501\t2000" res=unlist(strsplit(x,"[\t]")) as.numeric(res[-c(1,2,length(res)-1,length(res))]) HTH, Jorge On Fri, Jul 18, 2008 at 12:44 PM, Christine A. < [EMAIL PROTECTED]> wrote: &g

Re: [R] with lapply() how can you retrieve the name of the object

2008-07-18 Thread Jorge Ivan Velez
Dear Andrew, It's not the best solution but it does what you need: a <- data.frame(var.1 = 1:5) b <- data.frame(var.1 = 11:15) test.list <- list(a=a, b=b) res=do.call(rbind,test.list) res$var.2=substr(rownames(res),1,1) rownames(res)=NULL res HTH, Jorge On Fri, Jul 18, 2

Re: [R] with lapply() how can you retrieve the name of the object

2008-07-18 Thread Jorge Ivan Velez
Dear Andrew, Following Jim Holtman' solution (thanks for pointed it out), try: a <- data.frame(var.1 = 1:5) b <- data.frame(var.1 = 11:15) test.list <- list(a=a, b=b) do.call(rbind,lapply(names(test.list), function(x){ cbind(test.list[[x]], var.2=x) })) HTH, Jorge On Fri

Re: [R] vector help

2008-07-21 Thread Jorge Ivan Velez
Try this: test=c("Geneset=HSA04910_INSULIN_SIGNALING_PATHWAY","157","20") paste(test, collapse="-",sep="") HTH, Jorge On Mon, Jul 21, 2008 at 2:49 PM, Rajasekaramya <[EMAIL PROTECTED]> wrote: > > hi > > I have vector

Re: [R] Simple... but...

2008-07-23 Thread Jorge Ivan Velez
Hi Shubha, Is this what you want? x=c(4,2,2) y=c(1,5,3) c(rbind(x,y)) [1] 4 1 2 5 2 3 HTH, Jorge On Wed, Jul 23, 2008 at 9:17 AM, Shubha Vishwanath Karanth < [EMAIL PROTECTED]> wrote: > OK, > > Let x=c(4,2,2) >y=c(1,5,3) > > My result should be c(4,1,2,5

Re: [R] sequential sum of a vector...

2008-07-23 Thread Jorge Ivan Velez
Dear Shubha, Try this: x=1:80 tapply(x,rep(1:10,each=8),sum) 1 2 3 4 5 6 7 8 9 10 36 100 164 228 292 356 420 484 548 612 HTH, Jorge On Wed, Jul 23, 2008 at 10:03 AM, Shubha Vishwanath Karanth < [EMAIL PROTECTED]> wrote: > Hi R, > > > > Let, > >

Re: [R] Convert list of lists <--> data frame

2008-07-23 Thread Jorge Ivan Velez
Dear Michael, Perhaps, data.frame(do.call(rbind,lapply(pats,function(x) t(as.matrix(x,ncol=10) HTH, Jorge On Wed, Jul 23, 2008 at 9:23 AM, Michael Friendly <[EMAIL PROTECTED]> wrote: > For a function that takes an argument as a list of lists of parameters, I'd > l

[R] Constrained coefficients in lm

2008-07-23 Thread Jorge Ivan Velez
earch("constrained coefficients in lm") which produces 20 hints, but they're not what I need. Any help would be appreciated. Thanks in advance, Jorge # Data set to estimate the model myDF=read.table(textConnection("rea st mod 14482734 14305907 14761000 1442796

[R] Constrained coefficients in lm (correction)

2008-07-23 Thread Jorge Ivan Velez
Dear list, In my previous email, the model I'd like to estimate is rea=a*st+b*mod+error, where a+b=1 and a,b>0. My apologies for the misunderstanding. Thanks for all your help, Jorge On Wed, Jul 23, 2008 at 3:35 PM, Jorge Ivan Velez <[EMAIL PROTECTED]> wrote: > > Dear lis

Re: [R] How to delete duplicate cases?

2008-07-24 Thread Jorge Ivan Velez
Dear Daniel, Try this: x=read.table(textConnection("cno rank 1 13420.23 2 13420.14 3 13420.56 4 25680.15 5 25680.89"),header=TRUE,sep="") x[cumsum(tapply(x$rank,x$cno,which.max)),] cno rank 3 1342 0.56 5 2568 0.89 HTH, Jorge On Thu, Jul

Re: [R] product of successive rows

2008-07-29 Thread Jorge Ivan Velez
apply, g,prod) } prod.mat(x) HTH, Jorge On Sun, Jul 27, 2008 at 6:20 PM, rcoder <[EMAIL PROTECTED]> wrote: > > Hi everyone, > > I want to perform an operation on a matrx that outputs the product of > successive pairs of rows. For example: calculating the product betwee

Re: [R] placing a text in the corner of a plot

2008-07-29 Thread Jorge Ivan Velez
Dear Jörg, Perhaps, plot(1:10) legend("topleft",c("Your text here"),pch=1) See ?legend and ?text for more information. HTH, Jorge On Tue, Jul 29, 2008 at 6:04 PM, Jörg Groß <[EMAIL PROTECTED]> wrote: > Is there an easy way to add a text into an R-plot and

Re: [R] Random number generation

2008-07-31 Thread Jorge Ivan Velez
Hi Max, See ?write.table. Perhaps: MAT <- matrix(runif(1 * 6), 1, 6) # TXT format write.table(MAT, "C:/yourmatrix.txt",col.names=FALSE,row.names=FALSE,quote=FALSE) # XLS format write.table(MAT, "C:/yourmatrix.xls",col.names=FALSE,row.names=FALSE,quote=FALSE

Re: [R] Grouping Index of Matrix Based on Certain Condition

2008-07-31 Thread Jorge Ivan Velez
3e-01 0.04848268"),header=FALSE,sep="")) index=apply(x,1,function(x) ifelse(x[1]>x[2],'Group1','Group2')) index [1] "Group2" "Group1" "Group1" "Group1" "Group1" "Group1" "Group1" "Group1&q

Re: [R] simple help request

2008-08-01 Thread Jorge Ivan Velez
Dear Lotta, Try my.df <- data.frame(a <- c(1,6,10,11,3,5,10), group <- c(5,5,5,5,9,9,9)) tapply(my.df$a,my.df$group,median) 5 9 8 5 See ?tapply and/or ?aggregate for more information. HTH, Jorge On Fri, Aug 1, 2008 at 1:30 PM, Lotta R <[EMAIL PROTECTED]> wrote: > Hi al

Re: [R] PDF append help

2008-08-05 Thread Jorge Ivan Velez
Hi Ramya, Perhaps pdf("C:/100plots.pdf") for(i in 1:100) plot(rnorm(10), type='b', main='My 100 plots') dev.off() HTH, Jorge On Tue, Aug 5, 2008 at 12:41 PM, Rajasekaramya <[EMAIL PROTECTED]>wrote: > > hi there, > > Is there any function to a

  1   2   3   4   5   6   7   8   9   10   >