Forum Replies Created

Viewing 8 posts - 31 through 38 (of 38 total)
  • Author
    Posts
  • in reply to: How do I sort a dataset in R? #434
    bryan
    Participant

    Your code assumes that you’ve attached the “unsorted.df” data frame. I.e.,

    attach(unsorted.df)

    If you haven’t done that you’ll need to directly name the variables, so your code would be:

    sorted.df <- unsorted.df[order(unsorted.df$int.data, unsorted.df$comp.date), ]

    You might also try the orderBy() function in the "doBy" package. Once you understand the formula input you may find that format easier.

    in reply to: Expression data from TGCA: graphing expression data #361
    bryan
    Participant

    I’m not familiar with the TCGA database, but there is an extensive library on it here that may help:

    https://wiki.nci.nih.gov/display/TCGA/Sample+and+Data+Relationship+Format

    In the import that *is* working, I see that you’ve specified specified a tab delimiter, whereas in the ones that aren’t working you haven’t identified a delimiter. If you don’t identify a delimiter for read.table, it will use the default of “any white space”, which may not be appropriate. I would confirm what delimiter is needed and specify it directly.

    bryan
    Participant

    Can you provide a little more information (and maybe an example) of your data structure? It’s not clear how you’re calculating the difference in time from the first race. I.e., are you using the date of the race or the horses age to determine the time between races? The former seems more accurate, but it is unclear whether you have that data available. Also, what is the maximum number of races per horse?

    in reply to: question about Exponential Smoothing. #375
    bryan
    Participant

    const.widie,

    Are you trying to bring something in from a MySQL or Access database? In general, the ts package will have what you need for smoothing and creating time series data. There’s also a 2008 book on forecasting by Hyndman et al. (www.exponentialsmoothing.net) that has an associated R package and may be helpful.

    You may also want to check out the xts, zoo, and quantmod packages.

    in reply to: adding labels to x,y points #359
    bryan
    Participant

    Hi baumeist,

    A couple of recommendations:

    First, I would not use the attach command. It makes things a little more difficult in the long run than just using direct references to the variables (e.g., colon$norm1).

    Second, when you do this

    colon<-paste("g",c(1:nrow(colon)),sep="")

    you're creating an object with the same name as your attached data object. That is potentially confusing and could cause problems. Better to create something with a different name.

    However, I think your main problem is that you're using row.names() in the "labels = attribute" of the text() function when you don't need to. The "colon" object your creating is just a vector with no row.names attribute. Try dropping that and see if you get what you want.

    in reply to: Problem with script compiling #424
    bryan
    Participant

    Hi daveisme,

    What exactly are you trying to do? You usually don’t have to compile code in R. Are you just trying to create and include a function? If so, you probably want something more like this in your included code:

    model_logistic <- function { beta.0 ~ dnorm(0, 0.0001) beta.1 ~ dnorm(0, 0.0001) for (i in 1:N) { Y[i]~ dbin(theta[i], 1) logit(theta[i] <- beta.0+beta.1*X[i] } or <-exp(beta.1) }

    This is just an approximation based on a guess at your goal, but it should help you make some progress.

    in reply to: Hey I’m new #391
    bryan
    Participant

    You might also start with “A Handbook of Statistical Analyses Using R” and “Data Manipulation with R” (see the reviews on this site). They are good entry level books that will show you the power of R and teach you a few things that will be useful as you figure out how to conduct analyses.

    in reply to: Hey I’m new #387
    bryan
    Participant

    Begin by practicing using the three screens which will come up. As you move your mouse around from screen to screen (New Script – found under file in your first screen, Graphs – need to save as PDF file to be able to retrieve, and the first screen.) As you click to each screen you will see what is available to work with on that screen, as it changes for each screen. Good luck,

Viewing 8 posts - 31 through 38 (of 38 total)
Scroll to top
Privacy Policy