Re: [R] how to select an element from a vector based on a probability

2014-04-11 Thread Simone Gabbriellini
efer to www.vestas.com/legal/notice > If you have received this e-mail in error please contact the sender. > > >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] >> On Behalf Of Nordlund, Dan (DSHS/RDA) >> Sent: 10. april

Re: [R] how to select an element from a vector based on a probability

2014-04-10 Thread Simone Gabbriellini
Hello, Rui, it does, indeed! thanks, Simone 2014-04-10 20:55 GMT+02:00 Rui Barradas : > Hello, > > Use ?sample. > > sample(x, 1, prob = x) > > Hope this helps, > > Rui Barradas > > Em 10-04-2014 19:49, Simone Gabbriellini escreveu: > >> Hello List, >

[R] how to select an element from a vector based on a probability

2014-04-10 Thread Simone Gabbriellini
-- - Simone Gabbriellini, PhD Post-doctoral Researcher ANR founded research project "DIFFCERAM" GEMASS, CNRS & Paris-Sorbonne. mobile: +39 340 39 75 626 email: simone.gabbriell...@cnrs.fr __ R-help@r-project.org mail

Re: [R] a problem with table() and duplicates

2014-01-22 Thread Simone Gabbriellini
it. > > > On Wed, Jan 22, 2014 at 11:04 AM, Simone Gabbriellini > wrote: >> Dear List, >> >> I have a data.frame like this: >> >> name religion neighbor religion.neighbor >> pippo a minnie a >> pluto a mickey a >> paperino b donald a >

[R] a problem with table() and duplicates

2014-01-22 Thread Simone Gabbriellini
Dear List, I have a data.frame like this: name religion neighbor religion.neighbor pippo a minnie a pluto a mickey a paperino b donald a paperino b minnie b when I table(dataframe$religion) my data.frame, I get a b 2 2 of course, "paperino" is cited twice but should be counted once. Is there an

Re: [R] help with plotmeans (gplots)

2013-06-27 Thread Simone Gabbriellini
1 1 ... > $ val : num 12.85 3.18 7.82 9.16 8.02 ... > > plotmeans(val~time, dat2, n.label=FALSE) > > - > David L Carlson > Associate Professor of Anthropology > Texas A&M University > College Station, TX 77840-4352 > > -Original Message- >

[R] help with plotmeans (gplots)

2013-06-26 Thread Simone Gabbriellini
plotmeans, but I am unable to understand the syntax I should use. I tried: times<-as.factor(seq(1,15)) plotmeans(data~times) with no luck... what should I tell to plotmeans in order to evaluate my dataset? Best regards, Simone -- Simone Gabbriellini, PhD PostDoc@DISI, University of Bolo

Re: [R] how to set the row name of a specific row

2013-04-20 Thread Simone Gabbriellini
gt; > Hope this helps, > > Rui Barradas > > Em 20-04-2013 10:58, Simone Gabbriellini escreveu: > > Hello, >> >> I am adding rows to a matrix using rbind() and I would like to also add a >> row name to the added row in order to do some sorting after the add

[R] how to set the row name of a specific row

2013-04-20 Thread Simone Gabbriellini
Hello, I am adding rows to a matrix using rbind() and I would like to also add a row name to the added row in order to do some sorting after the adding rows part is finished. is this possible? Best, Simone -- Simone Gabbriellini, PhD PostDoc@DISI, University of Bologna mobile: +39 340 39 75

[R] how to measure similarity between vectors of different length

2013-04-19 Thread Simone Gabbriellini
each random vectors. I am not a statistician, and I think that this solution may already have been implemented in R, but I do not know where to search for this, so I do welcome every suggestion/advice you might give me. Best regards, Simone -- Simone Gabbriellini, PhD PostDoc@DISI, University

Re: [R] how to

2013-02-01 Thread Simone Gabbriellini
t.org [mailto:r-help-bounces@r- >> project.org] On Behalf Of Simone Gabbriellini >> Sent: Friday, February 01, 2013 12:54 PM >> To: r-help@r-project.org >> Subject: [R] how to >> >> Dear List, >> >> I have a list of lists and on each list I want to apply a

[R] how to

2013-02-01 Thread Simone Gabbriellini
listOfLists){ print(mean(graph.knn(g, i)$knn)) } Is there any way to convert this in a one-liner? I have tried to figure it out with lapply() or mapply() but with no success. Thank you in advance for your help. Simone -- Simone Gabbriellini, PhD PostDoc@DISI, University of Bologna mobile: +39

[R] how to setdiff on lists of lists

2013-02-01 Thread Simone Gabbriellini
apply(aa, setdiff, bb) but I simply get "aa" back as result. Could you please point me in the right direction about the combination of functions that I need to accomplish this task? Best regards, Simone -- Simone Gabbriellini, PhD PostDoc@DISI, University of Bologna mobile: +39 340 39 75

Re: [R] Odds Ratio and Logistic Regression

2012-12-30 Thread Simone Gabbriellini
Took some googling, but it was worth it! :) Best, Simone Sent from my iPhone. Please excuse brevity and odd typos Il giorno 30/dic/2012, alle ore 19:44, Bert Gunter ha scritto: > Are you "learning the ropes" or "on the ropes"? __ R-help@r-project.o

Re: [R] Change boxplot color

2012-09-22 Thread Simone Gabbriellini
Thanks! I missed that argument... :) 2012/9/22 Bert Gunter : > ?boxplot > ... and note the "border" argument > > -- Bert > > On Fri, Sep 21, 2012 at 6:57 PM, Simone Gabbriellini > wrote: >> Hello, >> >> I would like to change the color of the bor

[R] Change boxplot color

2012-09-21 Thread Simone Gabbriellini
Hello, I would like to change the color of the borders of my boxplot. Using col= I am able only to change the inside background of the boxplot, while I would like to have it transparent andchange the border instead. Any hint aamore than welcome, Best, Simone Inviato da iPhone

Re: [R] wireframe and par(mfrow)

2012-05-07 Thread Simone Gabbriellini
Thanks a lot for pointing me to that! Best, Simone 2012/5/7 David Winsemius : > > On May 7, 2012, at 7:15 AM, Simone Gabbriellini wrote: > >> Hello List, >> >> I have some plots with the wireframe() function, and I'd like to >> display them in a single

[R] wireframe and par(mfrow)

2012-05-07 Thread Simone Gabbriellini
ble(title, header=TRUE), nrow=5,ncol=4,byrow=FALSE) colnames(rank)<-c(.25,0.50,0.75,1.00) wireframe(rank, scales=list(arrows=FALSE), drape=TRUE, colorkey=TRUE, xlab="η", ylab="π",zlab="corr", screen = list(z = 45, x = -70), zlim=c(0,1), main="Rank")

[R] zero fill empty cell in data.frame

2011-04-19 Thread Simone Gabbriellini
Hello List, I have a data frame like: V130V131V132V133V134V135V136 1 0 0 0.9 0 0.9 0 0 2 0 0 0 0 0

Re: [R] how to simplify a data.frame and add the counts of duplicate rows as a new column

2011-03-02 Thread Simone Gabbriellini
ngth(columnB) > ) > > Scott > On Wednesday, March 2, 2011 at 9:10 AM, Simone Gabbriellini wrote: > >> Hello List, >> >> I would like to simplify a data.frame like this >> >> columnA columnB >> user10proj12 >> user10proj

[R] how to simplify a data.frame and add the counts of duplicate rows as a new column

2011-03-02 Thread Simone Gabbriellini
Hello List, I would like to simplify a data.frame like this columnA columnB user10 proj12 user10 proj19 user10 proj12 into something like: columnA columnB columnC user10 proj12 2 user10 proj19 1 I know unique() can simplify the dat

[R] fit a distribution

2011-02-18 Thread Simone Gabbriellini
hello list, I have this array of distribution of frequencies: freq<-c(45,18,10,8,13,5,9,3,4,1,2,2,2,3,4,4,1,1,2,1,2,1,1,1,1,1,2,3,1,1,1,1,1,1,1,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1) for this array of values: values<-c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18,19,20,21,

Re: [R] how to invert the axes in the wireframe() plot

2011-01-04 Thread Simone Gabbriellini
4/gen/2011, alle ore 01.26, David Winsemius ha scritto: > > On Jan 3, 2011, at 7:07 PM, Simone Gabbriellini wrote: > >> I am trying to reproduce this graph: >> >> http://www.digitaldust.it/materiali/their.png >> >> the default axes orientation of wirefram

Re: [R] how to invert the axes in the wireframe() plot

2011-01-03 Thread Simone Gabbriellini
Il giorno 03/gen/2011, alle ore 23.45, David Winsemius ha scritto: > > On Jan 3, 2011, at 5:06 PM, Simone Gabbriellini wrote: > >> Dear List, >> >> I am using the wireframe function in the lattice package, and I am wondering >> if it is possible to invert the d

[R] how to invert the axes in the wireframe() plot

2011-01-03 Thread Simone Gabbriellini
Dear List, I am using the wireframe function in the lattice package, and I am wondering if it is possible to invert the default axes orientation for x and y axes... what parameter should I look for? Best regards, Simone Gabbriellini __ R-help@r

[R] boxplot of timeseries with different lengths

2010-11-03 Thread Simone Gabbriellini
o force the tabled observations to the same length, in order to put them into a data frame? thanks in advance for any advice. best regards, Simone Gabbriellini __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] subset a data.frame

2010-11-02 Thread Simone Gabbriellini
many thanks, works perfectly! best, Simone Il giorno 02/nov/2010, alle ore 17.17, David Winsemius ha scritto: > > On Nov 2, 2010, at 11:53 AM, Simone Gabbriellini wrote: > >> Hello List, >> >> this should be simple, but cannot figure it out. I am trying to subset

[R] subset a data.frame

2010-11-02 Thread Simone Gabbriellini
; '2010-01-05 07:18:36', but I have no idea about the sintax to do that. is something like this close to the correct way: active<-data4['time'<= as.POSIXct("2010-01-05 07:18:36", origin="1970-01-01 00:00:00-00")] thanks in

[R] how to connect to a remote PostgreSQL database from R on mac osx

2010-10-20 Thread Simone Gabbriellini
. For sure I can connect to remote server with RODBC, but since I am on a Mac OSX 10.6, I have quite difficulties to find ODBC drivers and compile them. Any advice is more than welcome. best regards, Simone Gabbriellini __ R-help@r-project.org mailing

[R] how to simplify a table

2010-07-06 Thread Simone Gabbriellini
Hello List, as a result of a table(), I have this: 0 1 3 4 5 6 7 9 11 12 13 14 16 17 18 19 20 21 22 24 27 28 27 2 2 2 2 2 1 2 1 3 2 1 2 1 1 3 1 1 1 2 1 1 I would like to simplify it by grouping like: 0 0-5 6-10 11-15 16-20 21-25 26-30 25 84 7

Re: [R] eps file with embedded font

2009-09-09 Thread simone gabbriellini
is something seriously wrong with the function embedFonts(), or with ghostscript when executing the command generated by embedFonts(), or with both. I shal descibe the results of my esperminets, in the hope that some expert in embedFonts(), or in ghostscript, or in both, can make a useful suggestion.

[R] Fwd: eps file with embedded font

2009-09-04 Thread Simone Gabbriellini
-- Forwarded message -- From: Jonathan Baron Date: 2009/9/4 Subject: Re: [R] eps file with embedded font To: Simone Gabbriellini On 09/04/09 17:16, Simone Gabbriellini wrote: > thanks Jonathan, > > I was wondering about the difference between your second option and

Re: [R] eps file with embedded font

2009-09-04 Thread Simone Gabbriellini
thanks Jonathan, I was wondering about the difference between your second option and the Ted one: isn't it the same thing? regards, Simone 2009/9/4 Jonathan Baron : > A couple of other ideas about embedding fonts and setting bounding > boxes.  These all work on Linux, so in theory they should al

Re: [R] eps file with embedded font

2009-09-04 Thread Simone Gabbriellini
Thank for the help, unfortunately it doesn't work... it looks impossible to embed fonts... cairo should do this automatically but not for eps files at the moment... really don't know how to solve it. best regards, Simone 2009/9/4 Ted Harding : > On 04-Sep-09 14:01:44, Simone Gabbr

[R] eps file with embedded font

2009-09-04 Thread Simone Gabbriellini
Dear list, I am trying to make eps file with embedded font. I use: postscript("ranking-exp-all.eps", horizontal=TRUE, onefile=FALSE, paper="special", height=8, width=12, family="Helvetica") # plot stuff dev.off() since R does not embed font, I then use: embedFonts(file="indegdistr.eps", outfil

[R] how to estimate distribution?

2009-03-04 Thread Simone Gabbriellini
Dear R-Experts, I have an empirical dataset with 150 subjects for 24 observations. In each observation, each subject can have a score in the range 0:3. I made then a simple index making the sum of the values in each row, so each subject have a score between 0 and 72. I was thinking about what ki

Re: [R] how to select cases based on value of one or more variables

2008-11-30 Thread Simone Gabbriellini
cted: subset(students, Sex == 1) If you would rather keep the data as a list you could do something like lapply(students, function(x) x[students$Sex == 1]) hth, Kingsford Jones On Sun, Nov 30, 2008 at 2:15 PM, Simone Gabbriellini <[EMAIL PROTECTED]> wrote: sorry for my bad presentation.

Re: [R] how to select cases based on value of one or more variables

2008-11-30 Thread Simone Gabbriellini
cture of what read.spss() produces. I'd also suggest reading some of the documentation available from the R website (CRAN), notably, "An Introduction to R". -Don At 9:36 PM +0100 11/30/08, Simone Gabbriellini wrote: dear list, I have read a spss file with read.spss() now I

[R] how to select cases based on value of one or more variables

2008-11-30 Thread Simone Gabbriellini
dear list, I have read a spss file with read.spss() now I have a list with all my variable stored as vectors. is it possible to selec cases based on the value of one or more variables? thank you, Simone __ R-help@r-project.org mailing list https:

Re: [R] about centralization

2008-11-30 Thread Simone Gabbriellini
Weijia, if you only need degree centralization, Gabor suggests me those lines of code and they work great: ## undirected graph centralization<-(sum(max(degree(g))-degree(g)))/(vcount(g)-1)/ (vcount(g)-2 ## directed graph centralization<-(sum(max(degree(g))-degree(g)))/(2*vcount(g)-1)/ (vc

[R] Fwd: simple question with table()

2008-11-30 Thread simone gabbriellini
4 5 > 3 5 4 3 0 > > HTH, > > Jorge > > > > On Sun, Nov 30, 2008 at 5:05 AM, Simone Gabbriellini <[EMAIL PROTECTED] > > wrote: > Dear List, > > my problem should be easy to fix, but I couldn't find a solution by > myself... > > In my survey, there

[R] barplot labels

2008-11-30 Thread Simone Gabbriellini
Dear List, is it possible to plot vertical labels under vertical bars? for vertical labels I mean to rotate 90 degrees horizontal labels I suppose yes, because if excel can do this, R should do it twice better... thank you, Simone __ R-help@r-p

[R] simple question with table()

2008-11-30 Thread Simone Gabbriellini
Dear List, my problem should be easy to fix, but I couldn't find a solution by myself... In my survey, there is a question with 14 possible answers. None of the respondents choose the 13th answer, so when I table() the results, R says: 1 2 3 4 5 6 7

Re: [R] Agent-based social simulation and R

2008-11-07 Thread Simone Gabbriellini
great too), you can simply handle it via RPy. I've learned this strategy from Pietro Terna - http://web.econ.unito.it/terna/ hope it helps, Simone Gabbriellini Il giorno 07/nov/08, alle ore 13:06, Tom Backer Johnsen ha scritto: Do anyone know anything about the use of R for agent-ba

[R] cohesive blocks.. again

2008-02-28 Thread Simone Gabbriellini
hello, I have a last question on cohesive blocks: if there are multiple links between some nodes in the graph, this is taken into account by cohesive blocks? or the multiple links are simply ignored? thank you, Simone __ R-help@r-project.org mailin

Re: [R] how to interpolate a plot with a logistic curve

2007-12-06 Thread Simone Gabbriellini
Dear Christian, it works great, and it is simple to understand, thank you very much. just a detail, is it possible to plot just the fitted curve and not the data? it's because I would like to have data in black and the fitted curve in red.. I don't know how to pick up the single parts, if I

Re: [R] how to interpolate a plot with a logistic curve

2007-12-06 Thread Simone Gabbriellini
Dear Christian, it works great, and it is simple to understand, thank you very much. just a detail, is it possible to plot just the fitted curve and not the data? it's because I would like to have data in black and the fitted curve in red.. I don't know how to pick up the single parts, if I

[R] how to interpolate a plot with a logistic curve

2007-12-05 Thread Simone Gabbriellini
hello, I have this simple question. This is my dataset size 1 57 2 97 3 105 4 123 5 136 6 153 7 173 8 180 9 193 10 202 11 213 12 219 13 224 14 224 15 248 16 367 17 496 18 568 19 618 20